Package com.stardog.stark.query.io.text.tsv

# Class SPARQLTSVResultWriter

java.lang.Object
com.stardog.stark.query.io.text.tsv.SPARQLTSVResultWriter

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

public final class SPARQLTSVResultWriter extends Object implements SelectQueryResultWriter

Implementation of writing `query results` in SPARQL/TSV format.

Since:
  1.0
Version:
  1.0
Author:
  Michael Grove
See Also:
  - `QueryResultFormats.TSV`
  - `SPARQLTSVResultParser`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `SPARQLTSVResultWriter.SPARQLTSVResultWriterFactory`
  Default factory implementation for `SPARQLTSVResultWriter`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SPARQLTSVResultWriter(OutputStream theStream, 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`
  `links(List<String> theLinks)`
  Handle the set of links from the result
  `void`
  `namespace(String thePrefix, String theIRI)`
  `void`
  `start()`
  Indicates that writing has begun.
  `void`
  `variables(List<String> theVars)`
  The variables in the projection of the query

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

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

- ## Constructor Details

  - ### SPARQLTSVResultWriter

    public SPARQLTSVResultWriter(OutputStream theStream, Options theOptions)

- ## Method Details

  - ### format

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

  - ### end

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

  - ### links

    public void links(@Nonnull List<String> theLinks)
    Handle the set of links from the result
    Specified by:
      `links` in interface `QueryResultHandler<BindingSet>`
    Specified by:
      `links` in interface `QueryResultWriter<BindingSet>`
    Parameters:
      `theLinks` - The links
    See Also:
      - "link"

  - ### start

    public void start()
    Description copied from interface: `QueryResultWriter`
    Indicates that writing has begun.
    Specified by:
      `start` in interface `QueryResultHandler<BindingSet>`
    Specified by:
      `start` in interface `QueryResultWriter<BindingSet>`

  - ### 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`

  - ### namespace

    public void namespace(@Nonnull String thePrefix, @Nonnull String theIRI) throws ResultWritingFailed
    Specified by:
      `namespace` in interface `QueryResultWriter<BindingSet>`
    Throws:
      `ResultWritingFailed`

  - ### 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()`