Package com.stardog.stark.query.io.json

# Class SPARQLJSONSelectResultWriter

java.lang.Object
com.stardog.stark.query.io.json.AbstractSPARQLJSONWriter<BindingSet>
com.stardog.stark.query.io.json.SPARQLJSONSelectResultWriter

All Implemented Interfaces:
  `QueryResultWriter<BindingSet>`, `SelectQueryResultWriter`, `QueryResultHandler<BindingSet>`, `SelectQueryResultHandler`

public class SPARQLJSONSelectResultWriter extends AbstractSPARQLJSONWriter<BindingSet> implements SelectQueryResultWriter

`SelectQueryResultWriter` for `select results` as SPARQL/JSON

Since:
  1.0
Version:
  1.0
Author:
  Michael Grove

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `SPARQLJSONSelectResultWriter.SPARQLJSONSelectResultWriterFactory`

- ## Field Summary

  ### Fields inherited from class com.stardog.stark.query.io.json.AbstractSPARQLJSONWriter

  `documentOpen, firstTupleWritten, headerComplete, headerOpen, jg, linksFound, mOptions, tupleVariablesFound`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SPARQLJSONSelectResultWriter(OutputStream theOutputStream, Options theOptions)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `end()`
  Signal that query processing has completed
  `QueryResultFormat`
  `format()`
  The `format` this writer will serialize output in
  `void`
  `handle(BindingSet theBindings)`
  Handle a result to a query
  `void`
  `variables(List<String> theVars)`
  The variables in the projection of the query

  ### Methods inherited from class com.stardog.stark.query.io.json.AbstractSPARQLJSONWriter

  `endHeader, links, namespace, start, startHeader, writeHeaderFields, writeValue`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.stardog.stark.query.io.QueryResultWriter

  `links, namespace, start`

- ## Constructor Details

  - ### SPARQLJSONSelectResultWriter

    public SPARQLJSONSelectResultWriter(OutputStream theOutputStream, Options theOptions)

- ## Method Details

  - ### variables

    public void variables(@Nonnull List<String> theVars)
    The variables in the projection of the query
    Specified by:
      `variables` in interface `SelectQueryResultHandler`
    Parameters:
      `theVars` - the variables
    See Also:
      - `SelectQueryResult.variables()`

  - ### handle

    public void handle(@Nonnull BindingSet theBindings) throws ResultWritingFailed
    Handle a result to a query
    Specified by:
      `handle` in interface `QueryResultHandler<BindingSet>`
    Specified by:
      `handle` in interface `QueryResultWriter<BindingSet>`
    Parameters:
      `theBindings` - the result
    Throws:
      `ResultWritingFailed`

  - ### end

    public void end()
    Signal that query processing has completed
    Specified by:
      `end` in interface `QueryResultHandler<BindingSet>`
    Specified by:
      `end` in interface `QueryResultWriter<BindingSet>`
    Overrides:
      `end` in class `AbstractSPARQLJSONWriter<BindingSet>`

  - ### format

    @Nonnull public QueryResultFormat format()
    The `format` this writer will serialize output in
    Specified by:
      `format` in interface `QueryResultWriter<BindingSet>`
    Overrides:
      `format` in class `AbstractSPARQLJSONWriter<BindingSet>`
    Returns:
      the format