public abstract class Node extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Node.NotLiteral
Exception thrown if a literal-access operation is attemted on a
non-literal node.
|
Modifier and Type | Field and Description |
---|---|
static Node |
ANY
The canonical instance of Node_ANY.
|
static Node |
NULL
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static Node |
create(org.apache.jena.graph.Node.NodeMaker maker,
Object label)
Deprecated.
Use specific
NodeFactory functions. |
abstract boolean |
equals(Object o)
Nodes only equal other Nodes that have equal labels.
|
BlankNodeId |
getBlankNodeId()
get the blank node id if the node is blank, otherwise die horribly
|
String |
getBlankNodeLabel()
Answer the label of this blank node or throw an UnsupportedOperationException
if it's not blank.
|
Object |
getIndexingValue()
Answer the object which is the index value for this Node.
|
LiteralLabel |
getLiteral()
Answer the literal value of a literal node, or throw an UnsupportedOperationException
if it's not a literal node
|
RDFDatatype |
getLiteralDatatype()
Answer the RDF datatype object of this node's literal value, if it is
a literal; otherwise die horribly.
|
String |
getLiteralDatatypeURI()
Answer the data-type URI of this node's literal value, if it is a
literal; otherwise die horribly.
|
boolean |
getLiteralIsXML() |
String |
getLiteralLanguage()
Answer the language of this node's literal value, if it is a literal;
otherwise die horribly.
|
String |
getLiteralLexicalForm()
Answer the lexical form of this node's literal value, if it is a literal;
otherwise die horribly.
|
Object |
getLiteralValue()
Answer the value of this node's literal value, if it is a literal;
otherwise die horribly.
|
String |
getLocalName()
get the localname part of this node if it's a URI node, else die horribly
|
String |
getName()
get a variable nodes name, otherwise die horribly
|
String |
getNameSpace()
get the namespace part of this node if it's a URI node, else die horribly
|
String |
getURI()
get the URI of this node if it has one, else die horribly
|
int |
hashCode() |
boolean |
hasURI(String uri)
answer true iff this node is a URI node with the given URI
|
boolean |
isBlank()
Answer true iff this node is a blank node [subclasses override]
|
abstract boolean |
isConcrete()
Answer true iff this node is concrete, ie not variable, ie URI, blank, or literal.
|
boolean |
isLiteral()
Answer true iff this node is a literal node [subclasses override]
|
boolean |
isURI()
Answer true iff this node is a URI node [subclasses override]
|
boolean |
isVariable()
Answer true iff this node is a variable node - subclasses override
|
boolean |
matches(Node other)
Answer true iff this node accepts the other one as a match.
|
boolean |
sameValueAs(Object o)
Test that two nodes are semantically equivalent.
|
String |
toString()
Answer a human-readable representation of this Node.
|
String |
toString(boolean quoting)
Answer a human-readable representation of this Node where literals are
quoted according to
quoting but URIs are not compressed. |
String |
toString(PrefixMapping pm)
Answer a human-readable representation of the Node, quoting literals and
compressing URIs.
|
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.
|
abstract Object |
visitWith(NodeVisitor v)
Visit a Node and dispatch on it to the appropriate method from the
NodeVisitor
v . |
public static final Node ANY
@Deprecated public static final Node NULL
public abstract Object visitWith(NodeVisitor v)
v
.v
- the visitor to apply to the nodepublic abstract boolean isConcrete()
public boolean isLiteral()
public boolean isBlank()
public boolean isURI()
public boolean isVariable()
public BlankNodeId getBlankNodeId()
public String getBlankNodeLabel()
public LiteralLabel getLiteral()
public Object getLiteralValue()
public String getLiteralLexicalForm()
public String getLiteralLanguage()
public String getLiteralDatatypeURI()
public RDFDatatype getLiteralDatatype()
public boolean getLiteralIsXML()
public Object getIndexingValue()
public String getURI()
public String getNameSpace()
public String getLocalName()
public String getName()
public boolean hasURI(String uri)
@Deprecated public static Node create(org.apache.jena.graph.Node.NodeMaker maker, Object label)
NodeFactory
functions.public abstract boolean equals(Object o)
public boolean sameValueAs(Object o)
Default implementation is to use equals, subclasses should override this.
public boolean matches(Node other)
other
- a node to test for matchingpublic String toString()
public String toString(boolean quoting)
quoting
but URIs are not compressed.public String toString(PrefixMapping pm)
public String toString(PrefixMapping pm, boolean quoting)
Licenced under the Apache License, Version 2.0