java.lang.Object
org.apache.jena.sparql.expr.ExprNode
org.apache.jena.sparql.expr.NodeValue
- All Implemented Interfaces:
Expr
- Direct Known Subclasses:
NodeValueBoolean,NodeValueDateTime,NodeValueDecimal,NodeValueDouble,NodeValueDuration,NodeValueFloat,NodeValueInteger,NodeValueLang,NodeValueLangDir,NodeValueNode,NodeValueSortKey,NodeValueString
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NodeValuestatic final NodeValuestatic final NodeValuestatic final NodeValuestatic final NodeValuestatic final NodeValuestatic final NodeValuestatic final NodeValuestatic final NodeValueDeprecated.static final NodeValueDeprecated.UsenvDoubleNaNstatic final NodeValueDeprecated.UsenvDoubleNegINFstatic final NodeValueDeprecated.UsenvDoubleNegZEROstatic final NodeValuestatic final NodeValuestatic final NodeValuestatic final NodeValuestatic booleanstatic booleanstatic DatatypeFactorystatic final StringFields inherited from interface org.apache.jena.sparql.expr.Expr
CMP_EQUAL, CMP_GREATER, CMP_INDETERMINATE, CMP_LESS, CMP_UNEQUAL, NONE -
Method Summary
Modifier and TypeMethodDescriptionapply(ExprTransform transform) applyNodeTransform(NodeTransform transform) Rewrite, applying a node->node transformationfinal org.apache.jena.graph.NodeasNode()final Stringfinal StringasQuotedString(SerializationContext context) asString()final Stringstatic NodeValuebooleanReturn(boolean b) static ValueSpaceclassifyValueOp(NodeValue nv1, NodeValue nv2) static intCompare by value (and only value) if possible.static intcompareAlways(NodeValue nv1, NodeValue nv2) Compare by value if possible else compare by kind/type/lexical form Only use when you want an ordering regardless of form of NodeValue, for example in ORDER BYcopySubstitute(Binding binding) Deep copy with substitutionbooleanGeneral equality operation - consider this to be 'protected'eval(Binding binding, FunctionEnv env) Evaluate this expression against the bindingorg.apache.jena.graph.NodeevalNode(Binding binding, ExecutionContext execCxt) booleanNodeValue constant (returns null if not a constant)doublefloatgetFloat()getLang()org.apache.jena.graph.NodegetNode()getNode - return the node form - may be null (use .asNode() to force to a node)Variables used by this expression.booleaninthashCode()Exprare used in both syntax and algebra.booleanhasNode()booleanisBlank()booleanbooleanAnswer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constantbooleanisDate()booleanbooleanbooleanbooleanisDouble()booleanbooleanisFloat()booleanisGDay()booleanisGMonth()booleanbooleanisGYear()booleanbooleanbooleanisIRI()booleanbooleanbooleanisNumber()booleanbooleanisString()booleanisTime()booleanbooleanstatic NodeValuemakeBoolean(boolean b) static NodeValuestatic NodeValueDeprecated, for removal: This API element is subject to removal in a future version.Use a XMLGregorianCalendarstatic NodeValuestatic NodeValuemakeDateTime(String lexicalForm) static NodeValuemakeDateTime(Calendar cal) Deprecated, for removal: This API element is subject to removal in a future version.Use a XMLGregorianCalendarstatic NodeValuestatic NodeValuemakeDecimal(double d) static NodeValuemakeDecimal(long i) static NodeValuemakeDecimal(String lexicalForm) static NodeValuestatic NodeValuemakeDirLangString(String s, String lang, String langDir) static NodeValuemakeDirLangString(String s, String lang, org.apache.jena.graph.TextDirection textDirection) static NodeValuemakeDouble(double d) static NodeValuemakeDuration(String lexicalForm) static NodeValuemakeDuration(Duration duration) static NodeValuemakeFloat(float f) static NodeValuemakeInteger(long i) static NodeValuemakeInteger(String lexicalForm) static NodeValuestatic NodeValuemakeLangString(String s, String lang) static NodeValuestatic NodeValuestatic NodeValuestatic NodeValuemakeNode(org.apache.jena.graph.Node node) static NodeValuemakeNodeBoolean(boolean b) static NodeValuemakeNodeBoolean(String lexicalForm) static NodeValuemakeNodeDate(String lexicalForm) static NodeValuemakeNodeDateTime(String lexicalForm) static NodeValuemakeNodeDecimal(String lexicalForm) static NodeValuemakeNodeDecimal(BigDecimal decimal) static NodeValuemakeNodeDouble(double v) static NodeValuemakeNodeDouble(String lexicalForm) static NodeValuemakeNodeDuration(Duration duration, org.apache.jena.graph.Node node) static NodeValuemakeNodeFloat(float f) static NodeValuemakeNodeFloat(String lexicalForm) static NodeValuemakeNodeInteger(long v) static NodeValuemakeNodeInteger(String lexicalForm) static NodeValuemakeNodeString(String string) static NodeValuemakeSortKey(String s, String collation) static NodeValuemakeString(String s) static booleannotSameValueAs(org.apache.jena.graph.Node n1, org.apache.jena.graph.Node n2) Return true if the two Nodes are known to be different, return false if the two Nodes are known to be the same, else throw ExprEvalExceptionstatic booleannotSameValueAs(NodeValue nv1, NodeValue nv2) Return true if the two NodeValues are known to be different, return false if the two NodeValues are known to be the same, else throw ExprEvalExceptionstatic NodeValueConvenience operation,primarily for tests.static voidraise(ExprException ex) Common point for exceptions during evaluation.static booleansameValueAs(NodeValue nv1, NodeValue nv2) Return true if the two NodeValues are known to be the same value.static org.apache.jena.graph.NodetoString()voidvisit(ExprVisitor visitor) abstract voidvisit(NodeValueVisitor visitor) Methods inherited from class org.apache.jena.sparql.expr.ExprNode
asVar, deepCopy, equals, equalsBySyntax, getExprVar, getFunction, getGraphPattern, getVarName, isFunction, isGraphPattern, isSatisfied, isVariable
-
Field Details
-
VerboseWarnings
public static boolean VerboseWarnings -
VerboseExceptions
public static boolean VerboseExceptions -
xmlDatatypeFactory
-
TRUE
-
FALSE
-
nvEmptyString
-
nvZERO
-
nvONE
-
nvTEN
-
nvDecimalZERO
-
nvDecimalONE
-
nvDoubleNegZERO
-
nvDoubleNaN
-
nvDoubleINF
-
nvDoubleNegINF
-
nvNegZERO
Deprecated.UsenvDoubleNegZERO -
nvNaN
Deprecated.UsenvDoubleNaN -
nvINF
Deprecated.UsenvDoubleINF -
nvNegINF
Deprecated.UsenvDoubleNegINF -
xsdNamespace
- See Also:
-
-
Method Details
-
getVarsMentioned
Description copied from interface:ExprVariables used by this expression.- Specified by:
getVarsMentionedin interfaceExpr- Overrides:
getVarsMentionedin classExprNode- See Also:
-
parse
Convenience operation,primarily for tests. Parse a string (usingSSE) to produce a NodeValue - common namespaces like xsd: are built-in -
makeInteger
-
makeInteger
-
makeInteger
-
makeFloat
-
makeDouble
-
makeString
-
makeSortKey
-
makeLangString
-
makeDirLangString
-
makeDirLangString
-
makeDecimal
-
makeDecimal
-
makeDecimal
-
makeDecimal
-
makeDateTime
-
makeDate
-
makeDateTime
Deprecated, for removal: This API element is subject to removal in a future version.Use a XMLGregorianCalendar -
makeDateTime
-
makeDate
Deprecated, for removal: This API element is subject to removal in a future version.Use a XMLGregorianCalendar -
makeDate
-
makeDuration
-
makeDuration
-
makeBoolean
-
booleanReturn
-
makeNode
-
makeNode
-
makeNode
-
makeNode
-
makeNodeBoolean
-
makeNodeBoolean
-
makeNodeInteger
-
makeNodeInteger
-
makeNodeFloat
-
makeNodeFloat
-
makeNodeDouble
-
makeNodeDouble
-
makeNodeDecimal
-
makeNodeDecimal
-
makeNodeString
-
makeNodeDateTime
-
makeNodeDate
-
makeNodeDuration
-
eval
Description copied from interface:ExprEvaluate this expression against the binding -
copySubstitute
Description copied from interface:ExprDeep copy with substitution- Specified by:
copySubstitutein interfaceExpr- Specified by:
copySubstitutein classExprNode
-
applyNodeTransform
Description copied from interface:ExprRewrite, applying a node->node transformation- Specified by:
applyNodeTransformin interfaceExpr- Specified by:
applyNodeTransformin classExprNode
-
evalNode
-
isConstant
public boolean isConstant()Description copied from interface:ExprAnswer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constant- Specified by:
isConstantin interfaceExpr- Overrides:
isConstantin classExprNode
-
getConstant
Description copied from interface:ExprNodeValue constant (returns null if not a constant)- Specified by:
getConstantin interfaceExpr- Overrides:
getConstantin classExprNode
-
isIRI
public boolean isIRI() -
isBlank
public boolean isBlank() -
isTripleTerm
public boolean isTripleTerm() -
getValueSpace
-
classifyValueOp
-
sameValueAs
Return true if the two NodeValues are known to be the same value. Return false if known to be different values, else throw ExprEvalException -
notSameValueAs
public static boolean notSameValueAs(org.apache.jena.graph.Node n1, org.apache.jena.graph.Node n2) Return true if the two Nodes are known to be different, return false if the two Nodes are known to be the same, else throw ExprEvalException -
notSameValueAs
Return true if the two NodeValues are known to be different, return false if the two NodeValues are known to be the same, else throw ExprEvalException -
compare
Compare by value (and only value) if possible. Supports <, <=, >, >= but not = nor != (which are sameValueAs and notSameValueAs)- Parameters:
nv1-nv2-- Returns:
- Expr.CMP_LESS(-1), Expr.CMP_EQUAL(0) or Expr.CMP_GREATER(+1)
- Throws:
ExprNotComparableException- for Expr.CMP_INDETERMINATE(+2)
-
compareAlways
Compare by value if possible else compare by kind/type/lexical form Only use when you want an ordering regardless of form of NodeValue, for example in ORDER BY- Parameters:
nv1-nv2-- Returns:
- negative, 0, or positive for less than, equal, greater than.
-
toNode
-
asNode
public final org.apache.jena.graph.Node asNode() -
getNode
public org.apache.jena.graph.Node getNode()getNode - return the node form - may be null (use .asNode() to force to a node) -
getDatatypeURI
-
hasNode
public boolean hasNode() -
isLiteral
public boolean isLiteral() -
isBoolean
public boolean isBoolean() -
isString
public boolean isString() -
isLangString
public boolean isLangString() -
isSortKey
public boolean isSortKey() -
isNumber
public boolean isNumber() -
isInteger
public boolean isInteger() -
isDecimal
public boolean isDecimal() -
isFloat
public boolean isFloat() -
isDouble
public boolean isDouble() -
hasDateTime
public boolean hasDateTime() -
isDateTime
public boolean isDateTime() -
isDate
public boolean isDate() -
isTime
public boolean isTime() -
isDuration
public boolean isDuration() -
isYearMonthDuration
public boolean isYearMonthDuration() -
isDayTimeDuration
public boolean isDayTimeDuration() -
isGYear
public boolean isGYear() -
isGYearMonth
public boolean isGYearMonth() -
isGMonth
public boolean isGMonth() -
isGMonthDay
public boolean isGMonthDay() -
isGDay
public boolean isGDay() -
getBoolean
public boolean getBoolean() -
getString
-
getLang
-
getLangDir
-
getSortKey
-
getInteger
-
getDecimal
-
getFloat
public float getFloat() -
getDouble
public double getDouble() -
getDateTime
-
getDuration
-
raise
Common point for exceptions during evaluation. -
visit
-
asUnquotedString
-
asQuotedString
-
asQuotedString
-
asString
-
hashCode
public int hashCode()Description copied from interface:ExprExprare used in both syntax and algebra. There is no syntax to algebra translation step because the parser uses operator precedence to build the right evaluation structure directly.The exceptions to this are the
NOT EXISTSandEXISTSexpressions which involve a query pattern. As a result there are different ways in syntax to produce the same algebra form.Two
Exprare considered equal if they are equal as algebra expressions.hashCodeandequalsmust implement that.There is also
equalsBySyntax. Because two different syntax forms can yield the same algebra, but two different algebra forms must be different syntax,equalsBySyntaximpliesequals(by algebra).Hence, different
hashCode=> notequalsBySyntax. -
equals
Description copied from interface:ExprGeneral equality operation - consider this to be 'protected' -
visit
-
apply
-
toString
-
nvDoubleINF