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 TypeMethodDescriptionReturn the axioms all modules of this ModuleExtractor are computed against, including global axioms and tautologies.default boolean
containsAxiom
(OWLAxiom axiom) Returns whether the axiom base of this ModuleExtractor contains the givenOWLAxiom
.default boolean
everyModuleContains
(OWLAxiom axiom) Returnstrue
if it is guaranteed that the givenOWLAxiom
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).Extracts a module with respect to the given signature against the axiom base of this ModuleExtractor.Extracts a module with respect to the given signature against the subset of the axiom base this ModuleExtractor's axiom base that matches the givenPredicate
.Extracts a module with respect to the given signature against the subset of the axiom base this ModuleExtractor's axiom base that matches the givenPredicate
, if any.default OWLOntology
extractAsOntology
(Stream<OWLEntity> signature, OWLOntologyManager ontologyManager, IRI ontologyIRI) Extracts a module as anOWLOntology
with respect to the given signature over the given axiom base.globals()
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
noModuleContains
(OWLAxiom axiom) Returnstrue
if it is guaranteed that the givenOWLAxiom
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).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
Return the axioms all modules of this ModuleExtractor are computed against, including global axioms and tautologies.- Returns:
- The axioms as specified above
-
containsAxiom
Returns whether the axiom base of this ModuleExtractor contains the givenOWLAxiom
.- Parameters:
axiom
- The axiom to test- Returns:
- A boolean value as specified above
-
everyModuleContains
Returnstrue
if it is guaranteed that the givenOWLAxiom
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 returningtrue
implies thatnoModuleContains(OWLAxiom)
returnsfalse
for the same axiom.- Parameters:
axiom
- TheOWLAxiom
to check- Returns:
- A boolean value as specified above
-
extract
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 givenPredicate
, if any.- Parameters:
signature
- The signature the module should be extracted against.axiomFilter
- AnOptional
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
withLocalityClass.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 givenPredicate
.- Parameters:
signature
- The signature the module should be extracted against.axiomFilter
- APredicate
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
withLocalityClass.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 anOWLOntology
with respect to the given signature over the given axiom base.- Parameters:
signature
- The signature the module should be extracted againstontologyManager
- TheOWLOntologyManager
used to create the newOWLOntology
ontologyIRI
- TheIRI
of the newOWLOntology
- Returns:
- The module as an
OWLOntology
- Throws:
OWLOntologyCreationException
- If there is an exception when creating theOWLOntology
-
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
Returnstrue
if it is guaranteed that the givenOWLAxiom
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 returningtrue
implies thateveryModuleContains(OWLAxiom)
returnsfalse
for the same axiom.- Parameters:
axiom
- TheOWLAxiom
to check- Returns:
- A boolean value as specified above
-
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
-