use of org.apache.jena.sparql.engine.QueryIterator in project jena by apache.
the class OpExecutor method execute.
protected QueryIterator execute(OpProcedure opProc, QueryIterator input) {
Procedure procedure = ProcEval.build(opProc, execCxt);
QueryIterator qIter = exec(opProc.getSubOp(), input);
// Delay until query starts executing.
return new QueryIterProcedure(qIter, procedure, execCxt);
}
use of org.apache.jena.sparql.engine.QueryIterator in project jena by apache.
the class QueryIterGraph method nextStage.
@Override
protected QueryIterator nextStage(Binding outerBinding) {
DatasetGraph ds = getExecContext().getDataset();
// Is this closed?
Iterator<Node> graphNameNodes = makeSources(ds, outerBinding, opGraph.getNode());
// List<Node> x = Iter.toList(graphNameNodes) ;
// graphNameNodes = x.iterator() ;
// System.out.println(x) ;
QueryIterator current = new QueryIterGraphInner(outerBinding, graphNameNodes, opGraph, getExecContext());
return current;
}
use of org.apache.jena.sparql.engine.QueryIterator in project jena by apache.
the class QueryIterService method nextStage.
@Override
protected QueryIterator nextStage(Binding outerBinding) {
Op op = QC.substitute(opService, outerBinding);
boolean silent = opService.getSilent();
QueryIterator qIter;
try {
qIter = Service.exec((OpService) op, getExecContext().getContext());
// This iterator is materialized already otherwise we may end up
// not servicing the HTTP connection as needed.
// In extremis, can cause a deadlock when SERVICE loops back to this server.
// Add tracking.
qIter = QueryIter.makeTracked(qIter, getExecContext());
} catch (RuntimeException ex) {
if (silent) {
Log.warn(this, "SERVICE <" + opService.getService().toString() + ">: " + ex.getMessage());
// Return the input
return QueryIterSingleton.create(outerBinding, getExecContext());
}
throw ex;
}
// Need to put the outerBinding as parent to every binding of the service call.
// There should be no variables in common because of the OpSubstitute.substitute
QueryIterator qIter2 = new QueryIterCommonParent(qIter, outerBinding, getExecContext());
return qIter2;
}
use of org.apache.jena.sparql.engine.QueryIterator 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.engine.QueryIterator in project jena by apache.
the class EvaluatorSimple method slice.
@Override
public Table slice(Table table, long start, long length) {
QueryIterator qIter = table.iterator(getExecContext());
qIter = new QueryIterSlice(qIter, start, length, getExecContext());
return new TableN(qIter);
}
Aggregations