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 booleanisRecognizedDatatype(IRI theURI)Checks if the given datatypeIRIis recognized by this `DatatypeHandler`.java.lang.Stringkey()A unique key for this datatype handler to identify it in thebooleanverifyDatatype(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 theRDFvocabulary.- See Also:
- Constant Field Values
-
-
Method Detail
-
isRecognizedDatatype
public boolean isRecognizedDatatype(@Nonnull IRI theURI)Checks if the given datatypeIRIis recognized by this `DatatypeHandler`.- Specified by:
isRecognizedDatatypein 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:
keyin 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:
verifyDatatypein 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
InvalidLiteralexception if the datatype is not recognized
-
-