use of org.apache.jena.sparql.engine.QueryIterator in project jena by apache.
the class Table1 method iterator.
@Override
public QueryIterator iterator(ExecutionContext execCxt) {
// Root binding?
Binding binding = BindingFactory.binding(var, value);
QueryIterator qIter = QueryIterSingleton.create(null, var, value, execCxt);
return qIter;
}
use of org.apache.jena.sparql.engine.QueryIterator in project jena by apache.
the class JSONInput method process.
// TODO Streaming version of JSON Result set processing
private SPARQLResult process(InputStream in, Model model) {
parse(in);
if (model == null)
model = GraphFactory.makeJenaDefaultModel();
if (rows != null) {
QueryIterator qIter = new QueryIterPlainWrapper(rows.iterator());
ResultSet rs = new ResultSetStream(Var.varNames(vars), model, qIter);
super.set(rs);
} else
super.set(booleanResult);
return this;
}
use of org.apache.jena.sparql.engine.QueryIterator in project jena by apache.
the class container method execEvaluated.
@Override
public QueryIterator execEvaluated(Binding binding, Node containerNode, Node predicate, Node member, ExecutionContext execCxt) {
QueryIterator qIter1 = execEvaluatedConcrete(binding, containerNode, predicate, member, execCxt);
QueryIterator qIter2 = execEvaluatedCalc(binding, containerNode, predicate, member, execCxt);
QueryIterConcat concat = new QueryIterConcat(execCxt);
concat.add(qIter1);
concat.add(qIter2);
return concat;
}
use of org.apache.jena.sparql.engine.QueryIterator in project jena by apache.
the class BIOInput method fromBIO.
public static ResultSet fromBIO(InputStream input) {
// Scan the stream for VARS and accumulate the total variables.
// Trade off of guessing first line is all the VARS and coping with
// anything possible. -> Cope with anything possible.
BindingInputStream bin = new BindingInputStream(input);
List<Binding> bindings = new ArrayList<>();
List<Var> vars = new ArrayList<>();
while (bin.hasNext()) {
Binding b = bin.next();
bindings.add(b);
for (Var v : bin.vars()) {
if (!vars.contains(v))
vars.add(v);
}
}
QueryIterator qIter = new QueryIterPlainWrapper(bindings.iterator());
return new ResultSetStream(Var.varNames(vars), m, qIter);
}
use of org.apache.jena.sparql.engine.QueryIterator in project jena by apache.
the class Join method debug.
/* Debug.
* Print inputs and outputs.
* This involves materializing the iterators.
*/
private static QueryIterator debug(QueryIterator left, QueryIterator right, ExecutionContext execCxt, JoinOp action) {
Table t1 = TableFactory.create(left);
Table t2 = TableFactory.create(right);
left = t1.iterator(execCxt);
right = t2.iterator(execCxt);
QueryIterator qIter = action.exec(left, right);
Table t3 = TableFactory.create(qIter);
System.out.println("** Left");
System.out.println(t1);
System.out.println("** Right");
System.out.println(t2);
System.out.println("** ");
System.out.println(t3);
// System.out.println(t4) ;
return t3.iterator(execCxt);
}
Aggregations