public interface DatatypeHandler
Modifier and Type | Method and Description |
---|---|
boolean |
isRecognizedDatatype(IRI datatypeUri)
Checks if the given datatype
IRI is recognized by this `DatatypeHandler`. |
String |
key()
A unique key for this datatype handler to identify it in the
|
default Literal |
normalizeDatatype(String theValue,
Datatype theDatatype)
Normalize both the datatype and the literal value if appropriate, and generate a literal with the provided value and datatype.
|
boolean |
verifyDatatype(String theValue,
Datatype theDatatype)
Verifies that the datatype is valid, including a check on the
structure of the literal value.
|
boolean isRecognizedDatatype(@Nonnull IRI datatypeUri)
IRI
is recognized by this `DatatypeHandler`.datatypeUri
- The datatype URI to check.verifyDatatype(String, Datatype)
and
normalizeDatatype(String, Datatype)
.boolean verifyDatatype(@Nonnull String theValue, @Nonnull Datatype theDatatype)
This method must only be called after verifying that
isRecognizedDatatype(IRI)
returns true for the given datatype
URI.
theValue
- Literal value matching the given datatype URI.theDatatype
- A datatype that matched with isRecognizedDatatype(IRI)
InvalidLiteral
exception if the datatype is not recognizeddefault Literal normalizeDatatype(@Nonnull String theValue, @Nonnull Datatype theDatatype)
isRecognizedDatatype(IRI)
returns true for the given datatype
URI, and verifyDatatype(String, Datatype)
also returns true for the
given datatype and literal value.theValue
- Required literal value to use in the normalization process and to
provide the value for the resulting literal.theDatatype
- The datatype which is to be normalized. It is available
in normalized form from the result using
Literal.datatype()
.Literal
containing the normalized literal value and datatype URI.
An implementation may throw InvalidLiteral
exception if the datatype is not recognized
or cannot be normalized for any reason, e.g. its value is not legal for its datatype.String key()
Copyright © 2010-2016 Stardog Union. All Rights Reserved.