Class OWLOntologyLoaderConfiguration

java.lang.Object
org.semanticweb.owlapi.model.OWLOntologyLoaderConfiguration
All Implemented Interfaces:
Serializable

public class OWLOntologyLoaderConfiguration extends Object implements 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 Details

    • OWLOntologyLoaderConfiguration

      public OWLOntologyLoaderConfiguration()
  • Method Details

    • addIgnoredImport

      public OWLOntologyLoaderConfiguration addIgnoredImport(IRI ontologyDocumentIRI)
      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

      public OWLOntologyLoaderConfiguration 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

      public boolean isIgnoredImport(IRI iri)
      Parameters:
      iri - iri to check
      Returns:
      true if iri should be ignored
    • removeIgnoredImport

      public OWLOntologyLoaderConfiguration removeIgnoredImport(IRI ontologyDocumentIRI)
      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

      public PriorityCollectionSorting getPriorityCollectionSorting()
      Returns:
      The PriorityCollectionSorting for this configuration. It determines how parsers, storers and mappers are ordered. Default is PriorityCollectionSorting.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

      public OWLOntologyLoaderConfiguration setConnectionTimeout(int l)
      Parameters:
      l - new timeout Note: the timeout is an int and represents milliseconds. This is necessary for use in URLConnection
      Returns:
      A OWLOntologyLoaderConfiguration with the connection timeout set to the new value.
    • getMissingImportHandlingStrategy

      public MissingImportHandlingStrategy 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. See MissingImportHandlingStrategy 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

      public MissingOntologyHeaderStrategy 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

      public OWLOntologyLoaderConfiguration setRetriesToAttempt(int retries)
      Parameters:
      retries - new value of retries to attempt
      Returns:
      copy of this configuration with modified retries attempts.
    • getAuthorizationValue

      public String 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

      public OWLOntologyLoaderConfiguration setAcceptingHTTPCompression(boolean b)
      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

      public OWLOntologyLoaderConfiguration setFollowRedirects(boolean value)
      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 of OWLAnnotationAxiom) should be loaded. By default, the loading of annotation axioms is enabled.
      Returns:
      true if annotation assertions will be loaded, or false if annotation assertions will not be loaded because they will be discarded on loading.
    • setLoadAnnotationAxioms

      public OWLOntologyLoaderConfiguration setLoadAnnotationAxioms(boolean b)
      Specifies whether or not annotation axioms (instances of OWLAnnotationAxiom) 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, or false 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

      public OWLOntologyLoaderConfiguration setStrict(boolean strict)
      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, otherwise false. The default is true.
    • setTreatDublinCoreAsBuiltIn

      public OWLOntologyLoaderConfiguration setTreatDublinCoreAsBuiltIn(boolean value)
      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

      public String getBannedParsers()
      Returns:
      list of parser factory class names that should be skipped when attempting ontology parsing. The list is space separated.
    • setBannedParsers

      public OWLOntologyLoaderConfiguration setBannedParsers(String ban)
      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

      public String getEntityExpansionLimit()
      Returns:
      max number of XML entity expansions to perform while parsing RDF/XML.
    • setEntityExpansionLimit

      public OWLOntologyLoaderConfiguration setEntityExpansionLimit(String limit)
      Parameters:
      limit - maximum number of XML entities to expand.
      Returns:
      An OntologyConfigurator with the new option set.
    • setReportStackTraces

      public OWLOntologyLoaderConfiguration setReportStackTraces(boolean b)
      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

      public OWLOntologyLoaderConfiguration setRepairIllegalPunnings(boolean b)
      Parameters:
      b - if illegal punnings should be repaired
      Returns:
      A OWLOntologyLoaderConfiguration with the repair flag set to the new value.
    • setAuthorizationValue

      public OWLOntologyLoaderConfiguration setAuthorizationValue(String authorizationValue)
      Parameters:
      authorizationValue - Authorization header value.
      Returns:
      An OntologyConfigurator with the new option set.
    • setTrimToSize

      public OWLOntologyLoaderConfiguration setTrimToSize(boolean value)
      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

      public OWLOntologyLoaderConfiguration withSkipModuleAnnotations(boolean value)
      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

      public OWLOntologyLoaderConfiguration withAllowDuplicatesInConstructSets(boolean value)
      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.