Class SyntacticLocalityModuleExtractor

java.lang.Object
uk.ac.manchester.cs.owlapi.modularity.SyntacticLocalityModuleExtractor
All Implemented Interfaces:
OntologySegmenter

public class SyntacticLocalityModuleExtractor extends Object implements OntologySegmenter
Implementation of module extraction based on syntactic locality.
Author:
Thomas Schneider, School of Computer Science, University of Manchester
  • 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 ontology
      axs - the subset of the ontology as a set of axioms
      moduleType - 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 ontology
      axs - the subset of the ontology as a set of axioms
      moduleType - the type of module this extractor will construct
      excludeAssertions - 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 ontology
      config - access to configuration
      axs - the subset of the ontology as a set of axioms
      moduleType - the type of module this extractor will construct
      excludeAssertions - 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 ontology
      ont - the associated ontology
      moduleType - the type of module this extractor will construct
  • Method Details

    • getModuleType

      public ModuleType getModuleType()
      Returns the module type for this extractor.
      Returns:
      module type for this extractor
    • setModuleType

      public void setModuleType(ModuleType moduleType)
      Changes the module type for this extractor without deleting the stored referenced entities.
      Parameters:
      moduleType - the new type of module
    • extract

      public Set<OWLAxiom> extract(Set<OWLEntity> signature)
      Description copied from interface: OntologySegmenter
      Returns 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:
      extract in interface OntologySegmenter
      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:
      extract in interface OntologySegmenter
      Parameters:
      sig - the seed signature (set of entities) for the module
      superClassLevel - determines whether superclasses are added to the signature before segment extraction, see below for admissible values
      subClassLevel - 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: OntologySegmenter
      Returns an ontology that is a segment of the ontology associated with this segmenter.
      Specified by:
      extractAsOntology in interface OntologySegmenter
      Parameters:
      signature - the seed signature (set of entities) for the module
      iri - 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: OntologySegmenter
      Returns 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:
      extractAsOntology in interface OntologySegmenter
      Parameters:
      signature - the seed signature
      iri - the URI for the module
      superClassLevel - determines whether superclasses are added to the signature before segment extraction, see below for admissible values
      subClassLevel - determines whether subclasses are added to the signature before segment extraction, see below for admissible values
      reasoner - 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.