use of org.apache.jena.sparql.algebra.Op in project jena by apache.
the class QueryIterUnion method output.
@Override
public void output(IndentedWriter out, SerializationContext sCxt) {
out.println(Lib.className(this));
out.incIndent();
for (Op op : subOps) op.output(out, sCxt);
out.decIndent();
out.ensureStartOfLine();
}
use of org.apache.jena.sparql.algebra.Op in project jena by apache.
the class QueryIterUnion method nextStage.
@Override
protected QueryIterator nextStage(Binding binding) {
QueryIterConcat unionQIter = new QueryIterConcat(getExecContext());
for (Op subOp : subOps) {
subOp = QC.substitute(subOp, binding);
QueryIterator parent = QueryIterSingleton.create(binding, getExecContext());
QueryIterator qIter = QC.execute(subOp, parent, getExecContext());
unionQIter.add(qIter);
}
return unionQIter;
}
use of org.apache.jena.sparql.algebra.Op in project jena by apache.
the class EvaluatorDispatch method visit.
@Override
public void visit(OpDisjunction opDisjunction) {
// Evaluation is as a concatentation of alternatives
Table table = TableFactory.createEmpty();
for (Iterator<Op> iter = opDisjunction.iterator(); iter.hasNext(); ) {
Op op = iter.next();
Table eltTable = eval(op);
table = evaluator.union(table, eltTable);
}
push(table);
}
use of org.apache.jena.sparql.algebra.Op in project jena by apache.
the class BuilderOp method addOps.
// Add all the operations from the list to the OpN
private final void addOps(OpN op, ItemList list) {
for (int i = 1; i < list.size(); i++) {
Op sub = build(list, i);
op.add(sub);
}
}
use of org.apache.jena.sparql.algebra.Op in project jena by apache.
the class TestSpecialGraphs method union_dft_1.
private void union_dft_1(Mode mode) {
Op op = op("(bgp (?s ?p ?o))", mode);
List<Binding> results = exec(op);
assertEquals(5, results.size());
Op op2 = Algebra.unionDefaultGraph(op);
List<Binding> results2 = exec(op2);
assertEquals(4, results2.size());
}
Aggregations