public class DBPediaDatatypeHandler extends Object implements DatatypeHandler
DBPEDIA, GEOSPARQL, RDFDATATYPES, VIRTUOSOGEOMETRY, XMLSCHEMA| Constructor and Description |
|---|
DBPediaDatatypeHandler()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getKey()
A unique key for this datatype handler to identify it in the
DatatypeHandlerRegistry.
|
boolean |
isRecognizedDatatype(URI datatypeUri)
Checks if the given datatype URI is recognized by this datatype handler.
|
Literal |
normalizeDatatype(String literalValue,
URI 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,
URI datatypeUri)
Verifies that the datatype URI is valid, including a check on the
structure of the literal value.
|
public boolean isRecognizedDatatype(URI datatypeUri)
DatatypeHandlerisRecognizedDatatype in interface DatatypeHandlerdatatypeUri - The datatype URI to check.DatatypeHandler.verifyDatatype(String, URI) and
DatatypeHandler.normalizeDatatype(String, URI, ValueFactory).public boolean verifyDatatype(String literalValue, URI datatypeUri) throws LiteralUtilException
DatatypeHandler
This method must only be called after verifying that
DatatypeHandler.isRecognizedDatatype(URI) returns true for the given datatype
URI.
verifyDatatype in interface DatatypeHandlerliteralValue - Literal value matching the given datatype URI.datatypeUri - A datatype URI that matched with DatatypeHandler.isRecognizedDatatype(URI)LiteralUtilException - If the datatype was not recognized.public Literal normalizeDatatype(String literalValue, URI datatypeUri, ValueFactory valueFactory) throws LiteralUtilException
DatatypeHandler
This method must only be called after verifying that
DatatypeHandler.isRecognizedDatatype(URI) returns true for the given datatype
URI, and DatatypeHandler.verifyDatatype(String, URI) also returns true for the
given datatype URI and literal value.
normalizeDatatype in interface DatatypeHandlerliteralValue - 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.public String getKey()
DatatypeHandlergetKey in interface DatatypeHandlerCopyright © 2001–2015 Aduna. All rights reserved.