Class JsonLdNode
java.lang.Object
org.odpi.openmetadata.frameworks.integration.dcat.jsonld.JsonLdNode
JsonLdNode is a node in a JSON-LD graph. It has an identifier (an IRI or a blank node identifier), a set of types
and a map of property IRIs to values.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValue(String propertyIRI, JsonLdValue value) Add a value to a property.getId()Return the identifier of the node.getIRI()Return the IRI of the node.Return the properties of the node.getTypes()Return the IRIs of the types of the node.Return the values of a property.booleanReturn whether the node has the requested type.booleanisBlank()Return whether the node is a blank node - that is, it has no IRI.toString()Standard toString method.
-
Field Details
-
BLANK_NODE_PREFIX
The prefix of a blank node identifier.- See Also:
-
-
Constructor Details
-
JsonLdNode
Create a node.- Parameters:
id- identifier of the node
-
-
Method Details
-
getId
Return the identifier of the node.- Returns:
- IRI or blank node identifier
-
isBlank
public boolean isBlank()Return whether the node is a blank node - that is, it has no IRI.- Returns:
- boolean
-
getIRI
Return the IRI of the node.- Returns:
- IRI or null if this is a blank node
-
getTypes
Return the IRIs of the types of the node.- Returns:
- set of IRIs
-
hasType
Return whether the node has the requested type.- Parameters:
typeIRI- IRI of the type- Returns:
- boolean
-
getProperties
Return the properties of the node.- Returns:
- map of property IRI to values
-
getValues
Return the values of a property.- Parameters:
propertyIRI- IRI of the property- Returns:
- list of values - empty if the property is not set
-
addValue
Add a value to a property.- Parameters:
propertyIRI- IRI of the propertyvalue- value to add
-
toString
Standard toString method.
-