public interface DatatypeHandler
Modifier and Type | Field and Description |
---|---|
static String |
DBPEDIA
Identifier for datatypes defined by DBPedia.
|
static String |
GEOSPARQL
Identifier for datatypes defined in the GeoSPARQL vocabulary.
|
static String |
RDFDATATYPES
Identifier for datatypes defined in the
RDF vocabulary. |
static String |
VIRTUOSOGEOMETRY
Identifier for datatypes defined in the Virtuoso Geometry vocabulary.
|
static String |
XMLSCHEMA
Identifier for datatypes defined in the
XMLSchema vocabulary. |
Modifier and Type | Method and Description |
---|---|
String |
getKey()
A unique key for this datatype handler to identify it in the DatatypeHandlerRegistry.
|
boolean |
isRecognizedDatatype(IRI datatypeUri)
Checks if the given datatype URI is recognized by this datatype handler.
|
Literal |
normalizeDatatype(String literalValue,
IRI datatypeUri,
ValueFactory valueFactory)
Normalize both the datatype URI and the literal value if appropriate, and use the given value factory to generate
a literal matching a literal value and datatype URI.
|
boolean |
verifyDatatype(String literalValue,
IRI datatypeUri)
Verifies that the datatype URI is valid, including a check on the structure of the literal value.
|
static final String XMLSCHEMA
XMLSchema
vocabulary.static final String RDFDATATYPES
RDF
vocabulary.static final String DBPEDIA
static final String VIRTUOSOGEOMETRY
static final String GEOSPARQL
boolean isRecognizedDatatype(IRI datatypeUri)
datatypeUri
- The datatype URI to check.verifyDatatype(String, IRI)
and normalizeDatatype(String, IRI, ValueFactory)
.boolean verifyDatatype(String literalValue, IRI datatypeUri) throws LiteralUtilException
This method must only be called after verifying that isRecognizedDatatype(IRI)
returns true for the
given datatype URI.
literalValue
- Literal value matching the given datatype URI.datatypeUri
- A datatype URI that matched with isRecognizedDatatype(IRI)
LiteralUtilException
- If the datatype was not recognized.Literal normalizeDatatype(String literalValue, IRI datatypeUri, ValueFactory valueFactory) throws LiteralUtilException
This method must only be called after verifying that isRecognizedDatatype(IRI)
returns true for the
given datatype URI, and verifyDatatype(String, IRI)
also returns true for the given datatype URI and
literal value.
literalValue
- Required literal value to use in the normalization process and to provide the value for the
resulting literal.datatypeUri
- The datatype URI which is to be normalized. This URI is available in normalized form from the
result using Literal.getDatatype()
.valueFactory
- The ValueFactory
to use to create the result literal.Literal
containing the normalized literal value and datatype URI.LiteralUtilException
- If the datatype URI was not recognized or verified, or the literal value could not
be normalized due to an error.String getKey()
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.