Class SyntacticLocalityModuleExtractor
java.lang.Object
uk.ac.manchester.cs.owlapi.modularity.SyntacticLocalityModuleExtractor
- All Implemented Interfaces:
OntologySegmenter
Implementation of module extraction based on syntactic locality.
- Author:
- Thomas Schneider, School of Computer Science, University of Manchester
-
Constructor Summary
ConstructorsConstructorDescriptionSyntacticLocalityModuleExtractor(OWLOntologyManager man, Stream<OWLAxiom> axs, ModuleType moduleType) Creates a new module extractor for a subset of a given ontology, its manager, and a specified type of locality.SyntacticLocalityModuleExtractor(OWLOntologyManager man, Stream<OWLAxiom> axs, ModuleType moduleType, boolean excludeAssertions) Creates a new module extractor for a subset of a given ontology, its manager, and a specified type of locality.SyntacticLocalityModuleExtractor(OWLOntologyManager man, OWLOntologyLoaderConfiguration config, Stream<OWLAxiom> axs, ModuleType moduleType, boolean excludeAssertions) Creates a new module extractor for a subset of a given ontology, its manager, and a specified type of locality.SyntacticLocalityModuleExtractor(OWLOntologyManager man, OWLOntology ont, ModuleType moduleType) Creates a new module extractor for a given ontology, its manager, and a specified type of locality. -
Method Summary
Modifier and TypeMethodDescriptionReturns a set of axioms that is a segment of the ontology associated with this segmenter.extract(Set<OWLEntity> sig, int superClassLevel, int subClassLevel, OWLReasoner reasoner) Extracts a module from the associated ontology for a given signature and the associated module type, and returns the module as a set of axioms.extractAsOntology(Set<OWLEntity> signature, IRI iri) Returns an ontology that is a segment of the ontology associated with this segmenter.extractAsOntology(Set<OWLEntity> signature, IRI iri, int superClassLevel, int subClassLevel, OWLReasoner reasoner) Returns an ontology that is a segment of the ontology associated with this segmenter.Returns the module type for this extractor.voidsetModuleType(ModuleType moduleType) Changes the module type for this extractor without deleting the stored referenced entities.
-
Constructor Details
-
SyntacticLocalityModuleExtractor
public SyntacticLocalityModuleExtractor(OWLOntologyManager man, Stream<OWLAxiom> axs, ModuleType moduleType) Creates a new module extractor for a subset of a given ontology, its manager, and a specified type of locality.- Parameters:
man- the manager for the associated ontologyaxs- the subset of the ontology as a set of axiomsmoduleType- the type of module this extractor will construct
-
SyntacticLocalityModuleExtractor
public SyntacticLocalityModuleExtractor(OWLOntologyManager man, Stream<OWLAxiom> axs, ModuleType moduleType, boolean excludeAssertions) Creates a new module extractor for a subset of a given ontology, its manager, and a specified type of locality.- Parameters:
man- the manager for the associated ontologyaxs- the subset of the ontology as a set of axiomsmoduleType- the type of module this extractor will constructexcludeAssertions- true if assertions should be excluded
-
SyntacticLocalityModuleExtractor
public SyntacticLocalityModuleExtractor(OWLOntologyManager man, OWLOntologyLoaderConfiguration config, Stream<OWLAxiom> axs, ModuleType moduleType, boolean excludeAssertions) Creates a new module extractor for a subset of a given ontology, its manager, and a specified type of locality.- Parameters:
man- the manager for the associated ontologyconfig- access to configurationaxs- the subset of the ontology as a set of axiomsmoduleType- the type of module this extractor will constructexcludeAssertions- true if assertions should be excluded
-
SyntacticLocalityModuleExtractor
public SyntacticLocalityModuleExtractor(OWLOntologyManager man, OWLOntology ont, ModuleType moduleType) Creates a new module extractor for a given ontology, its manager, and a specified type of locality.- Parameters:
man- the manager for the associated ontologyont- the associated ontologymoduleType- the type of module this extractor will construct
-
-
Method Details
-
getModuleType
Returns the module type for this extractor.- Returns:
- module type for this extractor
-
setModuleType
Changes the module type for this extractor without deleting the stored referenced entities.- Parameters:
moduleType- the new type of module
-
extract
Description copied from interface:OntologySegmenterReturns a set of axioms that is a segment of the ontology associated with this segmenter. This segment is determined by the specified seed signature (set of entities).- Specified by:
extractin interfaceOntologySegmenter- Parameters:
signature- the seed signature- Returns:
- the segment as a set of axioms
-
extract
public Set<OWLAxiom> extract(Set<OWLEntity> sig, int superClassLevel, int subClassLevel, @Nullable OWLReasoner reasoner) Extracts a module from the associated ontology for a given signature and the associated module type, and returns the module as a set of axioms. The seed signature (set of entities) which determines the module is the specified signature plus possibly all superclasses and/or subclasses of the classes therein. Sub-/superclasses are determined using the specified reasoner. The module will include annotation and declaration axioms for all entities and axioms in it.- Specified by:
extractin interfaceOntologySegmenter- Parameters:
sig- the seed signature (set of entities) for the modulesuperClassLevel- determines whether superclasses are added to the signature before segment extraction, see below for admissible valuessubClassLevel- determines whether subclasses are added to the signature before segment extraction
Admissible values for superClassLevel (analogously for subClassLevel):- If superClassLevel greater than 0, then all classes C are included for which the class hierarchy computed by the reasoner contains a path of length at most superClassLevel downwards from C to some class from the signature.
- If superClassLevel = 0, then no super-/subclasses are added.
- If superClassLevel lesser than 0, then all direct and indirect super-/subclasses of any class in the signature are added.
reasoner- the reasoner to determine super-/subclasses. This can be an arbitrary reasoner, including a ToldClassHierarchyReasoner. It must have loaded the ontology. Can be null if superClassLevel and subClassLevel are 0.- Returns:
- the module
-
extractAsOntology
public OWLOntology extractAsOntology(Set<OWLEntity> signature, IRI iri) throws OWLOntologyCreationException Description copied from interface:OntologySegmenterReturns an ontology that is a segment of the ontology associated with this segmenter.- Specified by:
extractAsOntologyin interfaceOntologySegmenter- Parameters:
signature- the seed signature (set of entities) for the moduleiri- the URI for the module- Returns:
- the module, having the specified URI
- Throws:
OWLOntologyCreationException- if the module cannot be created
-
extractAsOntology
public OWLOntology extractAsOntology(Set<OWLEntity> signature, IRI iri, int superClassLevel, int subClassLevel, @Nullable OWLReasoner reasoner) throws OWLOntologyCreationException Description copied from interface:OntologySegmenterReturns an ontology that is a segment of the ontology associated with this segmenter. This segment is determined by a seed signature (set of entities), which is the specified signature plus possibly all superclasses and/or subclasses of the classes therein. Sub-/superclasses are determined using the specified reasoner.- Specified by:
extractAsOntologyin interfaceOntologySegmenter- Parameters:
signature- the seed signatureiri- the URI for the modulesuperClassLevel- determines whether superclasses are added to the signature before segment extraction, see below for admissible valuessubClassLevel- determines whether subclasses are added to the signature before segment extraction, see below for admissible valuesreasoner- the reasoner to determine super-/subclasses- Returns:
- the segment as a set of axioms
- Throws:
OWLOntologyCreationException- if the module cannot be created Meaning of the value of superClassLevel, subClassLevel:
Let this value be k. If k greater than 0, then all classes are included that are (direct or indirect) super-/subclasses of some class in signature, with a distance of at most k to this class in the class hierarchy computed by reasoner. If k = 0, then no super-/subclasses are added. If k lesser than 0, then all direct and indirect super-/subclasses of any class in the signature are added.
-