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

public class JsonLdValue extends Object
JsonLdValue is a value of a property of a node in a JSON-LD graph. It is either a literal (a string with an optional language or datatype) or a reference to another node.
  • Method Details

    • literal

      public static JsonLdValue literal(String value, String language, String datatype)
      Create a literal value.
      Parameters:
      value - literal value
      language - language tag (may be null)
      datatype - IRI of the datatype (may be null)
      Returns:
      value
    • reference

      public static JsonLdValue reference(String nodeId)
      Create a reference to another node.
      Parameters:
      nodeId - identifier of the node - either an IRI or a blank node identifier
      Returns:
      value
    • isReference

      public boolean isReference()
      Return whether this value is a reference to another node.
      Returns:
      boolean
    • getValue

      public String getValue()
      Return the literal value.
      Returns:
      string or null if this is a reference
    • getLanguage

      public String getLanguage()
      Return the language tag of the literal.
      Returns:
      string or null
    • getDatatype

      public String getDatatype()
      Return the IRI of the datatype of the literal.
      Returns:
      string or null
    • getNodeId

      public String getNodeId()
      Return the identifier of the referenced node.
      Returns:
      string or null if this is a literal
    • toString

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