Class JSONInputIterator

All Implemented Interfaces:
Iterator<Binding>, org.apache.jena.atlas.io.Printable, org.apache.jena.atlas.lib.Closeable, QueryIterator, PrintSerializable

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

  • Constructor Details

    • JSONInputIterator

      public JSONInputIterator(InputStream input)
      Creates a SPARQL JSON Iterator

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

  • Method Details

    • 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(org.apache.jena.atlas.io.IndentedWriter out, SerializationContext sCxt)