Package org.apache.jena.sparql.util
Class NodeUtils
- java.lang.Object
-
- org.apache.jena.sparql.util.NodeUtils
-
public class NodeUtils extends java.lang.ObjectNode utilities
-
-
Field Summary
Fields Modifier and Type Field Description static EqualityTestsameNodeBoth null or same node :Node.equalsstatic EqualityTestsameRdfTermTerm comparison.static EqualityTestsameValuesameValue by SPARQL rules
-
Constructor Summary
Constructors Constructor Description NodeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NodeasNode(java.lang.String iri)IRI 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 valuestatic java.util.List<Node>convertToListNodes(java.lang.String... namedGraphs)Convert strings to a List ofNodes.static java.util.List<Node>convertToListNodes(java.util.List<java.lang.String> namedGraphs)Convert strings to a List ofNodes.static java.util.Set<Node>convertToSetNodes(java.lang.String... namedGraphs)Convert a collection of strings to a set ofNodes.static java.util.Set<Node>convertToSetNodes(java.util.Collection<java.lang.String> namedGraphs)Convert a collection of strings to a set ofNodes.static booleanhasLang(Node node)Return 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 booleanisSimpleString(Node n)A Node is a simple string if: (RDF 1.0) No datatype and no language tag (RDF 1.1) xsd:stringstatic java.util.Iterator<java.lang.String>nodesToURIs(java.util.Iterator<Node> iter)Convert IRI Nodes to strings.static java.lang.StringstringLiteral(Node literal)Get lexical for of anything that looks like a string literal.
-
-
-
Field Detail
-
sameNode
public static EqualityTest sameNode
Both null or same node :Node.equals
-
sameRdfTerm
public static EqualityTest sameRdfTerm
Term comparison. Node.equals or lang tags are case insensitive
-
sameValue
public static EqualityTest sameValue
sameValue by SPARQL rules
-
-
Method Detail
-
asNode
public static Node asNode(org.apache.jena.iri.IRI iri)
IRI to Node
-
asNode
public static Node asNode(java.lang.String iri)
IRI string to Node
-
hasLang
public static boolean hasLang(Node node)
Return true if the node is a literal and has a language tag
-
stringLiteral
public static java.lang.String stringLiteral(Node literal)
Get lexical for of anything that looks like a string literal. Returns the string value of plain literal (simple literal or lang string) or XSD string.
-
nodesToURIs
public static java.util.Iterator<java.lang.String> nodesToURIs(java.util.Iterator<Node> iter)
Convert IRI Nodes to strings. Skip other kinds of Node
-
convertToSetNodes
public static java.util.Set<Node> convertToSetNodes(java.util.Collection<java.lang.String> namedGraphs)
Convert a collection of strings to a set ofNodes.
-
convertToSetNodes
public static java.util.Set<Node> convertToSetNodes(java.lang.String... namedGraphs)
Convert a collection of strings to a set ofNodes.
-
convertToListNodes
public static java.util.List<Node> convertToListNodes(java.lang.String... namedGraphs)
Convert strings to a List ofNodes.
-
convertToListNodes
public static java.util.List<Node> convertToListNodes(java.util.List<java.lang.String> namedGraphs)
Convert strings to a List ofNodes.
-
compareRDFTerms
public static int compareRDFTerms(Node node1, Node node2)
Compare two Nodes, based on their RDF terms forms, not value
-
isSimpleString
public static boolean isSimpleString(Node n)
A Node is a simple string if:- (RDF 1.0) No datatype and no language tag
- (RDF 1.1) xsd:string
-
isLangString
public static boolean isLangString(Node n)
A Node is a language string if it has a language tag. (RDF 1.0 and RDF 1.1)
-
-