use of org.apache.jena.sparql.engine.binding.BindingInputStream in project jena by apache.
the class bindings method main.
public static void main(String[] args) {
InputStream in = System.in;
OutputStream out = System.out;
BindingInputStream input = new BindingInputStream(in);
BindingOutputStream output = new BindingOutputStream(out);
for (; input.hasNext(); ) output.send(input.next());
output.flush();
}
use of org.apache.jena.sparql.engine.binding.BindingInputStream 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.binding.BindingInputStream in project jena by apache.
the class bindings method main.
public static void main(String... args) {
InputStream in = System.in;
OutputStream out = System.out;
BindingInputStream input = new BindingInputStream(in);
BindingOutputStream output = new BindingOutputStream(out);
for (; input.hasNext(); ) output.send(input.next());
output.flush();
}
Aggregations