Package org.eclipse.rdf4j.query.resultio

## Class QueryResultFormat

- java.lang.Object
- - org.eclipse.rdf4j.common.lang.FileFormat
  - - org.eclipse.rdf4j.query.resultio.QueryResultFormat

- Direct Known Subclasses:
    `BooleanQueryResultFormat`, `TupleQueryResultFormat`

      public class QueryResultFormat
      extends FileFormat

  The base class of all file formats that represent the results of queries. Currently this includes tuple and boolean queries.
  Author:
    Peter Ansell

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected static IRI` | `SPARQL_RESULTS_CSV_URI` | Local constant for tuple formats for SPARQL Results CSV.
    `protected static IRI` | `SPARQL_RESULTS_JSON_URI` | Local constant reused across boolean and tuple formats for SPARQL Results JSON.
    `protected static IRI` | `SPARQL_RESULTS_TSV_URI` | Local constant for tuple formats for SPARQL Results TSV.
    `protected static IRI` | `SPARQL_RESULTS_XML_URI` | Local constant reused across boolean and tuple formats for SPARQL Results XML.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `QueryResultFormat​(String name, String mimeType, Charset charset, String fileExt)` |
    `QueryResultFormat​(String name, String mimeType, Charset charset, Collection<String> fileExtensions)` |
    `QueryResultFormat​(String name, Collection<String> mimeTypes, Charset charset, Collection<String> fileExtensions)` |
    `QueryResultFormat​(String name, Collection<String> mimeTypes, Charset charset, Collection<String> fileExtensions, IRI standardURI)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `IRI` | `getStandardURI()` |
    `boolean` | `hasStandardURI()` |

    - ### Methods inherited from class org.eclipse.rdf4j.common.lang.FileFormat

      `equals, getCharset, getDefaultFileExtension, getDefaultMIMEType, getFileExtensions, getMIMETypes, getName, hasCharset, hasDefaultFileExtension, hasDefaultMIMEType, hasFileExtension, hashCode, hasMIMEType, matchFileName, matchMIMEType, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### SPARQL_RESULTS_XML_URI

          protected static final IRI SPARQL_RESULTS_XML_URI

      Local constant reused across boolean and tuple formats for SPARQL Results XML.

    - #### SPARQL_RESULTS_JSON_URI

          protected static final IRI SPARQL_RESULTS_JSON_URI

      Local constant reused across boolean and tuple formats for SPARQL Results JSON.

    - #### SPARQL_RESULTS_CSV_URI

          protected static final IRI SPARQL_RESULTS_CSV_URI

      Local constant for tuple formats for SPARQL Results CSV.

    - #### SPARQL_RESULTS_TSV_URI

          protected static final IRI SPARQL_RESULTS_TSV_URI

      Local constant for tuple formats for SPARQL Results TSV.

  - ### Constructor Detail

    - #### QueryResultFormat

          public QueryResultFormat​(String name,
                                   String mimeType,
                                   Charset charset,
                                   String fileExt)

      Parameters:
        `name` - The name of the format, e.g. "SPARQL/XML".
        `mimeType` - The MIME type of the format, e.g. application/sparql-results+xml for the SPARQL/XML file format.
        `charset` - The default character encoding of the format. Specify null if not applicable.
        `fileExt` - The (default) file extension for the format, e.g. srx for SPARQL/XML files.

    - #### QueryResultFormat

          public QueryResultFormat​(String name,
                                   String mimeType,
                                   Charset charset,
                                   Collection<String> fileExtensions)

      Parameters:
        `name` - The name of the format, e.g. "SPARQL/XML".
        `mimeType` - The MIME type of the format, e.g. application/sparql-results+xml for the SPARQL/XML format.
        `charset` - The default character encoding of the format. Specify null if not applicable.
        `fileExtensions` - The format's file extensions, e.g. srx for SPARQL/XML files. The first item in the list is interpreted as the default file extension for the format.

    - #### QueryResultFormat

          public QueryResultFormat​(String name,
                                   Collection<String> mimeTypes,
                                   Charset charset,
                                   Collection<String> fileExtensions)

      Parameters:
        `name` - The name of the format, e.g. "SPARQL/XML".
        `mimeTypes` - The MIME types of the format, e.g. application/sparql-results+xml for the SPARQL/XML format. The first item in the list is interpreted as the default MIME type for the format.
        `charset` - The default character encoding of the format. Specify null if not applicable.
        `fileExtensions` - The format's file extensions, e.g. srx for SPARQL/XML files. The first item in the list is interpreted as the default file extension for the format.

    - #### QueryResultFormat

          public QueryResultFormat​(String name,
                                   Collection<String> mimeTypes,
                                   Charset charset,
                                   Collection<String> fileExtensions,
                                   IRI standardURI)

      Parameters:
        `name` - The name of the format, e.g. "SPARQL/XML".
        `mimeTypes` - The MIME types of the format, e.g. application/sparql-results+xml for the SPARQL/XML format. The first item in the list is interpreted as the default MIME type for the format.
        `charset` - The default character encoding of the format. Specify null if not applicable.
        `fileExtensions` - The format's file extensions, e.g. srx for SPARQL/XML files. The first item in the list is interpreted as the default file extension for the format.

  - ### Method Detail

    - #### hasStandardURI

          public boolean hasStandardURI()

      Returns:
        True if a standard URI has been assigned to this format by a standards organisation.

    - #### getStandardURI

          public IRI getStandardURI()

      Returns:
        The standard URI that has been assigned to this format by a standards organisation or null if it does not currently have a standard URI.