Class JsonLdGraph
java.lang.Object
org.odpi.openmetadata.frameworks.integration.dcat.jsonld.JsonLdGraph
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUnresolvedContext(String contextIRI) Record that the document referred to a context that was not embedded in it.Return the node with the requested identifier.getNodes()Return all the nodes in the order that they were first seen in the document.getNodesOfType(String typeIRI) Return the nodes of the requested type in the order that they were first seen in the document.Return the node with the requested identifier, creating it if it is not already known.Return the locations of the contexts that the document referred to but did not embed.Return a new blank node identifier.
-
Constructor Details
-
JsonLdGraph
public JsonLdGraph()Default constructor
-
-
Method Details
-
getOrCreateNode
Return the node with the requested identifier, creating it if it is not already known.- Parameters:
id- identifier of the node- Returns:
- node
-
getNode
Return the node with the requested identifier.- Parameters:
id- identifier of the node- Returns:
- node or null if it is not known
-
getNodes
Return all the nodes in the order that they were first seen in the document.- Returns:
- collection of nodes
-
getNodesOfType
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
Return a new blank node identifier.- Returns:
- identifier
-
addUnresolvedContext
Record that the document referred to a context that was not embedded in it.- Parameters:
contextIRI- location of the context
-
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
-