Class NodeFunctions
- java.lang.Object
-
- org.apache.jena.sparql.expr.nodevalue.NodeFunctions
-
public class NodeFunctions extends java.lang.ObjectImplementation of node-centric functions.
-
-
Constructor Summary
Constructors Constructor Description NodeFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NodecheckAndGetStringLiteral(java.lang.String label, NodeValue nv)check and get a string (may be a simple literal, literal with language tag or an XSD string).static voidcheckTwoArgumentStringLiterals(java.lang.String label, NodeValue arg1, NodeValue arg2)Check for string operations with primary first arg and second arg (e.g.static Nodedatatype(Node node)static NodeValuedatatype(NodeValue nv)static javax.xml.datatype.Durationduration(int seconds)A duration, tidedstatic Nodeiri(Node n, java.lang.String baseIRI)Node to Node, skolemizing, and converting strings to URIs.static NodeValueiri(NodeValue nv, java.lang.String baseIRI)NodeValue to NodeValue, skolemizing, and converting strings to URIs.static booleanisBlank(Node node)static NodeValueisBlank(NodeValue nv)static booleanisIRI(Node node)static NodeValueisIRI(NodeValue nv)static booleanisLiteral(Node node)static NodeValueisLiteral(NodeValue nv)static booleanisURI(Node node)static NodeValueisURI(NodeValue nv)static java.lang.Stringlang(Node node)static NodeValuelang(NodeValue nv)static booleanlangMatches(java.lang.String langStr, java.lang.String langPattern)The algorithm for the SPARQL function "LANGMATCHES".static NodeValuelangMatches(NodeValue nv, java.lang.String langPattern)LANGMATCHESstatic NodeValuelangMatches(NodeValue nv, NodeValue nvPattern)LANGMATCHESstatic booleanrdfTermEquals(Node n1, Node n2)static booleansameTerm(Node node1, Node node2)sameTerm(x,y)static NodeValuesameTerm(NodeValue nv1, NodeValue nv2)static NodeValuesortKey(NodeValue nv, java.lang.String collation)static java.lang.Stringstr(Node node)static NodeValuestr(NodeValue nv)static NodeValuestrDatatype(NodeValue v1, NodeValue v2)static NodeValuestrLang(NodeValue v1, NodeValue v2)static NodeValuestruuid()static NodeValueuuid()
-
-
-
Method Detail
-
checkAndGetStringLiteral
public static Node checkAndGetStringLiteral(java.lang.String label, NodeValue nv)
check and get a string (may be a simple literal, literal with language tag or an XSD string).
-
checkTwoArgumentStringLiterals
public static void checkTwoArgumentStringLiterals(java.lang.String label, NodeValue arg1, NodeValue arg2)Check for string operations with primary first arg and second arg (e.g. CONTAINS). The arguments are not used in the same way and the check operation is not symmetric.- "abc"@en is compatible with "abc"
- "abc" is NOT compatible with "abc"@en
-
str
public static java.lang.String str(Node node)
-
lang
public static java.lang.String lang(Node node)
-
langMatches
public static NodeValue langMatches(NodeValue nv, NodeValue nvPattern)
LANGMATCHES- Parameters:
nv- The language stringnvPattern- The pattern to match against- Returns:
- Boolean nodeValue
-
langMatches
public static NodeValue langMatches(NodeValue nv, java.lang.String langPattern)
LANGMATCHES- Parameters:
nv- The language stringlangPattern- The pattern to match against- Returns:
- Boolean nodeValue
-
langMatches
public static boolean langMatches(java.lang.String langStr, java.lang.String langPattern)The algorithm for the SPARQL function "LANGMATCHES". Matching in SPARQL is defined to be the language tag matching of RFC 4647, part of BCP 47.SPARQL uses basic matching which is single "*" or a prefix of subtags.
This code does not implement extended matching correctly.
- Parameters:
langStr- The language stringlangPattern- The pattern to match against- Returns:
- Whether there is a match.
-
isIRI
public static boolean isIRI(Node node)
-
isURI
public static boolean isURI(Node node)
-
isBlank
public static boolean isBlank(Node node)
-
isLiteral
public static boolean isLiteral(Node node)
-
iri
public static NodeValue iri(NodeValue nv, java.lang.String baseIRI)
NodeValue to NodeValue, skolemizing, and converting strings to URIs.
-
iri
public static Node iri(Node n, java.lang.String baseIRI)
Node to Node, skolemizing, and converting strings to URIs.
-
struuid
public static NodeValue struuid()
-
uuid
public static NodeValue uuid()
-
duration
public static javax.xml.datatype.Duration duration(int seconds)
A duration, tided
-
-