Search in sources :

Example 1 with BindingOutputStream

use of org.apache.jena.sparql.engine.binding.BindingOutputStream in project jena by apache.

the class ResultSetFormatter method outputAsBIO.

/** Output a result set in BIO format 
     * @deprecated Exprimental - may be removed
     */
@Deprecated
public static void outputAsBIO(OutputStream out, ResultSet results) {
    List<Var> vars = Var.varList(results.getResultVars());
    BindingOutputStream bout = new BindingOutputStream(out, vars);
    for (; results.hasNext(); ) {
        Binding b = BindingUtils.asBinding(results.next());
        bout.write(b);
    }
    bout.flush();
}
Also used : Binding(org.apache.jena.sparql.engine.binding.Binding) BindingOutputStream(org.apache.jena.sparql.engine.binding.BindingOutputStream) Var(org.apache.jena.sparql.core.Var)

Example 2 with BindingOutputStream

use of org.apache.jena.sparql.engine.binding.BindingOutputStream 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();
}
Also used : BindingInputStream(org.apache.jena.sparql.engine.binding.BindingInputStream) BindingOutputStream(org.apache.jena.sparql.engine.binding.BindingOutputStream) InputStream(java.io.InputStream) BindingInputStream(org.apache.jena.sparql.engine.binding.BindingInputStream) OutputStream(java.io.OutputStream) BindingOutputStream(org.apache.jena.sparql.engine.binding.BindingOutputStream)

Aggregations

BindingOutputStream (org.apache.jena.sparql.engine.binding.BindingOutputStream)2 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 Var (org.apache.jena.sparql.core.Var)1 Binding (org.apache.jena.sparql.engine.binding.Binding)1 BindingInputStream (org.apache.jena.sparql.engine.binding.BindingInputStream)1