Package org.semanticweb.owlapi.model
Class OWLOntologyLoaderConfiguration
java.lang.Object
org.semanticweb.owlapi.model.OWLOntologyLoaderConfiguration
- All Implemented Interfaces:
Serializable
A configuration object that specifies options and hints to objects that load
OWLOntology
instances. Every OWLOntologyLoaderConfiguration
is immutable. Changing a setting results
in the creation of a new OWLOntologyLoaderConfiguration
with that setting. For example,
OWLOntologyLoaderConfiguration config = new OWLOntologyLoaderConfiguration(); config = config.setLoadAnnotationAxioms(false);creates an
OWLOntologyLoaderConfiguration
object with the load annotation axioms set to
false
.- Since:
- 3.2.0
- Author:
- Matthew Horridge, The University of Manchester, Bio-Health Informatics Group
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddIgnoredImport
(IRI ontologyDocumentIRI) Adds an ontology document IRI to the list of ontology imports that will be ignored during ontology loading.Clears all ontology document IRIs from the list of ignored ontology document IRIs.int
Gets the strategy used for missing imports.int
boolean
boolean
When loading an ontology, a parser might connect to a remote URL.boolean
isIgnoredImport
(IRI iri) boolean
Determines whether or not annotation axioms (instances ofOWLAnnotationAxiom
) should be loaded.boolean
boolean
isStrict()
boolean
Determines if the various parsers, for formats such as RDF based formats that do not require strong typing, should treat Dublin Core Vocabulary as built in vocabulary, so that Dublin Core metadata properties are interpreted as annotation properties.removeIgnoredImport
(IRI ontologyDocumentIRI) Removes an ontology document IRI from the list of ontology imports that will be ignored during ontology loading.setAcceptingHTTPCompression
(boolean b) setAuthorizationValue
(String authorizationValue) setBannedParsers
(String ban) setConnectionTimeout
(int l) setEntityExpansionLimit
(String limit) setFollowRedirects
(boolean value) setLoadAnnotationAxioms
(boolean b) Specifies whether or not annotation axioms (instances ofOWLAnnotationAxiom
) should be loaded or whether they should be discarded on loading.setMissingImportHandlingStrategy
(MissingImportHandlingStrategy missingImportHandlingStrategy) Sets the strategy that is used for missing imports handling.setMissingOntologyHeaderStrategy
(MissingOntologyHeaderStrategy missingOntologyHeaderStrategy) Set the priority collection sorting option.setRepairIllegalPunnings
(boolean b) setReportStackTraces
(boolean b) Set the value for the report stack traces flag.setRetriesToAttempt
(int retries) setStrict
(boolean strict) setTreatDublinCoreAsBuiltIn
(boolean value) setTrimToSize
(boolean value) boolean
boolean
boolean
boolean
withAllowDuplicatesInConstructSets
(boolean value) withSkipModuleAnnotations
(boolean value)
-
Constructor Details
-
OWLOntologyLoaderConfiguration
public OWLOntologyLoaderConfiguration()
-
-
Method Details
-
addIgnoredImport
Adds an ontology document IRI to the list of ontology imports that will be ignored during ontology loading.- Parameters:
ontologyDocumentIRI
- The ontology document IRI that will be ignored if it is encountered as an imported ontology during loading.- Returns:
- An
OWLOntologyLoaderConfiguration
with the ignored ontology document IRI set.
-
clearIgnoredImports
Clears all ontology document IRIs from the list of ignored ontology document IRIs.- Returns:
- An
OWLOntologyLoaderConfiguration
with the list of ignored ontology document IRIs set to be empty.
-
isIgnoredImport
- Parameters:
iri
- iri to check- Returns:
- true if iri should be ignored
-
removeIgnoredImport
Removes an ontology document IRI from the list of ontology imports that will be ignored during ontology loading.- Parameters:
ontologyDocumentIRI
- The ontology document IRI that would be ignored if it is encountered as an imported ontology during loading.- Returns:
- An
OWLOntologyLoaderConfiguration
with the ignored ontology document IRI removed.
-
getPriorityCollectionSorting
- Returns:
- The
PriorityCollectionSorting
for this configuration. It determines how parsers, storers and mappers are ordered. Default isPriorityCollectionSorting.ON_SET_INJECTION_ONLY
-
setPriorityCollectionSorting
public OWLOntologyLoaderConfiguration setPriorityCollectionSorting(PriorityCollectionSorting sorting) Set the priority collection sorting option.- Parameters:
sorting
- the sorting option to be used.- Returns:
- An
OWLOntologyLoaderConfiguration
with the new sorting option set.
-
getConnectionTimeout
public int getConnectionTimeout()- Returns:
- the connection timeout for this configuration
-
setConnectionTimeout
- Parameters:
l
- new timeout Note: the timeout is an int and represents milliseconds. This is necessary for use inURLConnection
- Returns:
- A
OWLOntologyLoaderConfiguration
with the connection timeout set to the new value.
-
getMissingImportHandlingStrategy
Gets the strategy used for missing imports.- Returns:
- The strategy. See
MissingImportHandlingStrategy
for the strategies and their descriptions. - Since:
- 3.3
-
setMissingImportHandlingStrategy
public OWLOntologyLoaderConfiguration setMissingImportHandlingStrategy(MissingImportHandlingStrategy missingImportHandlingStrategy) Sets the strategy that is used for missing imports handling. SeeMissingImportHandlingStrategy
for the strategies and their descriptions.- Parameters:
missingImportHandlingStrategy
- The strategy to be used.- Returns:
- An
OWLOntologyLoaderConfiguration
object with the strategy set. - Since:
- 3.3
-
getMissingOntologyHeaderStrategy
- Returns:
- the ontology header strategy
-
setMissingOntologyHeaderStrategy
public OWLOntologyLoaderConfiguration setMissingOntologyHeaderStrategy(MissingOntologyHeaderStrategy missingOntologyHeaderStrategy) - Parameters:
missingOntologyHeaderStrategy
- new value- Returns:
- a copy of this configuration object with a different strategy
-
getRetriesToAttempt
public int getRetriesToAttempt()- Returns:
- number of retries to attempt when retrieving an ontology form a remote URL.
-
setRetriesToAttempt
- Parameters:
retries
- new value of retries to attempt- Returns:
- copy of this configuration with modified retries attempts.
-
getAuthorizationValue
- Returns:
- authorization header value
-
isAcceptingHTTPCompression
public boolean isAcceptingHTTPCompression()- Returns:
- true if http compression should be accepted.
-
shouldTrimToSize
public boolean shouldTrimToSize()- Returns:
- true if ontology should be trimmed to size after load
-
setAcceptingHTTPCompression
- Parameters:
b
- true if HTTP compression should be accepted- Returns:
- a copy of this configuration with accepting HTTP compression set to the new value
-
isFollowRedirects
public boolean isFollowRedirects()When loading an ontology, a parser might connect to a remote URL. If the remote URL is a 302 redirect and the protocol is different, e.g., http to https, the parser needs to decide whether to follow the redirect and download the ontology from an alternate source, or stop with an UnloadableOntologyError. By default this is true, meaning redirects will be followed across protocols. If set to false, redirects will be followed only within the same protocol (URLConnection limits this to five redirects).- Returns:
- true if redirects should be followed when importing ontologies from remote URLs
-
setFollowRedirects
- Parameters:
value
- true if redirects should be followed across protocols, false otherwise.- Returns:
- a copy of the current object with follow redirects set to the new value.
-
isLoadAnnotationAxioms
public boolean isLoadAnnotationAxioms()Determines whether or not annotation axioms (instances ofOWLAnnotationAxiom
) should be loaded. By default, the loading of annotation axioms is enabled.- Returns:
true
if annotation assertions will be loaded, orfalse
if annotation assertions will not be loaded because they will be discarded on loading.
-
setLoadAnnotationAxioms
Specifies whether or not annotation axioms (instances ofOWLAnnotationAxiom
) should be loaded or whether they should be discarded on loading. By default, the loading of annotation axioms is enabled.- Parameters:
b
-true
if annotation axioms should be loaded, orfalse
if annotation axioms should not be loaded and should be discarded on loading.- Returns:
- An
OWLOntologyLoaderConfiguration
object with the option set.
-
isReportStackTrace
public boolean isReportStackTrace()- Returns:
- value for the report stack trace flag.
-
isStrict
public boolean isStrict()- Returns:
- true if parsing should be strict
-
shouldRepairIllegalPunnings
public boolean shouldRepairIllegalPunnings()- Returns:
- true if illegal punnings should be repaired
-
setStrict
- Parameters:
strict
- new value for strict- Returns:
- copy of the configuration with new strict value
-
isTreatDublinCoreAsBuiltIn
public boolean isTreatDublinCoreAsBuiltIn()Determines if the various parsers, for formats such as RDF based formats that do not require strong typing, should treat Dublin Core Vocabulary as built in vocabulary, so that Dublin Core metadata properties are interpreted as annotation properties.- Returns:
true
if the Dublin Core Vocabulary should be treated as built in vocabulary and Dublin Core properties are interpreted as annotation properties, otherwisefalse
. The default istrue
.
-
setTreatDublinCoreAsBuiltIn
- Parameters:
value
- true if Dublin Core vocabulary should be treated as built in.- Returns:
- a copy of the current object with treat dublin core as builtIn set to the new value.
-
getBannedParsers
- Returns:
- list of parser factory class names that should be skipped when attempting ontology parsing. The list is space separated.
-
setBannedParsers
- Parameters:
ban
- list of parser factory class names that should be skipped when attempting ontology parsing. The list is space separated.- Returns:
- An
OntologyConfigurator
with the new option set.
-
getEntityExpansionLimit
- Returns:
- max number of XML entity expansions to perform while parsing RDF/XML.
-
setEntityExpansionLimit
- Parameters:
limit
- maximum number of XML entities to expand.- Returns:
- An
OntologyConfigurator
with the new option set.
-
setReportStackTraces
Set the value for the report stack traces flag. If true, parsing exceptions will have the full stack trace for the source exceptions. Default is false.- Parameters:
b
- the new value for the flag- Returns:
- A
OWLOntologyLoaderConfiguration
with the report flag set to the new value.
-
setRepairIllegalPunnings
- Parameters:
b
- if illegal punnings should be repaired- Returns:
- A
OWLOntologyLoaderConfiguration
with the repair flag set to the new value.
-
setAuthorizationValue
- Parameters:
authorizationValue
- Authorization header value.- Returns:
- An
OntologyConfigurator
with the new option set.
-
setTrimToSize
- Parameters:
value
- new value for trim to size- Returns:
- An
OntologyConfigurator
with the new option set.
-
shouldSkipModuleAnnotations
public boolean shouldSkipModuleAnnotations()- Returns:
- true if module extraction should not add annotation axioms to the module.
-
withSkipModuleAnnotations
- Parameters:
value
- true if annotation axioms should not be added to modules- Returns:
- A
OWLOntologyLoaderConfiguration
with the annotation axioms flag set to the new value.
-
shouldAllowDuplicatesInConstructSets
public boolean shouldAllowDuplicatesInConstructSets()- Returns:
- false if collections used in constructs such as equivalent classes and properties
should be duplicate free. Some systems might need to allow this, e.g., reasoners
which require the creation of a tautology like
Equivalent(A, A)
.
-
withAllowDuplicatesInConstructSets
- Parameters:
value
- false if collections used in constructs such as equivalent classes and properties should be duplicate free.- Returns:
- A
OWLOntologyLoaderConfiguration
with the allow duplicates flag set to the new value.
-