@Override public NodeValue eval(NodeValue x, NodeValue y) { if ( ARQ.isStrictMode() ) return XSDFuncOp.numSubtract(x, y) ; return NodeValueOps.subtractionNV(x, y) ; }
@Override public NodeValue eval(NodeValue x, NodeValue y) { if ( ARQ.isStrictMode() ) return XSDFuncOp.numDivide(x, y) ; return NodeValueOps.divisionNV(x, y) ; }
@Override public NodeValue eval(NodeValue x, NodeValue y) { if ( ARQ.isStrictMode() ) return XSDFuncOp.numAdd(x, y) ; return NodeValueOps.additionNV(x, y) ; }
@Override public NodeValue eval(NodeValue x, NodeValue y) { if ( ARQ.isStrictMode() ) return XSDFuncOp.numMultiply(x, y) ; return NodeValueOps.multiplicationNV(x, y) ; }
private static void check(Collection<Var> scope, ElementService el) { if ( ARQ.isStrictMode() && el.getServiceNode().isVariable() ) { Var var = Var.alloc(el.getServiceNode()) ; if ( ! scope.contains(var) ) throw new QueryParseException("SERVICE: Variable not already in-scope: "+var+" in "+el, -1 , -1) ; } } }
if (!ARQ.isStrictMode() && constant.isString()) return null; if (!ARQ.isStrictMode() && constant.isLiteral()) return null;
if ( ! ARQ.isStrictMode() && constant.isString() ) return null ; if ( ! ARQ.isStrictMode() && constant.isLiteral() ) return null ;
@Override public NodeValue eval(NodeValue x, NodeValue y) { if ( ARQ.isStrictMode() ) return XSDFuncOp.add(x, y) ; if ( true ) { if ( x.isString() && y.isString() ) return NodeValue.makeString(x.asString()+y.asString()) ; if ( ! x.isNumber() || ! y.isNumber() ) throw new ExprEvalTypeException("Operator '+' requires two numbers or two strings: got: "+x+" and "+y) ; } return XSDFuncOp.add(x, y) ; }
private static Pair<Var, NodeValue> preprocess(Expr e) { if (!(e instanceof E_NotEquals)) return null; ExprFunction2 eq = (ExprFunction2) e; Expr left = eq.getArg1(); Expr right = eq.getArg2(); Var var = null; NodeValue constant = null; if (left.isVariable() && right.isConstant()) { var = left.asVar(); constant = right.getConstant(); } else if (right.isVariable() && left.isConstant()) { var = right.asVar(); constant = left.getConstant(); } if (var == null || constant == null) return null; // Final check for "!=" where a FILTER != can do value matching when the // graph does not. // Value based? if (!ARQ.isStrictMode() && constant.isLiteral()) return null; return Pair.create(var, constant); }