Package com.stardog.stark.io
Class RDFFormats
java.lang.Object
com.stardog.stark.io.RDFFormats
Utilities for RDFFormat
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Michael Grove
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RDFFormatBinary RDFstatic final RDFFormat[JSON-LD](ttp://www.w3.org/TR/json-ld/)static final RDFFormat[Notation 3](http://www.w3.org/TeamSubmission/n3/)static final RDFFormat[NQuads](http://www.w3.org/TR/n-quads/)static final RDFFormat[N-triples](http://www.w3.org/TR/n-triples/)static final RDFFormatstatic final RDFFormat[RDF/JSON](http://www.w3.org/TR/rdf-json/)static final RDFFormat[RDF/XML](http://www.w3.org/TR/rdf-syntax-grammar/)static final RDFFormat[TriG](http://www.w3.org/TR/trig)static final RDFFormatFormat denoting [Turtle](https://www.w3.org/TR/turtle/)static RDFFormat -
Method Summary
Modifier and TypeMethodDescriptionstatic RDFFormatbaseFormat(RDFFormat theFormat) Returns thebase formatof the given format if it is acompressed formator the given format otherwise.static RDFFormatcompressedFormat(RDFFormat theFormat, FileFormat.Compression theCompression) static RDFFormatcompressedForName(RDFFormat theFormat, String theName) Return thecompressed RDFFormatfor the given name, with the provided base format.static FileFormat.CompressioncompressionOf(RDFFormat theFormat) Returns thecompressionof given format if it is acompressed formatorFileFormat.Compression.NONEotherwise.static RDFFormatstatic RDFFormatReturn theformatwhich supports the given mimetypeReturn theformatwith the provided namestatic RDFFormatCreate a newRDFFormats.RDFFormatImplstatic RDFFormat.BinaryRDFFormatregisterBinary(String theName, IRI theId, List<String> theMimetypes, List<String> theFileExtensions) Create a newRDFFormat.BinaryRDFFormatstatic booleansupportsContexts(RDFFormat theFormat) Return whether or not the format is capable of serializing the context information for aStatement.
-
Field Details
-
UNKNOWN_BASE_FORMAT
-
TURTLE
Format denoting [Turtle](https://www.w3.org/TR/turtle/) -
PRETTY_TURTLE
-
NTRIPLES
[N-triples](http://www.w3.org/TR/n-triples/) -
NQUADS
[NQuads](http://www.w3.org/TR/n-quads/) -
RDFXML
[RDF/XML](http://www.w3.org/TR/rdf-syntax-grammar/) -
N3
[Notation 3](http://www.w3.org/TeamSubmission/n3/) -
TRIG
[TriG](http://www.w3.org/TR/trig) -
RDFJSON
[RDF/JSON](http://www.w3.org/TR/rdf-json/) -
BINARY
Binary RDF -
JSONLD
[JSON-LD](ttp://www.w3.org/TR/json-ld/)
-
-
Method Details
-
forFile
- Parameters:
thePath- the file to be parsed- Returns:
- the RDF format
-
forName
Return theformatwith the provided name- Parameters:
theName- the name of the format- Returns:
- the
format
-
forMime
Return theformatwhich supports the given mimetype- Parameters:
theMime- the mimetype- Returns:
- the
formatthat supports the mimetype - Implementation Notes:
- The default mimetypes are checked for _all_ formats before the full set of mimetypes for each format are considered.
-
compressedForName
Return thecompressed RDFFormatfor the given name, with the provided base format.- Parameters:
theFormat-theName-- Returns:
-
compressedFormat
@Nonnull public static RDFFormat compressedFormat(RDFFormat theFormat, FileFormat.Compression theCompression) -
forFile
-
forFile
-
forFile
-
baseFormat
Returns thebase formatof the given format if it is acompressed formator the given format otherwise.- Parameters:
theFormat- input format- Returns:
- the
base formatof the given format if it is acompressed formator the given format otherwise.
-
compressionOf
Returns thecompressionof given format if it is acompressed formatorFileFormat.Compression.NONEotherwise.- Parameters:
theFormat- input format- Returns:
- the
compressionof given format if it is acompressed formatorFileFormat.Compression.NONEotherwise.
-
supportsContexts
Return whether or not the format is capable of serializing the context information for aStatement.- Parameters:
theFormat- the format- Returns:
- `true` if the format can serialize quads, `false` otherwise
-
register
public static RDFFormat register(@Nonnull String theName, @Nonnull IRI theId, @Nonnull List<String> theMimetypes, @Nonnull List<String> theFileExtensions) Create a newRDFFormats.RDFFormatImpl- Parameters:
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 extension
-
registerBinary
public static RDFFormat.BinaryRDFFormat registerBinary(@Nonnull String theName, @Nonnull IRI theId, @Nonnull List<String> theMimetypes, @Nonnull List<String> theFileExtensions) Create a newRDFFormat.BinaryRDFFormat- Parameters:
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 extension
-