uk.ac.manchester.cs.owlapi.modularity
Class SyntacticLocalityModuleExtractor

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

public class SyntacticLocalityModuleExtractor
extends java.lang.Object
implements OntologySegmenter

Implementation of module extraction based on syntactic locality.

Author:
Thomas Schneider, School of Computer Science, University of Manchester

Constructor Summary
SyntacticLocalityModuleExtractor(OWLOntologyManager man, OWLOntology ont, ModuleType moduleType)
          Creates a new module extractor for a given ontology, its manager, and a specified type of locality.
SyntacticLocalityModuleExtractor(OWLOntologyManager man, OWLOntology ont, java.util.Set<OWLAxiom> axs, ModuleType moduleType)
          Creates a new module extractor for a subset of a given ontology, its manager, and a specified type of locality.
 
Method Summary
 java.util.Set<OWLAxiom> extract(java.util.Set<OWLEntity> sig)
          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.
 java.util.Set<OWLAxiom> extract(java.util.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.
 OWLOntology extractAsOntology(java.util.Set<OWLEntity> signature, IRI iri)
          Extracts a module from the associated ontology for a given signature and the associated module type, and returns the module as an ontology.
 OWLOntology extractAsOntology(java.util.Set<OWLEntity> signature, IRI iri, 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 an ontology.
 ModuleType getModuleType()
          Returns the module type for this extractor.
 void setModuleType(ModuleType moduleType)
          Changes the module type for this extractor without deleting the stored referenced entities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyntacticLocalityModuleExtractor

public SyntacticLocalityModuleExtractor(OWLOntologyManager man,
                                        OWLOntology ont,
                                        java.util.Set<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
ont - 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,
                                        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 Detail

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

getModuleType

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

Returns:
module type for this extractor

extract

public java.util.Set<OWLAxiom> extract(java.util.Set<OWLEntity> sig)
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 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
Returns:
the module

extract

public java.util.Set<OWLAxiom> extract(java.util.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. 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 > 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 < 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.
Returns:
the module

extractAsOntology

public OWLOntology extractAsOntology(java.util.Set<OWLEntity> signature,
                                     IRI iri)
                              throws OWLOntologyCreationException
Extracts a module from the associated ontology for a given signature and the associated module type, and returns the module as an ontology.

Specified by:
extractAsOntology in interface OntologySegmenter
Parameters:
signature - the seed signature (set of entities) for the module
iri - the IRI for the module
Returns:
the module, having the specified IRI
Throws:
OWLOntologyChangeException - if adding axioms to the module fails
OWLOntologyCreationException - if the module cannot be created

extractAsOntology

public OWLOntology extractAsOntology(java.util.Set<OWLEntity> signature,
                                     IRI iri,
                                     int superClassLevel,
                                     int subClassLevel,
                                     OWLReasoner reasoner)
                              throws OWLOntologyCreationException
Extracts a module from the associated ontology for a given signature and the associated module type, and returns the module as an ontology. 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:
extractAsOntology in interface OntologySegmenter
Parameters:
signature - the seed signature (set of entities) for the module
iri - the IRI 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 > 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 < 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.
Returns:
the module, having the specified IRI
Throws:
OWLOntologyChangeException - if adding axioms to the module fails
OWLOntologyCreationException - if the module cannot be created