Package com.stardog.stark.io.datatypes
Class RDFDatatypesHandler
- java.lang.Object
-
- com.stardog.stark.io.datatypes.RDFDatatypesHandler
-
- All Implemented Interfaces:
DatatypeHandler
public final class RDFDatatypesHandler extends java.lang.Object implements DatatypeHandler
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Michael Grove
-
-
Constructor Summary
Constructors Constructor Description RDFDatatypesHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isRecognizedDatatype(IRI theURI)
Checks if the given datatypeIRI
is recognized by this `DatatypeHandler`.java.lang.String
key()
A unique key for this datatype handler to identify it in theboolean
verifyDatatype(java.lang.String theValue, Datatype theDatatype)
Verifies that the datatype is valid, including a check on the structure of the literal value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.stardog.stark.io.DatatypeHandler
normalizeDatatype
-
-
-
-
Field Detail
-
KEY
public static final java.lang.String KEY
Identifier for datatypes defined in theRDF
vocabulary.- See Also:
- Constant Field Values
-
-
Method Detail
-
isRecognizedDatatype
public boolean isRecognizedDatatype(@Nonnull IRI theURI)
Checks if the given datatypeIRI
is recognized by this `DatatypeHandler`.- Specified by:
isRecognizedDatatype
in interfaceDatatypeHandler
- Parameters:
theURI
- The datatype URI to check.- Returns:
- `true` if the datatype is syntactically valid and could be used with
DatatypeHandler.verifyDatatype(String, Datatype)
andDatatypeHandler.normalizeDatatype(String, Datatype)
.
-
key
public java.lang.String key()
A unique key for this datatype handler to identify it in the- Specified by:
key
in interfaceDatatypeHandler
- Returns:
- A unique string key.
-
verifyDatatype
public boolean verifyDatatype(@Nonnull java.lang.String theValue, @Nonnull Datatype theDatatype)
Verifies that the datatype is valid, including a check on the structure of the literal value.This method must only be called after verifying that
DatatypeHandler.isRecognizedDatatype(IRI)
returns true for the given datatype URI.- Specified by:
verifyDatatype
in interfaceDatatypeHandler
- Parameters:
theValue
- Literal value matching the given datatype URI.theDatatype
- A datatype that matched withDatatypeHandler.isRecognizedDatatype(IRI)
- Returns:
- True if the datatype URI is recognized by this datatype handler,
and it is verified to be syntactically valid. An implementation may throw
InvalidLiteral
exception if the datatype is not recognized
-
-