| org.openrdf.rio.RDFFormat
RDFFormat | public class RDFFormat extends FileFormat (Code) | | Represents the concept of an RDF data serialization format. RDF formats are
identified by a
RDFFormat.getName() 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
RDFFormat.supportsContexts .
author: Arjohn Kampman |
Constructor Summary | |
public | RDFFormat(String name, String mimeType, Charset charset, String fileExtension, boolean supportsNamespaces, boolean supportsContexts) Creates a new RDFFormat object.
Parameters: name - The name of the RDF file format, e.g. | public | RDFFormat(String name, String mimeType, Charset charset, Collection<String> fileExtensions, boolean supportsNamespaces, boolean supportsContexts) Creates a new RDFFormat object.
Parameters: name - The name of the RDF file format, e.g. | public | RDFFormat(String name, Collection<String> mimeTypes, Charset charset, Collection<String> fileExtensions, boolean supportsNamespaces, boolean supportsContexts) Creates a new RDFFormat object.
Parameters: name - The name of the RDF file format, e.g. |
Method Summary | |
public static RDFFormat | forFileName(String fileName) Tries to determine the appropriate RDF file format based on the extension
of a file name.
Parameters: fileName - A file name. | public static RDFFormat | forFileName(String fileName, RDFFormat fallback) Tries to determine the appropriate RDF file format based on the extension
of a file name. | public static RDFFormat | forMIMEType(String mimeType) Tries to determine the appropriate RDF file format based on the a MIME
type that describes the content type.
Parameters: mimeType - A MIME type, e.g. | public static RDFFormat | forMIMEType(String mimeType, RDFFormat fallback) Tries to determine the appropriate RDF file format based on the a MIME
type that describes the content type. | public static RDFFormat | register(String name, String mimeType, String fileExt, Charset charset) Registers the specified RDF file format.
Parameters: name - The name of the RDF file format, e.g. | public static void | register(RDFFormat rdfFormat) Registers the specified RDF file format. | public boolean | supportsContexts() | public boolean | supportsNamespaces() | public static RDFFormat | valueOf(String formatName) Returns the RDF format whose name matches the specified name.
Parameters: formatName - A format name. | public static Collection<RDFFormat> | values() Returns all known/registered RDF formats. |
NTRIPLES | final public static RDFFormat NTRIPLES(Code) | | The N-Triples file format.
|
RDFFormat | public RDFFormat(String name, String mimeType, Charset charset, String fileExtension, boolean supportsNamespaces, boolean supportsContexts)(Code) | | Creates a new RDFFormat object.
Parameters: name - The name of the RDF file format, e.g. "RDF/XML". Parameters: mimeType - The MIME type of the RDF file format, e.g.application/rdf+xml for the RDF/XML file format. Parameters: charset - The default character encoding of the RDF file format. Specifynull if not applicable. Parameters: fileExtension - The (default) file extension for the RDF file format, e.g.rdf for RDF/XML files. |
RDFFormat | public RDFFormat(String name, String mimeType, Charset charset, Collection<String> fileExtensions, boolean supportsNamespaces, boolean supportsContexts)(Code) | | Creates a new RDFFormat object.
Parameters: name - The name of the RDF file format, e.g. "RDF/XML". Parameters: mimeType - The MIME type of the RDF file format, e.g.application/rdf+xml for the RDF/XML file format. Parameters: charset - The default character encoding of the RDF file format. Specifynull if not applicable. Parameters: fileExtensions - The RDF format's file extensions, e.g. rdf for RDF/XMLfiles. The first item in the list is interpreted as the defaultfile extension for the format. |
RDFFormat | public RDFFormat(String name, Collection<String> mimeTypes, Charset charset, Collection<String> fileExtensions, boolean supportsNamespaces, boolean supportsContexts)(Code) | | Creates a new RDFFormat object.
Parameters: name - The name of the RDF file format, e.g. "RDF/XML". Parameters: mimeTypes - The MIME types of the RDF file format, e.g.application/rdf+xml for the RDF/XML file format. Thefirst item in the list is interpreted as the default MIME type forthe format. Parameters: charset - The default character encoding of the RDF file format. Specifynull if not applicable. Parameters: fileExtensions - The RDF format's file extensions, e.g. rdf for RDF/XMLfiles. The first item in the list is interpreted as the defaultfile extension for the format. |
forFileName | public static RDFFormat forFileName(String fileName, RDFFormat fallback)(Code) | | Tries to determine the appropriate RDF file format based on the extension
of a file name. The supplied fallback format will be returned when the
file name extension was not recognized.
Parameters: fileName - A file name. An RDFFormat that matches the file name extension, or the fallbackformat if the extension was not recognized. See Also: RDFFormat.forFileName(String) See Also: RDFFormat.getFileExtension |
forMIMEType | public static RDFFormat forMIMEType(String mimeType, RDFFormat fallback)(Code) | | Tries to determine the appropriate RDF file format based on the a MIME
type that describes the content type. The supplied fallback format will be
returned when the MIME type was not recognized.
Parameters: mimeType - A file name. An RDFFormat that matches the MIME type, or the fallback format ifthe extension was not recognized. See Also: RDFFormat.forMIMEType(String) See Also: RDFFormat.getMIMEType |
register | public static RDFFormat register(String name, String mimeType, String fileExt, Charset charset)(Code) | | Registers the specified RDF file format.
Parameters: name - The name of the RDF file format, e.g. "RDF/XML". Parameters: mimeType - The MIME type of the RDF file format, e.g.application/rdf+xml for the RDF/XML file format. Parameters: fileExt - The (default) file extension for the RDF file format, e.g.rdf for RDF/XML files. |
register | public static void register(RDFFormat rdfFormat)(Code) | | Registers the specified RDF file format.
|
supportsContexts | public boolean supportsContexts()(Code) | | |
supportsNamespaces | public boolean supportsNamespaces()(Code) | | |
valueOf | public static RDFFormat valueOf(String formatName)(Code) | | Returns the RDF format whose name matches the specified name.
Parameters: formatName - A format name. The RDF format whose name matches the specified name, ornull if there is no such format. |
|
|