Class QueryEvaluationUtility
- java.lang.Object
-
- org.eclipse.rdf4j.query.algebra.evaluation.util.QueryEvaluationUtility
-
@InternalUseOnly public class QueryEvaluationUtility extends Object
This class will take over for QueryEvaluationUtil. Currently marked as InternalUseOnly because there may still be changes to how this class works.- Author:
- Arjohn Kampman, HÃ¥vard M. Ottestad
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQueryEvaluationUtility.Result
-
Constructor Summary
Constructors Constructor Description QueryEvaluationUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static QueryEvaluationUtility.Resultcompare(org.eclipse.rdf4j.model.Value leftVal, org.eclipse.rdf4j.model.Value rightVal, Compare.CompareOp operator)static QueryEvaluationUtility.Resultcompare(org.eclipse.rdf4j.model.Value leftVal, org.eclipse.rdf4j.model.Value rightVal, Compare.CompareOp operator, boolean strict)static org.eclipse.rdf4j.query.algebra.evaluation.util.QueryEvaluationUtility.OrdercompareLiterals(org.eclipse.rdf4j.model.Literal leftLit, org.eclipse.rdf4j.model.Literal rightLit, boolean strict)static QueryEvaluationUtility.ResultcompareLiterals(org.eclipse.rdf4j.model.Literal leftLit, org.eclipse.rdf4j.model.Literal rightLit, Compare.CompareOp operator)Compares the suppliedLiteralarguments using the supplied operator, using strict (minimally-conforming) SPARQL 1.1 operator behavior.static QueryEvaluationUtility.ResultcompareLiterals(org.eclipse.rdf4j.model.Literal leftLit, org.eclipse.rdf4j.model.Literal rightLit, Compare.CompareOp operator, boolean strict)Compares the suppliedLiteralarguments using the supplied operator.static booleancompatibleArguments(org.eclipse.rdf4j.model.Literal arg1, org.eclipse.rdf4j.model.Literal arg2)Checks whether the supplied two literal arguments are 'argument compatible' according to the SPARQL definition.static QueryEvaluationUtility.ResultgetEffectiveBooleanValue(org.eclipse.rdf4j.model.Value value)Determines the effective boolean value (EBV) of the supplied value as defined in the SPARQL specification: The EBV of any literal whose type is CoreDatatype.XSD:boolean or numeric is false if the lexical form is not valid for that datatype (e.g.static booleanisPlainLiteral(org.eclipse.rdf4j.model.Literal l)static booleanisPlainLiteral(org.eclipse.rdf4j.model.Value v)Checks whether the supplied value is a "plain literal".static booleanisSimpleLiteral(boolean isLang, org.eclipse.rdf4j.model.base.CoreDatatype datatype)Checks whether the supplied literal is a "simple literal".static booleanisSimpleLiteral(org.eclipse.rdf4j.model.Literal l)Checks whether the supplied literal is a "simple literal".static booleanisSimpleLiteral(org.eclipse.rdf4j.model.Value v)Checks whether the supplied value is a "simple literal".static booleanisStringLiteral(org.eclipse.rdf4j.model.Literal l)Checks whether the supplied literal is a "string literal".static booleanisStringLiteral(org.eclipse.rdf4j.model.Value v)Checks whether the supplied literal is a "string literal".
-
-
-
Method Detail
-
getEffectiveBooleanValue
public static QueryEvaluationUtility.Result getEffectiveBooleanValue(org.eclipse.rdf4j.model.Value value)
Determines the effective boolean value (EBV) of the supplied value as defined in the SPARQL specification:- The EBV of any literal whose type is CoreDatatype.XSD:boolean or numeric is false if the lexical form is not valid for that datatype (e.g. "abc"^^xsd:integer).
- If the argument is a typed literal with a datatype of CoreDatatype.XSD:boolean, the EBV is the value of that argument.
- If the argument is a plain literal or a typed literal with a datatype of CoreDatatype.XSD:string, the EBV is false if the operand value has zero length; otherwise the EBV is true.
- If the argument is a numeric type or a typed literal with a datatype derived from a numeric type, the EBV is false if the operand value is NaN or is numerically equal to zero; otherwise the EBV is true.
- All other arguments, including unbound arguments, produce a type error.
- Parameters:
value- Some value.- Returns:
- The EBV of value.
-
compare
public static QueryEvaluationUtility.Result compare(org.eclipse.rdf4j.model.Value leftVal, org.eclipse.rdf4j.model.Value rightVal, Compare.CompareOp operator)
-
compare
public static QueryEvaluationUtility.Result compare(org.eclipse.rdf4j.model.Value leftVal, org.eclipse.rdf4j.model.Value rightVal, Compare.CompareOp operator, boolean strict)
-
compareLiterals
public static QueryEvaluationUtility.Result compareLiterals(org.eclipse.rdf4j.model.Literal leftLit, org.eclipse.rdf4j.model.Literal rightLit, Compare.CompareOp operator)
Compares the suppliedLiteralarguments using the supplied operator, using strict (minimally-conforming) SPARQL 1.1 operator behavior.- Parameters:
leftLit- the left literal argument of the comparison.rightLit- the right literal argument of the comparison.operator- the comparison operator to use.- Returns:
trueif execution of the supplied operator on the supplied arguments succeeds,falseotherwise.
-
compareLiterals
public static org.eclipse.rdf4j.query.algebra.evaluation.util.QueryEvaluationUtility.Order compareLiterals(org.eclipse.rdf4j.model.Literal leftLit, org.eclipse.rdf4j.model.Literal rightLit, boolean strict)
-
compareLiterals
public static QueryEvaluationUtility.Result compareLiterals(org.eclipse.rdf4j.model.Literal leftLit, org.eclipse.rdf4j.model.Literal rightLit, Compare.CompareOp operator, boolean strict)
Compares the suppliedLiteralarguments using the supplied operator.- Parameters:
leftLit- the left literal argument of the comparison.rightLit- the right literal argument of the comparison.operator- the comparison operator to use.strict- boolean indicating whether comparison should use strict (minimally-conforming) SPARQL 1.1 operator behavior, or extended behavior.- Returns:
trueif execution of the supplied operator on the supplied arguments succeeds,falseotherwise.
-
isPlainLiteral
public static boolean isPlainLiteral(org.eclipse.rdf4j.model.Value v)
Checks whether the supplied value is a "plain literal". A "plain literal" is a literal with no datatype and optionally a language tag.- See Also:
- RDF Literal Documentation
-
isPlainLiteral
public static boolean isPlainLiteral(org.eclipse.rdf4j.model.Literal l)
-
isSimpleLiteral
public static boolean isSimpleLiteral(org.eclipse.rdf4j.model.Value v)
Checks whether the supplied value is a "simple literal". A "simple literal" is a literal with no language tag nor datatype.- See Also:
- SPARQL Simple Literal Documentation
-
isSimpleLiteral
public static boolean isSimpleLiteral(org.eclipse.rdf4j.model.Literal l)
Checks whether the supplied literal is a "simple literal". A "simple literal" is a literal with no language tag and the datatypeCoreDatatype.XSD.STRING.- See Also:
- SPARQL Simple Literal Documentation
-
isSimpleLiteral
public static boolean isSimpleLiteral(boolean isLang, org.eclipse.rdf4j.model.base.CoreDatatype datatype)Checks whether the supplied literal is a "simple literal". A "simple literal" is a literal with no language tag and the datatypeCoreDatatype.XSD.STRING.- See Also:
- SPARQL Simple Literal Documentation
-
isStringLiteral
public static boolean isStringLiteral(org.eclipse.rdf4j.model.Value v)
Checks whether the supplied literal is a "string literal". A "string literal" is either a simple literal, a plain literal with language tag, or a literal with datatype CoreDatatype.XSD:string.
-
compatibleArguments
public static boolean compatibleArguments(org.eclipse.rdf4j.model.Literal arg1, org.eclipse.rdf4j.model.Literal arg2)Checks whether the supplied two literal arguments are 'argument compatible' according to the SPARQL definition.- Parameters:
arg1- the first argumentarg2- the second argument- Returns:
- true iff the two supplied arguments are argument compatible, false otherwise
- See Also:
- SPARQL Argument Compatibility Rules
-
isStringLiteral
public static boolean isStringLiteral(org.eclipse.rdf4j.model.Literal l)
Checks whether the supplied literal is a "string literal". A "string literal" is either a simple literal, a plain literal with language tag, or a literal with datatype CoreDatatype.XSD:string.
-
-