Interface ModuleExtractor

All Known Implementing Classes:
AbstractModuleExtractor, LocalityModuleExtractor, SemanticLocalityModuleExtractor, SyntacticLocalityModuleExtractor

public interface ModuleExtractor
Interface for classes that extract modules based on fixed axiom bases. Implementations of this interface may use pre-computation to optimize calculating multiple modules for the same axiom base but for differing signatures.
Author:
Marc Robin Nolte
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the axioms all modules of this ModuleExtractor are computed against, including global axioms and tautologies.
    default boolean
    Returns whether the axiom base of this ModuleExtractor contains the given OWLAxiom.
    default boolean
    Returns true if it is guaranteed that the given OWLAxiom is contained in every module calculated by the module extraction method this ModuleExtractor is based on; false when no such guarantee can be made (Note: This does not mean that there is some module regardless of other axioms or the signature that does not contain the given axiom).
    default Stream<OWLAxiom>
    extract(Stream<OWLEntity> signature)
    Extracts a module with respect to the given signature against the axiom base of this ModuleExtractor.
    default Stream<OWLAxiom>
    extract(Stream<OWLEntity> signature, Predicate<OWLAxiom> axiomFilter)
    Extracts a module with respect to the given signature against the subset of the axiom base this ModuleExtractor's axiom base that matches the given Predicate.
    extract(Stream<OWLEntity> signature, Optional<Predicate<OWLAxiom>> axiomFilter)
    Extracts a module with respect to the given signature against the subset of the axiom base this ModuleExtractor's axiom base that matches the given Predicate, if any.
    default OWLOntology
    extractAsOntology(Stream<OWLEntity> signature, OWLOntologyManager ontologyManager, IRI ontologyIRI)
    Extracts a module as an OWLOntology with respect to the given signature over the given axiom base.
    default Stream<OWLAxiom>
    Returns from the axiom base of this extractor exactly those that are guaranteed to be contained in every module calculated by this ModuleExtractor.
    default boolean
    Returns true if it is guaranteed that the given OWLAxiom is not contained in any module (regardless of other axioms or the signature) calculated by the module extraction method this ModuleExtractor is based on; false when no such guarantee can be made (Note: This does not mean that there is some module that contains the given axiom).
    default Stream<OWLAxiom>
    Returns from the axiom base of this extractor exactly those that are guaranteed not to be contained in any module calculated by this ModuleExtractor.
  • Method Details

    • axiomBase

      @Nonnull Stream<OWLAxiom> axiomBase()
      Return the axioms all modules of this ModuleExtractor are computed against, including global axioms and tautologies.
      Returns:
      The axioms as specified above
    • containsAxiom

      default boolean containsAxiom(OWLAxiom axiom)
      Returns whether the axiom base of this ModuleExtractor contains the given OWLAxiom.
      Parameters:
      axiom - The axiom to test
      Returns:
      A boolean value as specified above
    • everyModuleContains

      default boolean everyModuleContains(OWLAxiom axiom)
      Returns true if it is guaranteed that the given OWLAxiom is contained in every module calculated by the module extraction method this ModuleExtractor is based on; false when no such guarantee can be made (Note: This does not mean that there is some module regardless of other axioms or the signature that does not contain the given axiom). This methods returning true implies that noModuleContains(OWLAxiom) returns false for the same axiom.
      Parameters:
      axiom - The OWLAxiom to check
      Returns:
      A boolean value as specified above
    • extract

      @Nonnull default Stream<OWLAxiom> extract(Stream<OWLEntity> signature)
      Extracts a module with respect to the given signature against the axiom base of this ModuleExtractor.
      Parameters:
      signature - The signature the module should be extracted against
      Returns:
      The axioms of the module with respect to the given signature
    • extract

      @Nonnull Stream<OWLAxiom> extract(Stream<OWLEntity> signature, Optional<Predicate<OWLAxiom>> axiomFilter)
      Extracts a module with respect to the given signature against the subset of the axiom base this ModuleExtractor's axiom base that matches the given Predicate, if any.
      Parameters:
      signature - The signature the module should be extracted against.
      axiomFilter - An Optional Predicate that filters a subset of the axiom base to extract the module against. Note that ignoring some axiom may lead to other axioms not be contained in the module either. For example, consider the Ontology O:= {A⊑B, B⊑C, C⊑D} and the signature {A}. SyntacticLocalityEvaluator with LocalityClass.BOTTOM returns O as a whole, but when ignoring the axiom B⊑C it only returns {A⊑B}.
      Returns:
      The axioms of the module with respect to the given signature
    • extract

      @Nonnull default Stream<OWLAxiom> extract(Stream<OWLEntity> signature, Predicate<OWLAxiom> axiomFilter)
      Extracts a module with respect to the given signature against the subset of the axiom base this ModuleExtractor's axiom base that matches the given Predicate.
      Parameters:
      signature - The signature the module should be extracted against.
      axiomFilter - A Predicate that filters a subset of the axiom base to extract the module against. Note that ignoring some axiom may lead to other axioms not be contained in the module either. For example, consider the ontology O:= {A⊑B, B⊑C, C⊑D} and the signature {A,E}. SyntacticLocalityEvaluator with LocalityClass.BOTTOM returns O as a whole, but when ignoring the axiom B⊑C, it will only return {A⊑B}.
      Returns:
      The axioms of the module with respect to the given signature
    • extractAsOntology

      @Nonnull default OWLOntology extractAsOntology(Stream<OWLEntity> signature, OWLOntologyManager ontologyManager, IRI ontologyIRI) throws OWLOntologyCreationException
      Extracts a module as an OWLOntology with respect to the given signature over the given axiom base.
      Parameters:
      signature - The signature the module should be extracted against
      ontologyManager - The OWLOntologyManager used to create the new OWLOntology
      ontologyIRI - The IRI of the new OWLOntology
      Returns:
      The module as an OWLOntology
      Throws:
      OWLOntologyCreationException - If there is an exception when creating the OWLOntology
    • globals

      @Nonnull default Stream<OWLAxiom> globals()
      Returns from the axiom base of this extractor exactly those that are guaranteed to be contained in every module calculated by this ModuleExtractor. These axioms may be precomputed or calculated on every call of this method.
      Returns:
      The axioms as specified above
    • noModuleContains

      default boolean noModuleContains(OWLAxiom axiom)
      Returns true if it is guaranteed that the given OWLAxiom is not contained in any module (regardless of other axioms or the signature) calculated by the module extraction method this ModuleExtractor is based on; false when no such guarantee can be made (Note: This does not mean that there is some module that contains the given axiom). This methods returning true implies that everyModuleContains(OWLAxiom) returns false for the same axiom.
      Parameters:
      axiom - The OWLAxiom to check
      Returns:
      A boolean value as specified above
    • tautologies

      @Nonnull default Stream<OWLAxiom> tautologies()
      Returns from the axiom base of this extractor exactly those that are guaranteed not to be contained in any module calculated by this ModuleExtractor. These axioms may be precomputed or calculated on every call of this method.
      Returns:
      The axioms as specified above