org.eclipse.rdf4j.rio.helpers

## Class BasicParserSettings

- java.lang.Object
- - org.eclipse.rdf4j.rio.helpers.BasicParserSettings

-     public class BasicParserSettings
      extends Object

  A class encapsulating the basic parser settings that most parsers may support.
  Author:
    Peter Ansell

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static RioSetting<List<DatatypeHandler>>` | `DATATYPE_HANDLERS` Setting used to specify which `DatatypeHandler` implementations are to be used for a given parser configuration.
    `static RioSetting<Boolean>` | `FAIL_ON_UNKNOWN_DATATYPES` Boolean setting for parser to determine whether to fail parsing if datatypes are not recognised.
    `static RioSetting<Boolean>` | `FAIL_ON_UNKNOWN_LANGUAGES` Boolean setting for parser to determine whether to fail parsing if languages are not recognized.
    `static RioSetting<List<LanguageHandler>>` | `LANGUAGE_HANDLERS` Setting used to specify which `LanguageHandler` implementations are to be used for a given parser configuration.
    `static RioSetting<LargeLiteralHandling>` | `LARGE_LITERALS_HANDLING` Boolean setting for parser to determine whether parser should preserve, truncate, drop, or otherwise manipulate statements that contain long literals.
    `static RioSetting<Long>` | `LARGE_LITERALS_LIMIT` If `LARGE_LITERALS_HANDLING` is set to `LargeLiteralHandling.PRESERVE`, which it is by default, then the value of this setting is not used.
    `static RioSetting<Set<Namespace>>` | `NAMESPACES` Setting to provide a collection of `Namespace` objects which will be used when parsing RDF as the basis for the default set of namespaces of the document.
    `static RioSetting<Boolean>` | `NORMALIZE_DATATYPE_VALUES` Boolean setting for parser to determine whether recognised datatypes need to have their values be normalized.
    `static RioSetting<Boolean>` | `NORMALIZE_LANGUAGE_TAGS` Boolean setting for parser to determine whether languages need to be normalized, and to which format they should be normalized.
    `static RioSetting<Boolean>` | `PRESERVE_BNODE_IDS` Boolean setting for parser to determine whether parser should attempt to preserve identifiers for blank nodes.
    `static RioSetting<Boolean>` | `PROCESS_ENCODED_RDF_STAR` Boolean setting for parser to determine whether it should process RDF-star triples encoded as RDF-compatible special IRIs back to RDF-star values.
    `static RioSetting<String>` | `SKOLEMIZE_ORIGIN` Scheme and authority of new mint Skolem IRIs that should replace Blank Nodes.
    `static RioSetting<Boolean>` | `VERIFY_DATATYPE_VALUES` Boolean setting for parser to determine whether values for recognised datatypes are to be verified.
    `static RioSetting<Boolean>` | `VERIFY_LANGUAGE_TAGS` Boolean setting for parser to determine whether languages are to be verified based on a given set of definitions for valid languages.
    `static RioSetting<Boolean>` | `VERIFY_RELATIVE_URIS` Boolean setting for parser to determine whether relative URIs are verified.
    `static RioSetting<Boolean>` | `VERIFY_URI_SYNTAX` Boolean setting for parser to determine if URIs should be verified to contain only legal characters.

  - ### Method Summary

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

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

- - ### Field Detail

    - #### VERIFY_DATATYPE_VALUES

          public static final RioSetting<Boolean> VERIFY_DATATYPE_VALUES

      Boolean setting for parser to determine whether values for recognised datatypes are to be verified.

      Verification is performed using registered DatatypeHandlers.

      Defaults to false.

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.verify_datatype_values`.

    - #### FAIL_ON_UNKNOWN_DATATYPES

          public static final RioSetting<Boolean> FAIL_ON_UNKNOWN_DATATYPES

      Boolean setting for parser to determine whether to fail parsing if datatypes are not recognised.

      Datatypes are recognised based on matching one of the registered `DatatypeHandler`s.

      Defaults to false.

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.fail_on_unknown_datatypes`.

    - #### NORMALIZE_DATATYPE_VALUES

          public static final RioSetting<Boolean> NORMALIZE_DATATYPE_VALUES

      Boolean setting for parser to determine whether recognised datatypes need to have their values be normalized.

      Normalization is performed using registered DatatypeHandlers.

      Defaults to false.

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.normalize_datatype_values`.

    - #### DATATYPE_HANDLERS

          public static final RioSetting<List<DatatypeHandler>> DATATYPE_HANDLERS

      Setting used to specify which `DatatypeHandler` implementations are to be used for a given parser configuration.

      Defaults to an XMLSchema DatatypeHandler implementation based on `DatatypeHandler.XMLSCHEMA` and an RDF DatatypeHandler implementation based on `DatatypeHandler.RDFDATATYPES`.

    - #### FAIL_ON_UNKNOWN_LANGUAGES

          public static final RioSetting<Boolean> FAIL_ON_UNKNOWN_LANGUAGES

      Boolean setting for parser to determine whether to fail parsing if languages are not recognized.

      Languages are recognized based on matching one of the registered `LanguageHandler`s.

      Defaults to false.

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.fail_on_unknown_languages`.

    - #### VERIFY_LANGUAGE_TAGS

          public static final RioSetting<Boolean> VERIFY_LANGUAGE_TAGS

      Boolean setting for parser to determine whether languages are to be verified based on a given set of definitions for valid languages.

      Verification is performed using registered `LanguageHandler`s.

      Defaults to true.

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.verify_language_tags`.

    - #### NORMALIZE_LANGUAGE_TAGS

          public static final RioSetting<Boolean> NORMALIZE_LANGUAGE_TAGS

      Boolean setting for parser to determine whether languages need to be normalized, and to which format they should be normalized.

      Normalization is performed using registered `LanguageHandler`s.

      Defaults to false.

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.normalize_language_tags`.

    - #### LANGUAGE_HANDLERS

          public static final RioSetting<List<LanguageHandler>> LANGUAGE_HANDLERS

      Setting used to specify which `LanguageHandler` implementations are to be used for a given parser configuration.

      Defaults to an RFC3066 LanguageHandler implementation based on `LanguageHandler.RFC3066`.

    - #### VERIFY_RELATIVE_URIS

          public static final RioSetting<Boolean> VERIFY_RELATIVE_URIS

      Boolean setting for parser to determine whether relative URIs are verified.

      Defaults to true..

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.verify_relative_uris`.

    - #### VERIFY_URI_SYNTAX

          public static final RioSetting<Boolean> VERIFY_URI_SYNTAX

      Boolean setting for parser to determine if URIs should be verified to contain only legal characters.

      Defaults to `true`. If set to `false`, the parser will report syntactically illegal URIs to the `RDFHandler`.

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.verify_uri_syntax`.

    - #### PRESERVE_BNODE_IDS

          public static final RioSetting<Boolean> PRESERVE_BNODE_IDS

      Boolean setting for parser to determine whether parser should attempt to preserve identifiers for blank nodes. If the blank node did not have an identifier in the document a new identifier will be generated for it.

      Defaults to false.

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.preserve_bnode_ids`.

    - #### SKOLEMIZE_ORIGIN

          public static final RioSetting<String> SKOLEMIZE_ORIGIN

      Scheme and authority of new mint Skolem IRIs that should replace Blank Nodes. For example a value of "http://example.com" might cause a blank node to be replaced with an IRI of "http://example.com/.well-known/genid/d26a2d0e98334696f4ad70a677abc1f6"

      Defaults to null (disabled).

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.skolem_origin`.

    - #### LARGE_LITERALS_HANDLING

          public static final RioSetting<LargeLiteralHandling> LARGE_LITERALS_HANDLING

      Boolean setting for parser to determine whether parser should preserve, truncate, drop, or otherwise manipulate statements that contain long literals. The maximum length of literals if this setting is set to truncate or drop is configured using `LARGE_LITERALS_LIMIT`.

      Defaults to `LargeLiteralHandling.PRESERVE`.

    - #### LARGE_LITERALS_LIMIT

          public static final RioSetting<Long> LARGE_LITERALS_LIMIT

      If `LARGE_LITERALS_HANDLING` is set to `LargeLiteralHandling.PRESERVE`, which it is by default, then the value of this setting is not used.

      If `LARGE_LITERALS_HANDLING` is set to `LargeLiteralHandling.DROP` , then the value of this setting corresponds to the maximum number of bytes for a literal before the statement it is a part of is dropped silently by the parser.

      If `LARGE_LITERALS_HANDLING` is set to `LargeLiteralHandling.TRUNCATE` , then the value of this setting corresponds to the maximum number of bytes for a literal before the value is truncated.

      Defaults to 1048576 bytes, which is equivalent to 1 megabyte.

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.large_literals_limit`.

    - #### NAMESPACES

          public static final RioSetting<Set<Namespace>> NAMESPACES

      Setting to provide a collection of `Namespace` objects which will be used when parsing RDF as the basis for the default set of namespaces of the document.

      Namespaces specified within the RDF document being parsed will override these defaults

      Defaults to `Namespaces.DEFAULT_RDF4J` the RDFa 1.1 initial context + some additional prefixes.

    - #### PROCESS_ENCODED_RDF_STAR

          public static final RioSetting<Boolean> PROCESS_ENCODED_RDF_STAR

      Boolean setting for parser to determine whether it should process RDF-star triples encoded as RDF-compatible special IRIs back to RDF-star values. These IRIs start with urn:rdf4j:triple: followed by the base64-encoding of the N-Triples serialization of the RDF-star triple value.

      Parsers that support RDF-star natively will honour this setting too.

      Defaults to true.

      Can be overridden by setting system property `org.eclipse.rdf4j.rio.process_encoded_rdf_star`.

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