Package org.apache.jena.graph
Class Node_Literal
- java.lang.Object
-
- org.apache.jena.graph.Node
-
- org.apache.jena.graph.Node_Concrete
-
- org.apache.jena.graph.Node_Literal
-
- All Implemented Interfaces:
java.io.Serializable
public class Node_Literal extends Node_Concrete
An RDF node holding a literal value. Literals may have datatypes.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jena.graph.Node
Node.NotLiteral
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
Nodes only equal other Nodes that have equal labels.java.lang.Object
getIndexingValue()
Literal nodes defer their indexing value to the component literal.LiteralLabel
getLiteral()
Answer the literal value of a literal node, or throw an UnsupportedOperationException if it's not a literal nodeRDFDatatype
getLiteralDatatype()
Answer the RDF datatype object of this node's literal value, if it is a literal; otherwise die horribly.java.lang.String
getLiteralDatatypeURI()
Answer the data-type URI of this node's literal value, if it is a literal; otherwise die horribly.boolean
getLiteralIsXML()
java.lang.String
getLiteralLanguage()
Answer the language of this node's literal value, if it is a literal; otherwise die horribly.java.lang.String
getLiteralLexicalForm()
Answer the lexical form of this node's literal value, if it is a literal; otherwise die horribly.java.lang.Object
getLiteralValue()
Answer the value of this node's literal value, if it is a literal; otherwise die horribly.boolean
isLiteral()
Answer true iff this node is a literal node [subclasses override]boolean
matches(Node x)
Answer true iff this node accepts the other one as a match.boolean
sameValueAs(java.lang.Object o)
Test that two nodes are semantically equivalent.java.lang.String
toString(PrefixMapping pm, boolean quoting)
Answer a human readable representation of this Node, quoting literals if specified, and compressing URIs using the prefix mapping supplied.java.lang.Object
visitWith(NodeVisitor v)
Visit a Node and dispatch on it to the appropriate method from the NodeVisitorv
.-
Methods inherited from class org.apache.jena.graph.Node_Concrete
isConcrete
-
Methods inherited from class org.apache.jena.graph.Node
getBlankNodeId, getBlankNodeLabel, getGraph, getLocalName, getName, getNameSpace, getTriple, getURI, hashCode, hasURI, isBlank, isExt, isNodeGraph, isNodeTriple, isURI, isVariable, toString, toString, toString
-
-
-
-
Method Detail
-
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 classNode
-
getLiteralValue
public final java.lang.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 classNode
-
getLiteralLexicalForm
public final java.lang.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 classNode
-
getLiteralLanguage
public final java.lang.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 classNode
-
getLiteralDatatypeURI
public final java.lang.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 classNode
-
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 classNode
-
getLiteralIsXML
public final boolean getLiteralIsXML()
- Overrides:
getLiteralIsXML
in classNode
-
toString
public java.lang.String toString(PrefixMapping pm, boolean quoting)
Description copied from class:Node
Answer a human readable representation of this Node, quoting literals if specified, and compressing URIs using the prefix mapping supplied.
-
isLiteral
public boolean isLiteral()
Description copied from class:Node
Answer true iff this node is a literal node [subclasses override]
-
getIndexingValue
public java.lang.Object getIndexingValue()
Literal nodes defer their indexing value to the component literal.- Overrides:
getIndexingValue
in classNode
- See Also:
Node.getIndexingValue()
-
visitWith
public java.lang.Object visitWith(NodeVisitor v)
Description copied from class:Node
Visit a Node and dispatch on it to the appropriate method from the NodeVisitorv
.
-
equals
public boolean equals(java.lang.Object other)
Description copied from class:Node
Nodes only equal other Nodes that have equal labels.
-
sameValueAs
public boolean sameValueAs(java.lang.Object o)
Test that two nodes are semantically equivalent. In some cases this may be the same as equals, in others equals is stricter. For example, two xsd:int literals with the same value but different language tag are semantically equivalent but distinguished by the java equality function in order to support round tripping.Default implementation is to use equals, subclasses should override this.
- Overrides:
sameValueAs
in classNode
-
-