use of org.apache.jena.sparql.expr.ExprNotComparableException in project jena by apache.
the class ValueRangeConstraint method validate.
@Override
public final ReportItem validate(ValidationContext vCxt, Node n) {
NodeValue nv = NodeValue.makeNode(n);
ValueSpaceClassification vs = NodeValue.classifyValueOp(nodeValue, nv);
try {
int r = NodeValue.compare(nodeValue, nv);
if (r == Expr.CMP_INDETERMINATE)
return new ReportItem(toString() + " indeterminant to " + n, n);
boolean b = test(r);
if (b)
return null;
return new ReportItem(getErrorMessage(n), n);
} catch (ExprNotComparableException ex) {
return new ReportItem(toString() + " can't compare to " + n, n);
}
}
use of org.apache.jena.sparql.expr.ExprNotComparableException in project jena by apache.
the class ConstraintPairwise method compare.
protected int compare(Node n1, Node n2) {
NodeValue nv1 = NodeValue.makeNode(n1);
NodeValue nv2 = NodeValue.makeNode(n2);
try {
return NodeValue.compare(nv1, nv2);
} catch (ExprNotComparableException ex) {
// Known to be not a Expr compare constant value.
return -999;
}
}
Aggregations