com.hp.hpl.jena.sparql.resultset
Class JSONInputIterator

java.lang.Object
  extended by com.hp.hpl.jena.sparql.util.PrintSerializableBase
      extended by com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase
          extended by com.hp.hpl.jena.sparql.resultset.JSONInputIterator
All Implemented Interfaces:
QueryIterator, PrintSerializable, Iterator<Binding>, Printable, Closeable

public class JSONInputIterator
extends QueryIteratorBase

Streaming Iterator over SPARQL JSON results, not yet fully implemented (see JENA-267)

Creating the Iterator automatically causes it to parse a small chunk of the stream to determine the variables in the result set either by reading the header or reading some portion of the results if the results appear before the header since JSON does not guarantee the order of keys within an object


Field Summary
 
Fields inherited from class com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase
traceIterators
 
Constructor Summary
JSONInputIterator(InputStream input)
          Creates a SPARQL JSON Iterator
 
Method Summary
 Iterator<String> getVars()
          Returns the variables present in the result sets
 boolean isBooleanResult()
          Gets whether the SPARQL JSON represents a boolean result set
 void output(IndentedWriter out, SerializationContext sCxt)
           
 
Methods inherited from class com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase
cancel, close, debug, hasNext, next, nextBinding, remove
 
Methods inherited from class com.hp.hpl.jena.sparql.util.PrintSerializableBase
output, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.sparql.util.PrintSerializable
toString
 
Methods inherited from interface org.apache.jena.atlas.io.Printable
output
 

Constructor Detail

JSONInputIterator

public JSONInputIterator(InputStream input)
Creates a SPARQL JSON Iterator

Automatically parses some portion of the input to determine the variables in use

Method Detail

getVars

public Iterator<String> getVars()
Returns the variables present in the result sets


isBooleanResult

public boolean isBooleanResult()
Gets whether the SPARQL JSON represents a boolean result set


output

public void output(IndentedWriter out,
                   SerializationContext sCxt)


Licenced under the Apache License, Version 2.0