Class Node_Literal

java.lang.Object
org.apache.jena.graph.Node
org.apache.jena.graph.Node_Literal
All Implemented Interfaces:
Serializable

public class Node_Literal extends Node
An RDF node holding a literal value. Literals may have datatypes.
See Also:
  • Method Details

    • isConcrete

      public boolean isConcrete()
      Description copied from class: Node
      Answer true iff this node is concrete, meaning a node that is data in an RDF Graph.
      Specified by:
      isConcrete in class Node
    • getLiteral

      public LiteralLabel getLiteral()
      Description copied from class: Node
      Answer the literal value of a literal node, or throw an UnsupportedOperationException if it's not a literal node
      Overrides:
      getLiteral in class Node
    • getLiteralValue

      public final Object getLiteralValue()
      Description copied from class: Node
      Answer the value of this node's literal value, if it is a literal; otherwise die horribly.
      Overrides:
      getLiteralValue in class Node
    • getLiteralLexicalForm

      public final String getLiteralLexicalForm()
      Description copied from class: Node
      Answer the lexical form of this node's literal value, if it is a literal; otherwise die horribly.
      Overrides:
      getLiteralLexicalForm in class Node
    • getLiteralLanguage

      public final String getLiteralLanguage()
      Description copied from class: Node
      Answer the language of this node's literal value, if it is a literal; otherwise die horribly.
      Overrides:
      getLiteralLanguage in class Node
    • getLiteralBaseDirection

      public final TextDirection getLiteralBaseDirection()
      Description copied from class: Node
      Return the base direction for a literal. Returns null if the node is a literal and does not have a base direction. Otherwise die horribly.
      Overrides:
      getLiteralBaseDirection in class Node
    • getLiteralDatatypeURI

      public final String getLiteralDatatypeURI()
      Description copied from class: Node
      Answer the data-type URI of this node's literal value, if it is a literal; otherwise die horribly.
      Overrides:
      getLiteralDatatypeURI in class Node
    • getLiteralDatatype

      public final RDFDatatype getLiteralDatatype()
      Description copied from class: Node
      Answer the RDF datatype object of this node's literal value, if it is a literal; otherwise die horribly.
      Overrides:
      getLiteralDatatype in class Node
    • isLiteral

      public boolean isLiteral()
      Description copied from class: Node
      Answer true iff this node is a literal node [subclasses override]
      Overrides:
      isLiteral in class Node
    • getIndexingValue

      public Object getIndexingValue()
      Indexing object for literals. Literal nodes defer their indexing value to the component literal.
      Overrides:
      getIndexingValue in class Node
      See Also:
    • visitWith

      public Object visitWith(NodeVisitor v)
      Description copied from class: Node
      Visit a Node and dispatch on it to the appropriate method from the NodeVisitor v.
      Specified by:
      visitWith in class Node
      Parameters:
      v - the visitor to apply to the node
      Returns:
      the value returned by the applied method
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class Node
    • equals

      public boolean equals(Object obj)
      Description copied from class: Node
      Java rules for equals. See also {#sameTermAs} and {#sameValueAs}. .equals is "same RDF Term" with all the rules of Java equality such as "null" handling.
      Specified by:
      equals in class Node
    • sameValueAs

      public boolean sameValueAs(Node other)
      Description copied from class: Node
      Test that two nodes represent the same value.

      In some cases this may be the same as Node.sameTermAs(org.apache.jena.graph.Node). For example, two xsd:int literals with the same value but different lexical form are semantically equivalent but distinguished by the java equals function.

      The default implementation is to use Node.equals(java.lang.Object); subclasses should override this.

      The Node argument must not be null.
      Overrides:
      sameValueAs in class Node
    • toString

      public String toString(PrefixMapping pm)
      Description copied from class: Node
      Answer a human-readable representation of the Node. For URIs, abbreviate URI. For literals, quoting literals and abbreviating datatype URI.
      Specified by:
      toString in class Node
    • toString

      public String toString()
      Description copied from class: Node
      Answer a human-readable representation of this Node.
      Specified by:
      toString in class Node