Package com.stardog.stark.query.io

# Class QueryResultFormats

java.lang.Object
com.stardog.stark.query.io.QueryResultFormats

public final class QueryResultFormats extends Object

Utilities for `QueryResultFormat`

Since:
  1.0
Version:
  1.0
Author:
  Michael Grove
See Also:
  - `QueryResultFormat`
  - `SupportedFileFormats`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final QueryResultFormat`
  `BINARY`
  Binary query result format for select query results
  `static final QueryResultFormat`
  `CSV`
  Query result format for csv encoded query results
  `static final QueryResultFormat`
  `JSON`
  Query result format for JSON encoded query results
  `static final QueryResultFormat`
  `JSON_BOOLEAN`
  Query result format for JSON encoded query results
  `static final QueryResultFormat`
  `TEXT`
  Text-based query result format for boolean query results
  `static final QueryResultFormat`
  `TEXT_TABLE`
  Text-based table format for select query results.
  `static final QueryResultFormat`
  `TSV`
  Query result format for tsv encoded query results
  `static final QueryResultFormat`
  `XML`
  Query result format for SPARQL/XML encoded query results
  `static final QueryResultFormat`
  `XML_BOOLEAN`
  Query result format for SPARQL/XML boolean encoded query results

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static SupportedFileFormats<QueryResultFormat>`
  `booleanFormats()`
  Return only the supported boolean query formats
  `static Optional<QueryResultFormat>`
  `forFile(Path thePath)`
  Return the `format` for the file denoted by the given `Path`.
  `static Optional<QueryResultFormat>`
  `forFileName(String thePath)`
  `static Optional<QueryResultFormat>`
  `forMime(String theMime)`
  Return the `format` for the given mime-type.
  `static Optional<QueryResultFormat>`
  `forMimeBoolean(String theMime)`
  Return the `format` for the given mime-type.
  `static Optional<QueryResultFormat>`
  `forMimeSelect(String theMime)`
  Return the `format` for the given mime-type.
  `static void`
  `register(QueryResultFormat theFormat)`
  Add a new `QueryResultFormat`
  `static QueryResultFormat`
  `register(String theName, IRI theId, List<String> theMimetypes, List<String> theFileExtensions)`
  Add a new `QueryResultFormat`
  `static SupportedFileFormats<QueryResultFormat>`
  `selectFormats()`
  Return only the supported select query formats

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

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

- ## Field Details

  - ### XML

    public static final QueryResultFormat XML
    Query result format for SPARQL/XML encoded query results

  - ### XML_BOOLEAN

    public static final QueryResultFormat XML_BOOLEAN
    Query result format for SPARQL/XML boolean encoded query results

  - ### JSON

    public static final QueryResultFormat JSON
    Query result format for JSON encoded query results

  - ### JSON_BOOLEAN

    public static final QueryResultFormat JSON_BOOLEAN
    Query result format for JSON encoded query results

  - ### TSV

    public static final QueryResultFormat TSV
    Query result format for tsv encoded query results

  - ### CSV

    public static final QueryResultFormat CSV
    Query result format for csv encoded query results

  - ### TEXT

    public static final QueryResultFormat TEXT
    Text-based query result format for boolean query results

  - ### TEXT_TABLE

    public static final QueryResultFormat TEXT_TABLE
    Text-based table format for select query results.

  - ### BINARY

    public static final QueryResultFormat BINARY
    Binary query result format for select query results

- ## Method Details

  - ### forFile

    @Nonnull public static Optional<QueryResultFormat> forFile(@Nonnull Path thePath)
    Return the `format` for the file denoted by the given `Path`.
    Parameters:
      `thePath` - the file to be parsed
    Returns:
      the `QueryResultFormat`
    See Also:
      - `SupportedFileFormats.forFile(Path)`

  - ### forFileName

    @Nonnull public static Optional<QueryResultFormat> forFileName(@Nonnull String thePath)

  - ### forMime

    @Nonnull public static Optional<QueryResultFormat> forMime(@Nonnull String theMime)
    Return the `format` for the given mime-type.
    Parameters:
      `theMime` - the mime-type
    Returns:
      the `QueryResultFormat`
    See Also:
      - `SupportedFileFormats.forMime(String)`

  - ### forMimeSelect

    @Nonnull public static Optional<QueryResultFormat> forMimeSelect(@Nonnull String theMime)
    Return the `format` for the given mime-type.
    Parameters:
      `theMime` - the mime-type
    Returns:
      the `QueryResultFormat`
    See Also:
      - `SupportedFileFormats.forMime(String)`

  - ### selectFormats

    @Nonnull public static SupportedFileFormats<QueryResultFormat> selectFormats()
    Return only the supported select query formats
    Returns:
      the formats for select queries

  - ### booleanFormats

    @Nonnull public static SupportedFileFormats<QueryResultFormat> booleanFormats()
    Return only the supported boolean query formats
    Returns:
      the formats for boolean queries

  - ### forMimeBoolean

    @Nonnull public static Optional<QueryResultFormat> forMimeBoolean(@Nonnull String theMime)
    Return the `format` for the given mime-type.
    Parameters:
      `theMime` - the mime-type
    Returns:
      the `QueryResultFormat`
    See Also:
      - `SupportedFileFormats.forMime(String)`

  - ### register

    public static void register(QueryResultFormat theFormat)
    Add a new `QueryResultFormat`
    Parameters:
      `theFormat` - the format

  - ### register

    public static QueryResultFormat register(@Nonnull String theName, @Nonnull IRI theId, @Nonnull List<String> theMimetypes, @Nonnull List<String> theFileExtensions)
    Add a new `QueryResultFormat`
    Parameters:
      `theName` - the human-friendly name of the format
      `theId` - the IRI of the format
      `theMimetypes` - the list of supported mimetypes. There must be *at least* `1`, and the first element in the list is taken to be the default mimetype
      `theFileExtensions` - the list of supported extensions. There must be *at least* `1`, and the first element in the list is taken to be the default extension