java.lang.Object
org.odpi.openmetadata.frameworks.integration.dcat.jsonld.JsonLdGraph

public class JsonLdGraph extends Object
JsonLdGraph holds the nodes read from a JSON-LD document. The nested nodes of the document are flattened so that every node can be found through its identifier, and the descriptions of a node that appear in different parts of the document are merged.
  • Constructor Details

    • JsonLdGraph

      public JsonLdGraph()
      Default constructor
  • Method Details

    • getOrCreateNode

      public JsonLdNode getOrCreateNode(String id)
      Return the node with the requested identifier, creating it if it is not already known.
      Parameters:
      id - identifier of the node
      Returns:
      node
    • getNode

      public JsonLdNode getNode(String id)
      Return the node with the requested identifier.
      Parameters:
      id - identifier of the node
      Returns:
      node or null if it is not known
    • getNodes

      public Collection<JsonLdNode> getNodes()
      Return all the nodes in the order that they were first seen in the document.
      Returns:
      collection of nodes
    • getNodesOfType

      public List<JsonLdNode> getNodesOfType(String typeIRI)
      Return the nodes of the requested type in the order that they were first seen in the document.
      Parameters:
      typeIRI - IRI of the type
      Returns:
      list of nodes
    • newBlankNodeId

      public String newBlankNodeId()
      Return a new blank node identifier.
      Returns:
      identifier
    • addUnresolvedContext

      public void addUnresolvedContext(String contextIRI)
      Record that the document referred to a context that was not embedded in it.
      Parameters:
      contextIRI - location of the context
    • getUnresolvedContexts

      public Set<String> getUnresolvedContexts()
      Return the locations of the contexts that the document referred to but did not embed. These contexts are not retrieved, so terms that only they define are resolved using the standard names of the DCAT vocabulary.
      Returns:
      set of IRIs