Class ParserOptions
Options for RDF parsing.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Michael Grove
-
Field Summary
FieldsModifier and TypeFieldDescriptionParser setting to determine whether to throw an error for duplicate uses of rdf:ID in a single document.Parser setting to determine whether to ignore XML documents containing invalid NCNAMEs.Parser setting to determine whether to ignore XML documents containing invalid QNAMEs.Parser setting to determine whether to throw an error for XML documents containing mismatched tagsParser setting to determine whether to ignore non-standard attributes that are found in an XML document.Parser setting to determine whether to ignore non-fatal errors that come from SAX parsers.static final Option<LanguageHandler> Lnaguage handler that will be used for verification and normalization.This option controls if the parser should preserve bnode identifiers specified in the source.Parser setting for the secure processing feature of XML parsers to avoid DOS and XXE attacks. -
Method Summary
Modifier and TypeMethodDescriptionstatic OptionsReturn the default options with thebase IRIset to the given valuestatic Optionsdefaults()Default parser optionsstatic Optionslax()Return a set of `Options` which correspond to default settings for a strict RDF parsing modestatic Optionsnamespaces(Iterable<Namespace> theNamespaces) Return the default options withnamespacesset to the given valuestatic Optionsstrict()Return a set of `Options` which correspond to default settings for a strict RDF parsing mode
-
Field Details
-
BASE_IRI
-
NAMESPACES
-
VERIFY_DATATYPES
-
VERIFY_LANG
-
VERIFY_RELATIVE_IRIS
-
VERIFY_IRI_SYNTAX
-
NORMALIZE_DATATYPES
-
NORMALIZE_LANG
-
LANG_HANDLER
Lnaguage handler that will be used for verification and normalization. -
PRESERVE_BNODE_IDS
This option controls if the parser should preserve bnode identifiers specified in the source. Preserving bnode identifiers help speed parsing and loading time but it also has an important side-effect that if two distinct files using the same bnode identifier are loaded to the same database, the bnode in different files will end up pointing to the same node in the database. If the input files do not use bnode identifiers (e.g. in Turtle syntax only [] are used for bnodes) then this configuration option has no effect since such bnodes are always assigned a unique identifier. But if input files use explicit bnode identifiers (e.g. _:bnode1 in Turtle syntax) and multiple files may use same bnode identifiers then this configuration option should be turned off.
-
CASE_INSENSITIVE_DIRECTIVES
-
FAIL_ON_INVALID_LINES
-
SECURE_PROCESSING
Parser setting for the secure processing feature of XML parsers to avoid DOS and XXE attacks. Setting this option will enable the XMLConstants.FEATURE_SECURE_PROCESSING setting for the XML parser and disable the following settings that can be used in XML External Entity (XXE) attacks:http://apache.org/xml/features/nonvalidating/load-external-dtdhttp://xml.org/sax/features/external-general-entitieshttp://xml.org/sax/features/external-parameter-entities
Defaults to true
-
FAIL_ON_SAX_NON_FATAL_ERRORS
Parser setting to determine whether to ignore non-fatal errors that come from SAX parsers.Defaults to true
-
FAIL_ON_NON_STANDARD_ATTRIBUTES
Parser setting to determine whether to ignore non-standard attributes that are found in an XML document.Defaults to true
-
FAIL_ON_INVALID_NCNAME
Parser setting to determine whether to ignore XML documents containing invalid NCNAMEs.Defaults to true
-
FAIL_ON_DUPLICATE_RDF_ID
Parser setting to determine whether to throw an error for duplicate uses of rdf:ID in a single document.Defaults to true
-
FAIL_ON_INVALID_QNAME
Parser setting to determine whether to ignore XML documents containing invalid QNAMEs.Defaults to true
-
FAIL_ON_MISMATCHED_TAGS
Parser setting to determine whether to throw an error for XML documents containing mismatched tagsDefaults to true
-
-
Method Details
-
defaults
Default parser options- Returns:
- the default options
-
namespaces
Return the default options withnamespacesset to the given value- Parameters:
theNamespaces- the namespaces- Returns:
- the options
-
baseIRI
Return the default options with thebase IRIset to the given value- Parameters:
theIRI- the base IRI- Returns:
- the options
-
strict
Return a set of `Options` which correspond to default settings for a strict RDF parsing mode- Returns:
- strict parsing options
-
lax
Return a set of `Options` which correspond to default settings for a strict RDF parsing mode- Returns:
- strict parsing options
-