public enum RDFSyntax extends Enum<RDFSyntax>
This enumeration lists the W3C standardized RDF 1.1 syntaxes like
TURTLE
and JSONLD
. Note the existence of other RDF syntaxes
that are not included here, e.g.
N3 and
TriX.
RDFParser
Enum Constant and Description |
---|
JSONLD
JSON-LD 1.0
|
NQUADS
RDF 1.1 N-Quads
|
NTRIPLES
RDF 1.1 N-Triples
|
RDFA_HTML
HTML+RDFa 1.1
|
RDFA_XHTML
XHTML+RDFa 1.1
|
RDFXML
RDF 1.1 XML Syntax
|
TRIG
RDF 1.1 TriG
|
TURTLE
RDF 1.1 Turtle
|
Modifier and Type | Field and Description |
---|---|
String |
fileExtension
The IANA-registered
file extension.
|
String |
mediaType
The IANA media type for
the RDF syntax.
|
boolean |
supportsDataset
Indicate if this RDF syntax supports
RDF
Datasets.
|
Modifier and Type | Method and Description |
---|---|
static Optional<RDFSyntax> |
byFileExtension(String fileExtension)
Return the RDFSyntax with the specified file extension.
|
static Optional<RDFSyntax> |
byMediaType(String mediaType)
Return the RDFSyntax with the specified media type.
|
String |
toString()
A human-readable name for the RDF syntax.
|
static RDFSyntax |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RDFSyntax[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RDFSyntax JSONLD
public static final RDFSyntax TURTLE
public static final RDFSyntax NQUADS
public static final RDFSyntax NTRIPLES
public static final RDFSyntax RDFA_HTML
public static final RDFSyntax RDFA_XHTML
public static final RDFSyntax RDFXML
public static final RDFSyntax TRIG
public final String mediaType
The media type can be used as part of Content-Type
and
Accept
for content negotiation in the
HTTP
protocol.
public final String fileExtension
The file extension includes the leading period, e.g. .jsonld
public final boolean supportsDataset
public static RDFSyntax[] values()
for (RDFSyntax c : RDFSyntax.values()) System.out.println(c);
public static RDFSyntax valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String toString()
The name is equivalent to the the title of the corresponding W3C Specification.
public static Optional<RDFSyntax> byMediaType(String mediaType)
The mediaType
is compared in lower case, therefore it might
not be equal to the mediaType
of the returned
RDFSyntax.
For convenience matching of media types used in a
Content-Type
header, if the mediaType
contains
the characters ;
, ,
or white space, only the
part of the string to the left of those characters are considered.
mediaType
- The media type to matchOptional.isPresent()
, the RDFSyntax
which has
a matching mediaType
, otherwise
Optional.empty()
indicating that no matching syntax was
found.public static Optional<RDFSyntax> byFileExtension(String fileExtension)
The fileExtension
is compared in lower case, therefore it
might not be equal to the fileExtension
of the returned
RDFSyntax.
fileExtension
- The fileExtension to match, starting with .
Optional.isPresent()
, the RDFSyntax
which has
a matching fileExtension
, otherwise
Optional.empty()
indicating that no matching file
extension was found.Copyright © 2015–2017 The Apache Software Foundation. All rights reserved.