public static Op substitute(Op op, Binding binding) { return Substitute.substitute(op, binding) ; }
public static BasicPattern substitute(BasicPattern bgp, Binding binding) { if ( isNotNeeded(binding) ) return bgp; BasicPattern bgp2 = new BasicPattern(); for ( Triple triple : bgp ) { Triple t = substitute(triple, binding); bgp2.add(t); } return bgp2; }
public static Expr substitute(Expr expr, Binding binding) { if ( isNotNeeded(binding) ) return expr; return expr.copySubstitute(binding); }
public static ExprList substitute(ExprList exprList, Binding binding) { if ( isNotNeeded(binding) ) return exprList; return exprList.copySubstitute(binding); }
@Override public final QueryIterator exec(Binding binding, PropFuncArg argSubject, Node predicate, PropFuncArg argObject, ExecutionContext execCxt) { argSubject = Substitute.substitute(argSubject, binding) ; argObject = Substitute.substitute(argObject, binding) ; return execEvaluated(binding, argSubject, predicate, argObject, execCxt) ; }
public static Triple substitute(Triple triple, Binding binding) { if ( isNotNeeded(binding) ) return triple; Node s = triple.getSubject(); Node p = triple.getPredicate(); Node o = triple.getObject(); Node s1 = substitute(s, binding); Node p1 = substitute(p, binding); Node o1 = substitute(o, binding); Triple t = triple; if ( s1 != s || p1 != p || o1 != o ) t = new Triple(s1, p1, o1); return t; }
public static Op substitute(Op op, Binding binding) { // Want to avoid cost if the binding is empty // but the empty test is not zero-cost on non-empty things. if ( isNotNeeded(binding) ) return op; return Transformer.transform(new OpSubstituteWorker(binding), op); }
protected QueryIterGraphInner(Binding parent, Iterator<Node> graphNames, OpGraph opGraph, ExecutionContext execCxt) { super(null, execCxt) ; this.parentBinding = parent ; this.graphNames = graphNames ; this.opGraph = opGraph ; this.opSubstituted = Substitute.substitute(opGraph.getSubOp(), parent) ; }
public static Quad substitute(Quad quad, Binding binding) { if ( isNotNeeded(binding) ) return quad; Node g = quad.getGraph(); Node s = quad.getSubject(); Node p = quad.getPredicate(); Node o = quad.getObject(); Node g1 = substitute(g, binding); Node s1 = substitute(s, binding); Node p1 = substitute(p, binding); Node o1 = substitute(o, binding); Quad q = quad; if ( s1 != s || p1 != p || o1 != o || g1 != g ) q = new Quad(g1, s1, p1, o1); return q; }
public static Op substitute(Op op, Var var, Node node) { Binding b = BindingFactory.binding(var, node); return substitute(op, b); }
public static PropFuncArg substitute(PropFuncArg propFuncArg, Binding binding) { if ( isNotNeeded(binding) ) return propFuncArg; if ( propFuncArg.isNode() ) { Node n = propFuncArg.getArg(); if ( !Var.isVar(n) ) // Not a Var, no substitute needed. return propFuncArg; return new PropFuncArg(substitute(propFuncArg.getArg(), binding)); } List<Node> newArgList = new ArrayList<>(); for ( Node n : propFuncArg.getArgList() ) newArgList.add(substitute(n, binding)); return new PropFuncArg(newArgList); }
private static Op subst(Op subOp, Var find, Var replace) { Op op = Substitute.substitute(subOp, find, replace); return OpAssign.assign(op, find, new ExprVar(replace)); } }
@Override public Op transform(OpBGP opBGP) { BasicPattern bgp = opBGP.getPattern(); bgp = substitute(bgp, binding); return new OpBGP(bgp); }
private static Op subst(Op subOp, Var find, Var replace) { Op op = Substitute.substitute(subOp, find, replace); return OpAssign.assign(op, find, new ExprVar(replace)); } }
@Override public Op transform(OpGraph op, Op sub) { Node n = substitute(op.getNode(), binding); return new OpGraph(n, sub); }
@Override public Op transform(OpPath opPath) { return new OpPath(substitute(opPath.getTriplePath(), binding)); }
private static Op subst(Op subOp, Var var, NodeValue nv) { Op op = Substitute.substitute(subOp, var, nv.asNode()); return OpAssign.assign(op, var, nv); }
public static TriplePath substitute(TriplePath triplePath, Binding binding) { if ( triplePath.isTriple() ) return new TriplePath(Substitute.substitute(triplePath.asTriple(), binding)); Node s = triplePath.getSubject(); Node o = triplePath.getObject(); Node s1 = substitute(s, binding); Node o1 = substitute(o, binding); TriplePath tp = triplePath; if ( s1 != s || o1 != o ) tp = new TriplePath(s1, triplePath.getPath(), o1); return tp; }
@Override public Expr copySubstitute(Binding binding) { Op op2 = Substitute.substitute(getGraphPattern(), binding) ; return new E_Exists(getElement(), op2) ; }
@Override public Op transform(OpPropFunc opPropFunc, Op subOp) { PropFuncArg sArgs = opPropFunc.getSubjectArgs(); PropFuncArg oArgs = opPropFunc.getObjectArgs(); PropFuncArg sArgs2 = substitute(sArgs, binding); PropFuncArg oArgs2 = substitute(oArgs, binding); if ( sArgs2 == sArgs && oArgs2 == oArgs && opPropFunc.getSubOp() == subOp ) return super.transform(opPropFunc, subOp); return new OpPropFunc(opPropFunc.getProperty(), sArgs2, oArgs2, subOp); }