org.eclipse.rdf4j.rio.datatypes

## Class GeoSPARQLDatatypeHandler

- java.lang.Object
- - org.eclipse.rdf4j.rio.datatypes.GeoSPARQLDatatypeHandler

- All Implemented Interfaces:
    DatatypeHandler

      public class GeoSPARQLDatatypeHandler
      extends Object
      implements DatatypeHandler

  An implementation of a datatype handler that can process GeoSPARQL datatypes.
  Author:
    Peter Ansell

- - ### Field Summary

    - ### Fields inherited from interface org.eclipse.rdf4j.rio.DatatypeHandler

      `DBPEDIA, GEOSPARQL, RDFDATATYPES, VIRTUOSOGEOMETRY, XMLSCHEMA`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeoSPARQLDatatypeHandler()` Default constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GeoSPARQLDatatypeHandler

          public GeoSPARQLDatatypeHandler()

      Default constructor.

  - ### Method Detail

    - #### isRecognizedDatatype

          public boolean isRecognizedDatatype(IRI datatypeUri)

      Description copied from interface: `DatatypeHandler`
      Checks if the given datatype URI is recognized by this datatype handler.
      Specified by:
        `isRecognizedDatatype` in interface `DatatypeHandler`
      Parameters:
        `datatypeUri` - The datatype URI to check.
      Returns:
        True if the datatype is syntactically valid and could be used with `DatatypeHandler.verifyDatatype(String, IRI)` and `DatatypeHandler.normalizeDatatype(String, IRI, ValueFactory)`.

    - #### verifyDatatype

          public boolean verifyDatatype(String literalValue,
                                        IRI datatypeUri)
                                 throws LiteralUtilException

      Description copied from interface: `DatatypeHandler`
      Verifies that the datatype URI 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 interface `DatatypeHandler`
      Parameters:
        `literalValue` - Literal value matching the given datatype URI.
        `datatypeUri` - A datatype URI that matched with `DatatypeHandler.isRecognizedDatatype(IRI)`
      Returns:
        True if the datatype URI is recognized by this datatype handler, and it is verified to be syntactically valid.
      Throws:
        `LiteralUtilException` - If the datatype was not recognized.

    - #### normalizeDatatype

          public Literal normalizeDatatype(String literalValue,
                                           IRI datatypeUri,
                                           ValueFactory valueFactory)
                                    throws LiteralUtilException

      Description copied from interface: `DatatypeHandler`
      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.

      This method must only be called after verifying that `DatatypeHandler.isRecognizedDatatype(IRI)` returns true for the given datatype URI, and `DatatypeHandler.verifyDatatype(String, IRI)` also returns true for the given datatype URI and literal value.

      Specified by:
        `normalizeDatatype` in interface `DatatypeHandler`
      Parameters:
        `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.
      Returns:
        A `Literal` containing the normalized literal value and datatype URI.
      Throws:
        `LiteralUtilException` - If the datatype URI was not recognized or verified, or the literal value could not be normalized due to an error.

    - #### getKey

          public String getKey()

      Description copied from interface: `DatatypeHandler`
      A unique key for this datatype handler to identify it in the DatatypeHandlerRegistry.
      Specified by:
        `getKey` in interface `DatatypeHandler`
      Returns:
        A unique string key.

Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.