java.lang.Object
org.apache.jena.sparql.expr.ExprLib
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic NodeValue
evalOrNull
(Expr expr, Binding binding, FunctionEnv functionEnv) Evaluate or return null.static Expr
foldConstants
(Expr expr) Attempt to fold any sub-expressions of the Expr.static boolean
isAssignmentSafeEquality
(Expr expr) Decide whether an expression is safe for using a graph substitution.static boolean
isAssignmentSafeEquality
(Expr expr, boolean graphHasStringEquality, boolean graphHasNumercialValueEquality) static boolean
Some "functions" are non-deterministic (unstable) - calling them with the same arguments does not yields the same answer each time.static Expr
nodeToExpr
(org.apache.jena.graph.Node n) Go from a node to an expression.static Expr
transform an expression that may involve aggregates into one that just uses the variable for the aggregatestatic Expr
rewriteTriple
(org.apache.jena.graph.Triple t)
-
Constructor Details
-
ExprLib
public ExprLib()
-
-
Method Details
-
evalOrNull
Evaluate or return null.This is better (faster) than the simple implementation which captures
ExprEvalException
and returns null. -
foldConstants
Attempt to fold any sub-expressions of the Expr. Return an expression that is equivalent to the argument but maybe simpler.- Parameters:
expr
-- Returns:
- Expression
-
replaceAggregateByVariable
transform an expression that may involve aggregates into one that just uses the variable for the aggregate -
isAssignmentSafeEquality
Decide whether an expression is safe for using a graph substitution. Need to be careful about value-like tests when the graph is not matched in a value fashion. -
isAssignmentSafeEquality
public static boolean isAssignmentSafeEquality(Expr expr, boolean graphHasStringEquality, boolean graphHasNumercialValueEquality) - Parameters:
graphHasStringEquality
- True if the graph triple matching equates xsd:string and plain literalgraphHasNumercialValueEquality
- True if the graph triple matching equates numeric values
-
isStable
Some "functions" are non-deterministic (unstable) - calling them with the same arguments does not yields the same answer each time. Therefore how and when they are called matters. Functions: RAND, UUID, StrUUID, BNode NOW() is safe. -
nodeToExpr
Go from a node to an expression. -
rewriteTriple
-