@Override public Op1 copy(Op newOp) { return new OpGraph(node, newOp) ; }
private Op union(OpBGP opBGP) { // By using the unbinding Var.ANON, the distinct works. // Else, we get duplicates from projection out of the graph var. Var v = Var.ANON ; //varAlloc.allocVar() ; Op op = new OpGraph(v, opBGP) ; op = OpDistinct.create(op) ; return op ; }
@Override public Op transform(OpPath opPath) { // Put the (graph) back round it // ?? inc default graph node. return new OpGraph(getNode() , opPath) ; // Does not get removed by transform above because this is // not the OpGraph that gets walked by the transform. }
@Override public Op transform(OpPath opPath) { // Put the (graph) back round it // ?? inc default graph node. return new OpGraph(getNode() , opPath) ; // Does not get removed by transform above because this is // not the OpGraph that gets walked by the transform. }
@Override public Op transform(OpGraph op, Op subOp) { // If the variable of the graph Node node = op.getNode(); boolean remove = node.isVariable() && !preventRemoval.test((Var)node); Op result = remove ? subOp : new OpGraph(node, subOp) ; return result; }
@Override public Op transform(OpGraph op, Op sub) { Node n = substitute(op.getNode(), binding); return new OpGraph(n, sub); }
@Override public Op transform(OpGraph op, Op subOp) { // If the variable of the graph Node node = op.getNode(); boolean remove = node.isVariable() && !preventRemoval.test((Var)node); Op result = remove ? subOp : new OpGraph(node, subOp) ; return result; }
protected QueryIterator execute(OpDatasetNames dsNames, QueryIterator input) { if (false) { OpGraph op = new OpGraph(dsNames.getGraphNode(), new OpBGP()) ; return execute(op, input) ; } throw new ARQNotImplemented("execute/OpDatasetNames") ; }
public static Op toOpGraphTriples(Node graphNode, BasicPattern bgp) { Op result = new OpBGP(bgp); result = Quad.defaultGraphNodeGenerated.equals(graphNode) ? result : new OpGraph(graphNode, result); return result; }
public static Op toOpGraphTriples(Node graphNode, BasicPattern bgp) { Op result = new OpBGP(bgp); result = Quad.defaultGraphNodeGenerated.equals(graphNode) ? result : new OpGraph(graphNode, result); return result; }
protected Op compileElementGraph(ElementNamedGraph eltGraph) { Node graphNode = eltGraph.getGraphNameNode() ; Op sub = compileElement(eltGraph.getElement()) ; return new OpGraph(graphNode, sub) ; }
@Override public Op transform(OpGraph opGraph, Op x) { if ( opGraph.getNode().equals(oldGraphName) ) opGraph = new OpGraph(newGraphName, x) ; return super.transform(opGraph, x) ; }
@Override public Op transform(OpGraph opGraph, Op x) { if ( opGraph.getNode().equals(oldGraphName) ) opGraph = new OpGraph(newGraphName, x) ; return super.transform(opGraph, x) ; }
@Override public Op transform(OpGraph opGraph, Op subOp) { Node g2 = transform.apply(opGraph.getNode()); if ( g2 == opGraph.getNode() ) return super.transform(opGraph, subOp); return new OpGraph(g2, subOp); }
@Override public Op make(ItemList list) { BuilderLib.checkLength(3, list, "graph") ; Node graph = BuilderNode.buildNode(list.get(1)) ; Op sub = build(list, 2) ; return new OpGraph(graph, sub) ; } } ;
@Override public Op transform(OpPropFunc opPropFunc, Op subOp) { if ( opPropFunc.getSubOp() != subOp ) opPropFunc = new OpPropFunc(opPropFunc.getProperty(), opPropFunc.getSubjectArgs(), opPropFunc.getObjectArgs(), subOp) ; // Put the (graph) back round it so the property function works on the named graph. return new OpGraph(getNode() , opPropFunc) ; }
@Override public void visit(OpGraph opGraph) { opGraph.getSubOp().visit(this); push(new OpGraph(changeNode(opGraph.getNode()), pop())); }
@Override public Op transform(OpPropFunc opPropFunc, Op subOp) { if ( opPropFunc.getSubOp() != subOp ) opPropFunc = new OpPropFunc(opPropFunc.getProperty(), opPropFunc.getSubjectArgs(), opPropFunc.getObjectArgs(), subOp) ; // Put the (graph) back round it so the property function works on the named graph. return new OpGraph(getNode() , opPropFunc) ; }
@Override public void visit(OpGraph opGraph) { opGraph.getSubOp().visit(this); push(new OpGraph(changeNode(opGraph.getNode()), pop())); }
protected QueryIterator execute(OpQuadPattern quadPattern, QueryIterator input) { // Convert to BGP forms to execute in this graph-centric engine. if (quadPattern.isDefaultGraph() && execCxt.getActiveGraph() == execCxt.getDataset().getDefaultGraph()) { // Note we tested that the containing graph was the dataset's // default graph. // Easy case. OpBGP opBGP = new OpBGP(quadPattern.getBasicPattern()) ; return execute(opBGP, input) ; } // Not default graph - (graph .... ) OpBGP opBGP = new OpBGP(quadPattern.getBasicPattern()) ; OpGraph op = new OpGraph(quadPattern.getGraphNode(), opBGP) ; return execute(op, input) ; }