public class TupleQueryResultFormat extends QueryResultFormat
name
and can have
one or more associated MIME types, zero or more associated file extensions
and can specify a (default) character encoding.Modifier and Type | Field and Description |
---|---|
static TupleQueryResultFormat |
BINARY
Binary RDF results table format.
|
static TupleQueryResultFormat |
CSV
SPARQL Query Result CSV Format.
|
static TupleQueryResultFormat |
JSON
SPARQL Query Results JSON Format.
|
static TupleQueryResultFormat |
SPARQL
SPARQL Query Results XML Format.
|
static TupleQueryResultFormat |
TSV
SPARQL Query Result TSV Format.
|
SPARQL_RESULTS_CSV_URI, SPARQL_RESULTS_JSON_URI, SPARQL_RESULTS_TSV_URI, SPARQL_RESULTS_XML_URI
Constructor and Description |
---|
TupleQueryResultFormat(String name,
Collection<String> mimeTypes,
Charset charset,
Collection<String> fileExtensions)
Creates a new TupleQueryResultFormat object.
|
TupleQueryResultFormat(String name,
Collection<String> mimeTypes,
Charset charset,
Collection<String> fileExtensions,
URI standardURI)
Creates a new TupleQueryResultFormat object.
|
TupleQueryResultFormat(String name,
String mimeType,
Charset charset,
String fileExt)
Creates a new TupleQueryResultFormat object.
|
TupleQueryResultFormat(String name,
String mimeType,
String fileExt)
Creates a new TupleQueryResultFormat object.
|
Modifier and Type | Method and Description |
---|---|
static TupleQueryResultFormat |
forFileName(String fileName)
Tries to determine the appropriate tuple file format for a file, based on
the extension specified in a file name.
|
static TupleQueryResultFormat |
forFileName(String fileName,
TupleQueryResultFormat fallback)
Tries to determine the appropriate tuple file format for a file, based on
the extension specified in a file name.
|
static TupleQueryResultFormat |
forMIMEType(String mimeType)
Tries to determine the appropriate tuple file format based on the a MIME
type that describes the content type.
|
static TupleQueryResultFormat |
forMIMEType(String mimeType,
TupleQueryResultFormat fallback)
Tries to determine the appropriate tuple file format based on the a MIME
type that describes the content type.
|
static TupleQueryResultFormat |
register(String name,
String mimeType,
String fileExt)
Registers the specified tuple query result format.
|
static void |
register(TupleQueryResultFormat format)
Registers the specified tuple query result format.
|
static Collection<TupleQueryResultFormat> |
values()
Returns all known/registered tuple query result formats.
|
getStandardURI, hasStandardURI
equals, getCharset, getDefaultFileExtension, getDefaultMIMEType, getFileExtensions, getMIMETypes, getName, hasCharset, hasDefaultFileExtension, hasDefaultMIMEType, hasFileExtension, hashCode, hasMIMEType, matchFileName, matchFileName, matchMIMEType, matchMIMEType, toString
public static final TupleQueryResultFormat SPARQL
public static final TupleQueryResultFormat BINARY
public static final TupleQueryResultFormat JSON
public static final TupleQueryResultFormat CSV
public static final TupleQueryResultFormat TSV
public TupleQueryResultFormat(String name, String mimeType, String fileExt)
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.fileExt
- The (default) file extension for the format, e.g. srx for
SPARQL/XML.public TupleQueryResultFormat(String name, String mimeType, Charset charset, String fileExt)
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.fileExt
- The (default) file extension for the format, e.g. srx for
SPARQL/XML.public TupleQueryResultFormat(String name, Collection<String> mimeTypes, Charset charset, Collection<String> fileExtensions)
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.public TupleQueryResultFormat(String name, Collection<String> mimeTypes, Charset charset, Collection<String> fileExtensions, URI standardURI)
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.standardURI
- 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.public static Collection<TupleQueryResultFormat> values()
public static TupleQueryResultFormat register(String name, String mimeType, String fileExt)
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.fileExt
- The (default) file extension for the format, e.g. srx for
SPARQL/XML files.public static void register(TupleQueryResultFormat format)
public static TupleQueryResultFormat forMIMEType(String mimeType)
NOTE: This method may not take into account dynamically loaded formats.
Use QueryResultIO.getParserFormatForMIMEType(String)
and
QueryResultIO.getWriterFormatForMIMEType(String)
to find all
dynamically loaded parser and writer formats, respectively.
mimeType
- A MIME type, e.g. "application/sparql-results+xml".forMIMEType(String,TupleQueryResultFormat)
,
FileFormat.getMIMETypes()
public static TupleQueryResultFormat forMIMEType(String mimeType, TupleQueryResultFormat fallback)
NOTE: This method may not take into account dynamically loaded formats.
Use
QueryResultIO.getParserFormatForMIMEType(String, TupleQueryResultFormat)
and
QueryResultIO.getWriterFormatForMIMEType(String, TupleQueryResultFormat)
to find all dynamically loaded parser and writer formats, respectively.
mimeType
- a MIME type, e.g. "application/sparql-results+xml"fallback
- a fallback TupleQueryResultFormat that will be returned by the
method if no match for the supplied MIME type can be found.forMIMEType(String)
,
FileFormat.getMIMETypes()
public static TupleQueryResultFormat forFileName(String fileName)
NOTE: This method may not take into account dynamically loaded formats.
Use QueryResultIO.getParserFormatForFileName(String)
and
QueryResultIO.getWriterFormatForFileName(String)
to find all
dynamically loaded parser and writer formats, respectively.
fileName
- A file name.forFileName(String,TupleQueryResultFormat)
,
FileFormat.getFileExtensions()
public static TupleQueryResultFormat forFileName(String fileName, TupleQueryResultFormat fallback)
NOTE: This method may not take into account dynamically loaded formats.
Use
QueryResultIO.getParserFormatForFileName(String, TupleQueryResultFormat)
and
QueryResultIO.getWriterFormatForFileName(String, TupleQueryResultFormat)
to find all dynamically loaded parser and writer formats, respectively.
fileName
- A file name.forFileName(String)
,
FileFormat.getFileExtensions()
Copyright © 2001–2016 Aduna. All rights reserved.