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

public class JsonLdNode extends Object
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 Details

    • BLANK_NODE_PREFIX

      public static final String BLANK_NODE_PREFIX
      The prefix of a blank node identifier.
      See Also:
  • Constructor Details

    • JsonLdNode

      public JsonLdNode(String id)
      Create a node.
      Parameters:
      id - identifier of the node
  • Method Details

    • getId

      public String 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

      public String getIRI()
      Return the IRI of the node.
      Returns:
      IRI or null if this is a blank node
    • getTypes

      public Set<String> getTypes()
      Return the IRIs of the types of the node.
      Returns:
      set of IRIs
    • hasType

      public boolean hasType(String typeIRI)
      Return whether the node has the requested type.
      Parameters:
      typeIRI - IRI of the type
      Returns:
      boolean
    • getProperties

      public Map<String,List<JsonLdValue>> getProperties()
      Return the properties of the node.
      Returns:
      map of property IRI to values
    • getValues

      public List<JsonLdValue> getValues(String propertyIRI)
      Return the values of a property.
      Parameters:
      propertyIRI - IRI of the property
      Returns:
      list of values - empty if the property is not set
    • addValue

      public void addValue(String propertyIRI, JsonLdValue value)
      Add a value to a property.
      Parameters:
      propertyIRI - IRI of the property
      value - value to add
    • toString

      public String toString()
      Standard toString method.
      Overrides:
      toString in class Object
      Returns:
      print out of variables in a JSON-style