public final class RDFFormats extends Object
Utilities for RDFFormat
SupportedFileFormats
Modifier and Type | Field and Description |
---|---|
static RDFFormat |
BINARY
Binary RDF
|
static RDFFormat |
JSONLD
[JSON-LD](ttp://www.w3.org/TR/json-ld/)
|
static RDFFormat |
N3
[Notation 3](http://www.w3.org/TeamSubmission/n3/)
|
static RDFFormat |
NQUADS
[NQuads](http://www.w3.org/TR/n-quads/)
|
static RDFFormat |
NTRIPLES
[N-triples](http://www.w3.org/TR/n-triples/)
|
static RDFFormat |
PRETTY_TURTLE |
static RDFFormat |
RDFJSON
[RDF/JSON](http://www.w3.org/TR/rdf-json/)
|
static RDFFormat |
RDFXML
[RDF/XML](http://www.w3.org/TR/rdf-syntax-grammar/)
|
static RDFFormat |
TRIG
[TriG](http://www.w3.org/TR/trig)
|
static RDFFormat |
TURTLE
Format denoting [Turtle](https://www.w3.org/TR/turtle/)
|
static RDFFormat |
UNKNOWN_BASE_FORMAT |
Modifier and Type | Method and Description |
---|---|
static RDFFormat |
baseFormat(RDFFormat theFormat)
Returns the
base format of the given format if it is a compressed format
or the given format otherwise. |
static RDFFormat |
compressedFormat(RDFFormat theFormat,
FileFormat.Compression theCompression) |
static RDFFormat |
compressedForName(RDFFormat theFormat,
String theName)
Return the
compressed RDFFormat for the given name, with the provided base format. |
static FileFormat.Compression |
compressionOf(RDFFormat theFormat)
Returns the
compression of given format if it is a compressed format or
FileFormat.Compression.NONE otherwise. |
static RDFFormat |
forFile(File theFile,
RDFFormat theBaseFormat) |
static Optional<RDFFormat> |
forFile(Path thePath)
|
static Optional<RDFFormat> |
forFile(String theFileName) |
static RDFFormat |
forFile(String theFileName,
RDFFormat theBaseFormat) |
static Optional<RDFFormat> |
forMime(String theMime)
Return the
format which supports the given mimetype |
static Optional<RDFFormat> |
forName(String theName)
Return the
format with the provided name |
static RDFFormat |
register(String theName,
IRI theId,
List<String> theMimetypes,
List<String> theFileExtensions)
Create a new
RDFFormatImpl |
static RDFFormat.BinaryRDFFormat |
registerBinary(String theName,
IRI theId,
List<String> theMimetypes,
List<String> theFileExtensions)
Create a new
RDFFormat.BinaryRDFFormat |
static boolean |
supportsContexts(RDFFormat theFormat)
Return whether or not the format is capable of serializing the context information for a
Statement . |
public static RDFFormat UNKNOWN_BASE_FORMAT
public static final RDFFormat TURTLE
public static final RDFFormat PRETTY_TURTLE
public static final RDFFormat NTRIPLES
public static final RDFFormat NQUADS
public static final RDFFormat RDFXML
public static final RDFFormat N3
public static final RDFFormat TRIG
public static final RDFFormat RDFJSON
public static final RDFFormat BINARY
public static final RDFFormat JSONLD
@Nonnull public static Optional<RDFFormat> forFile(@Nonnull Path thePath)
thePath
- the file to be parsed@Nonnull public static Optional<RDFFormat> forName(@Nonnull String theName)
format
with the provided nametheName
- the name of the formatformat
@Nonnull public static Optional<RDFFormat> forMime(@Nonnull String theMime)
format
which supports the given mimetypetheMime
- the mimetypeformat
that supports the mimetype@Nonnull public static RDFFormat compressedForName(RDFFormat theFormat, String theName)
compressed RDFFormat
for the given name, with the provided base format.theFormat
- theName
- @Nonnull public static RDFFormat compressedFormat(RDFFormat theFormat, FileFormat.Compression theCompression)
public static RDFFormat baseFormat(RDFFormat theFormat)
base format
of the given format if it is a compressed format
or the given format otherwise.theFormat
- input formatbase format
of the given format if it is a compressed format
or the given format otherwise.public static FileFormat.Compression compressionOf(RDFFormat theFormat)
compression
of given format if it is a compressed format
or
FileFormat.Compression.NONE
otherwise.theFormat
- input formatcompression
of given format if it is a compressed format
or
FileFormat.Compression.NONE
otherwise.public static boolean supportsContexts(@Nonnull RDFFormat theFormat)
Statement
.theFormat
- the formatpublic static RDFFormat register(@Nonnull String theName, @Nonnull IRI theId, @Nonnull List<String> theMimetypes, @Nonnull List<String> theFileExtensions)
RDFFormatImpl
theName
- the human-friendly name of the formattheId
- the IRI of the formattheMimetypes
- the list of supported mimetypes. There must be *at least* `1`, and the first element in the list is
taken to be the default mimetypetheFileExtensions
- the list of supported extensions. There must be *at least* `1`, and the first element in the list is
taken to be the default extensionpublic static RDFFormat.BinaryRDFFormat registerBinary(@Nonnull String theName, @Nonnull IRI theId, @Nonnull List<String> theMimetypes, @Nonnull List<String> theFileExtensions)
RDFFormat.BinaryRDFFormat
theName
- the human-friendly name of the formattheId
- the IRI of the formattheMimetypes
- the list of supported mimetypes. There must be *at least* `1`, and the first element in the list is
taken to be the default mimetypetheFileExtensions
- the list of supported extensions. There must be *at least* `1`, and the first element in the list is
taken to be the default extensionCopyright © 2010-2016 Stardog Union. All Rights Reserved.