public class RDFFormat extends FileFormat
name
and can have one or more associated
MIME types, zero or more associated file extensions and can specify a
(default) character encoding. Some formats are able to encode context
information while other are not; this is indicated by the value of
supportsContexts
.Modifier and Type | Field and Description |
---|---|
static RDFFormat |
BINARY
A binary RDF format.
|
static RDFFormat |
JSONLD
The JSON-LD file format, an
RDF serialization format that supports recording of named graphs.
|
static RDFFormat |
N3
The N3/Notation3 file
format.
|
static boolean |
NO_CONTEXTS
Indicates that the
Statement.getContext() URI will NOT be
serialized for this format. |
static boolean |
NO_NAMESPACES
Indicates that all calls to
RDFHandler.handleNamespace(String, String) will be ignored when
serializing to this format. |
static RDFFormat |
NQUADS
The N-Quads file format, an
RDF serialization format that supports recording of named graphs.
|
static RDFFormat |
NTRIPLES
The N-Triples file format.
|
static RDFFormat |
RDFA
The RDFa file format, an
RDF serialization format.
|
static RDFFormat |
RDFJSON
The RDF/JSON file format, an
RDF serialization format that supports recording of named graphs.
|
static RDFFormat |
RDFXML
The RDF/XML file
format.
|
static boolean |
SUPPORTS_CONTEXTS
Indicates that the
Statement.getContext() URI may be serialized
for this format. |
static boolean |
SUPPORTS_NAMESPACES
Indicates that calls to
RDFHandler.handleNamespace(String, String)
may be serialised when serializing to this format. |
static RDFFormat |
TRIG
The TriG file format, a
Turtle-based RDF serialization format that supports recording of named
graphs.
|
static RDFFormat |
TRIX
The TriX file format, an
XML-based RDF serialization format that supports recording of named
graphs.
|
static RDFFormat |
TURTLE
The Turtle file format.
|
Constructor and Description |
---|
RDFFormat(String name,
Collection<String> mimeTypes,
Charset charset,
Collection<String> fileExtensions,
boolean supportsNamespaces,
boolean supportsContexts)
Creates a new RDFFormat object.
|
RDFFormat(String name,
Collection<String> mimeTypes,
Charset charset,
Collection<String> fileExtensions,
URI standardURI,
boolean supportsNamespaces,
boolean supportsContexts)
Creates a new RDFFormat object.
|
RDFFormat(String name,
String mimeType,
Charset charset,
Collection<String> fileExtensions,
boolean supportsNamespaces,
boolean supportsContexts)
Creates a new RDFFormat object.
|
RDFFormat(String name,
String mimeType,
Charset charset,
String fileExtension,
boolean supportsNamespaces,
boolean supportsContexts)
Creates a new RDFFormat object.
|
Modifier and Type | Method and Description |
---|---|
static RDFFormat |
forFileName(String fileName)
Deprecated.
Use
Rio.getParserFormatForFileName(String) instead. |
static RDFFormat |
forFileName(String fileName,
RDFFormat fallback)
Deprecated.
Use
Rio.getParserFormatForFileName(String, RDFFormat)
instead. |
static RDFFormat |
forMIMEType(String mimeType)
Deprecated.
Use
Rio.getParserFormatForMIMEType(String) instead. |
static RDFFormat |
forMIMEType(String mimeType,
RDFFormat fallback)
Deprecated.
Use
Rio.getParserFormatForMIMEType(String, RDFFormat)
instead. |
static List<String> |
getAcceptParams(Iterable<RDFFormat> rdfFormats,
boolean requireContext,
RDFFormat preferredFormat)
Processes the supplied collection of
RDFFormat s and assigns
quality values to each based on whether context must be supported and
whether the format is preferred. |
URI |
getStandardURI() |
boolean |
hasStandardURI() |
static void |
register(RDFFormat rdfFormat)
Deprecated.
Use
ServiceRegistry.add(S) to insert new parsers into
the system. |
static RDFFormat |
register(String name,
String mimeType,
String fileExt,
Charset charset)
Deprecated.
Use
ServiceRegistry.add(S) to insert new parsers into
the system. |
boolean |
supportsContexts()
Return true if the RDFFormat supports the encoding of
contexts/named graphs.
|
boolean |
supportsNamespaces()
Return true if the RDFFormat supports the encoding of
namespace/prefix information.
|
static RDFFormat |
valueOf(String formatName)
Deprecated.
Use MIME types to identify RDFFormats, and use the static
methods in
Rio to find them. |
static Collection<RDFFormat> |
values()
Deprecated.
Use
ServiceRegistry.getKeys() to find all parser
formats. |
equals, getCharset, getDefaultFileExtension, getDefaultMIMEType, getFileExtensions, getMIMETypes, getName, hasCharset, hasDefaultFileExtension, hasDefaultMIMEType, hasFileExtension, hashCode, hasMIMEType, matchFileName, matchFileName, matchMIMEType, matchMIMEType, toString
public static final boolean SUPPORTS_NAMESPACES
RDFHandler.handleNamespace(String, String)
may be serialised when serializing to this format.public static final boolean NO_NAMESPACES
RDFHandler.handleNamespace(String, String)
will be ignored when
serializing to this format.public static final boolean SUPPORTS_CONTEXTS
Statement.getContext()
URI may be serialized
for this format.public static final boolean NO_CONTEXTS
Statement.getContext()
URI will NOT be
serialized for this format.public static final RDFFormat RDFXML
Several file extensions are accepted for RDF/XML documents, including
.rdf
, .rdfs
(for RDF Schema files),
.owl
(for OWL ontologies), and .xml
. The media
type is application/rdf+xml
, but application/xml
is also accepted. The character encoding is UTF-8.
public static final RDFFormat NTRIPLES
The file extension .nt
is recommend for N-Triples documents.
The media type is application/n-triples
and encoding is in
UTF-8.
public static final RDFFormat TURTLE
The file extension .ttl
is recommend for Turtle documents.
The media type is text/turtle
, but
application/x-turtle
is also accepted. Character encoding is
UTF-8.
public static final RDFFormat N3
The file extension .n3
is recommended for N3 documents. The
media type is text/n3
, but text/rdf+n3
is also
accepted. Character encoding is UTF-8.
public static final RDFFormat TRIX
The file extension .xml
is recommended for TriX documents,
.trix
is also accepted. The media type is
application/trix
and the encoding is UTF-8.
public static final RDFFormat TRIG
The file extension .trig
is recommend for TriG documents. The
media type is application/trig
and the encoding is UTF-8.
public static final RDFFormat BINARY
The file extension .brf
is recommend for binary RDF
documents. The media type is application/x-binary-rdf
.
public static final RDFFormat NQUADS
The file extension .nq
is recommended for N-Quads documents.
The media type is application/n-quads
and the encoding is
UTF-8.
public static final RDFFormat JSONLD
The file extension .jsonld
is recommended for JSON-LD
documents. The media type is application/ld+json
and the
encoding is UTF-8.
public static final RDFFormat RDFJSON
The file extension .rj
is recommended for RDF/JSON documents.
The media type is application/rdf+json
and the encoding is
UTF-8.
public static final RDFFormat RDFA
The file extension .xhtml
is recommended for RDFa documents.
The preferred media type is application/xhtml+xml
and the
encoding is UTF-8.
public RDFFormat(String name, String mimeType, Charset charset, String fileExtension, boolean supportsNamespaces, boolean supportsContexts)
name
- The name of the RDF file format, e.g. "RDF/XML".mimeType
- The MIME type of the RDF file format, e.g.
application/rdf+xml for the RDF/XML file format.charset
- The default character encoding of the RDF file format. Specify
null if not applicable.fileExtension
- The (default) file extension for the RDF file format, e.g.
rdf for RDF/XML files.supportsNamespaces
- True if the RDFFormat supports the encoding of
namespace/prefix information and false otherwise.supportsContexts
- True if the RDFFormat supports the encoding of
contexts/named graphs and false otherwise.public RDFFormat(String name, String mimeType, Charset charset, Collection<String> fileExtensions, boolean supportsNamespaces, boolean supportsContexts)
name
- The name of the RDF file format, e.g. "RDF/XML".mimeType
- The MIME type of the RDF file format, e.g.
application/rdf+xml for the RDF/XML file format.charset
- The default character encoding of the RDF file format. Specify
null if not applicable.fileExtensions
- The RDF format's file extensions, e.g. rdf for RDF/XML
files. The first item in the list is interpreted as the default
file extension for the format.supportsNamespaces
- True if the RDFFormat supports the encoding of
namespace/prefix information and false otherwise.supportsContexts
- True if the RDFFormat supports the encoding of
contexts/named graphs and false otherwise.public RDFFormat(String name, Collection<String> mimeTypes, Charset charset, Collection<String> fileExtensions, boolean supportsNamespaces, boolean supportsContexts)
name
- The name of the RDF file format, e.g. "RDF/XML".mimeTypes
- The MIME types of the RDF file format, e.g.
application/rdf+xml for the RDF/XML file format. The first
item in the list is interpreted as the default MIME type for the
format.charset
- The default character encoding of the RDF file format. Specify
null if not applicable.fileExtensions
- The RDF format's file extensions, e.g. rdf for RDF/XML
files. The first item in the list is interpreted as the default
file extension for the format.supportsNamespaces
- True if the RDFFormat supports the encoding of
namespace/prefix information and false otherwise.supportsContexts
- True if the RDFFormat supports the encoding of
contexts/named graphs and false otherwise.public RDFFormat(String name, Collection<String> mimeTypes, Charset charset, Collection<String> fileExtensions, URI standardURI, boolean supportsNamespaces, boolean supportsContexts)
name
- The name of the RDF file format, e.g. "RDF/XML".mimeTypes
- The MIME types of the RDF file format, e.g.
application/rdf+xml for the RDF/XML file format. The first
item in the list is interpreted as the default MIME type for the
format.charset
- The default character encoding of the RDF file format. Specify
null if not applicable.fileExtensions
- The RDF format's file extensions, e.g. rdf for RDF/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.supportsNamespaces
- True if the RDFFormat supports the encoding of
namespace/prefix information and false otherwise.supportsContexts
- True if the RDFFormat supports the encoding of
contexts/named graphs and false otherwise.@Deprecated public static Collection<RDFFormat> values()
ServiceRegistry.getKeys()
to find all parser
formats.@Deprecated public static RDFFormat register(String name, String mimeType, String fileExt, Charset charset)
ServiceRegistry.add(S)
to insert new parsers into
the system.name
- The name of the RDF file format, e.g. "RDF/XML".mimeType
- The MIME type of the RDF file format, e.g.
application/rdf+xml for the RDF/XML file format.fileExt
- The (default) file extension for the RDF file format, e.g.
rdf for RDF/XML files.@Deprecated public static void register(RDFFormat rdfFormat)
ServiceRegistry.add(S)
to insert new parsers into
the system.@Deprecated public static RDFFormat forMIMEType(String mimeType)
Rio.getParserFormatForMIMEType(String)
instead.
NOTE: This method may not take into account dynamically loaded formats.
Use Rio.getParserFormatForMIMEType(String)
and
Rio.getWriterFormatForMIMEType(String)
to find all dynamically
loaded parser and writer formats, respectively.
mimeType
- A MIME type, e.g. "application/rdf+xml".forMIMEType(String,RDFFormat)
,
FileFormat.getMIMETypes()
@Deprecated public static RDFFormat forMIMEType(String mimeType, RDFFormat fallback)
Rio.getParserFormatForMIMEType(String, RDFFormat)
instead.
NOTE: This method may not take into account dynamically loaded formats.
Use Rio.getParserFormatForMIMEType(String, RDFFormat)
and
Rio.getWriterFormatForMIMEType(String, RDFFormat)
to find all
dynamically loaded parser and writer formats, respectively.
mimeType
- A file name.forMIMEType(String)
,
FileFormat.getMIMETypes()
@Deprecated public static RDFFormat forFileName(String fileName)
Rio.getParserFormatForFileName(String)
instead.
NOTE: This method may not take into account dynamically loaded formats.
Use Rio.getParserFormatForFileName(String)
and
Rio.getWriterFormatForFileName(String)
to find all dynamically
loaded parser and writer formats, respectively.
fileName
- A file name.forFileName(String,RDFFormat)
,
FileFormat.getFileExtensions()
@Deprecated public static RDFFormat forFileName(String fileName, RDFFormat fallback)
Rio.getParserFormatForFileName(String, RDFFormat)
instead.
NOTE: This method may not take into account dynamically loaded formats.
Use Rio.getParserFormatForFileName(String, RDFFormat)
and
Rio.getWriterFormatForFileName(String, RDFFormat)
to find all
dynamically loaded parser and writer formats, respectively.
fileName
- A file name.forFileName(String)
,
FileFormat.getFileExtensions()
@Deprecated public static RDFFormat valueOf(String formatName)
Rio
to find them.formatName
- A format name.public static List<String> getAcceptParams(Iterable<RDFFormat> rdfFormats, boolean requireContext, RDFFormat preferredFormat)
RDFFormat
s and assigns
quality values to each based on whether context must be supported and
whether the format is preferred.rdfFormats
- The RDFFormat
s to process.requireContext
- True to decrease the quality value for formats where
supportsContexts()
returns false.preferredFormat
- The preferred RDFFormat. If it is not in the list then the quality
of all formats will be processed as if they are not preferred.public boolean supportsNamespaces()
public boolean supportsContexts()
public boolean hasStandardURI()
public URI getStandardURI()
Copyright © 2001–2016 Aduna. All rights reserved.