Package org.apache.jena.sparql.util
Class NodeUtils
java.lang.Object
org.apache.jena.sparql.util.NodeUtils
Node utilities
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic EqualityTestBoth null or same node :Node.equalsstatic EqualityTestTerm comparison.static EqualityTestsameValue by SPARQL rules -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NodeIRI string to Nodestatic NodeasNode(org.apache.jena.iri.IRI iri) IRI to Nodestatic intcompareRDFTerms(Node node1, Node node2) Compare two Nodes, based on their RDF terms forms, not valueconvertToListNodes(String... namedGraphs) Convert strings to a List ofNodes.convertToListNodes(List<String> namedGraphs) Convert strings to a List ofNodes.convertToSetNodes(String... namedGraphs) Convert a collection of strings to a set ofNodes.convertToSetNodes(Collection<String> namedGraphs) Convert a collection of strings to a set ofNodes.static booleanReturn true if the node is a literal and has a language tagstatic booleanisLangString(Node n) A Node is a language string if it has a language tag.static booleanA Node is a simple string if: (RDF 1.0) No datatype and no language tag (RDF 1.1) xsd:stringstatic booleanisXSDNumeric(Node node) Return true if the node is a literal and has an XSD numeric datatype.nodesToURIs(Iterator<Node> iter) Convert IRI Nodes to strings.static Nodestatic StringstringLiteral(Node literal) Get lexical form of anything that looks like a string literal.
-
Field Details
-
sameNode
Both null or same node :Node.equals -
sameRdfTerm
Term comparison. Node.equals or lang tags are case insensitive -
sameValue
sameValue by SPARQL rules
-
-
Constructor Details
-
NodeUtils
public NodeUtils()
-
-
Method Details
-
asNode
IRI to Node -
asNode
IRI string to Node -
hasLang
Return true if the node is a literal and has a language tag -
stringLiteral
Get lexical form of anything that looks like a string literal. Returns the string value of plain literal (simple literal or lang string) or XSD string. -
nullToAny
-
nodesToURIs
Convert IRI Nodes to strings. Skip other kinds of Node -
convertToSetNodes
Convert a collection of strings to a set ofNodes. -
convertToSetNodes
Convert a collection of strings to a set ofNodes. -
convertToListNodes
Convert strings to a List ofNodes. -
convertToListNodes
Convert strings to a List ofNodes. -
compareRDFTerms
Compare two Nodes, based on their RDF terms forms, not value -
isSimpleString
A Node is a simple string if:- (RDF 1.0) No datatype and no language tag
- (RDF 1.1) xsd:string
-
isLangString
A Node is a language string if it has a language tag. (RDF 1.0 and RDF 1.1) -
isXSDNumeric
Return true if the node is a literal and has an XSD numeric datatype.
-