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.


Nested Class Summary
protected  class SyntacticLocalityModuleExtractor.OntologyAxiomSet
          Auxiliary inner class for the representation of the associated ontology and all its sub-ontologies as arrays of axioms.
 
Field Summary
protected  OWLOntologyManager manager
          Represents the manager for the associated ontology.
protected  ModuleType moduleType
          Type of module
protected  OWLOntology ontology
           
protected  SyntacticLocalityModuleExtractor.OntologyAxiomSet ontologyAxiomSet
          Represents the associated ontology.
 
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
protected  java.util.Set<OWLAxiom> enrich(java.util.Set<OWLAxiom> module, java.util.Set<OWLEntity> sig, boolean verbose)
          This method enriches a module that contains only logical axioms with all necessary entity declaration axioms, entity annotation axioms, and axiom annotation axioms.
protected  java.util.Set<OWLAxiom> extract(java.util.Set<OWLAxiom> subOnt, java.util.Set<OWLEntity> signature, LocalityClass localityClass, boolean verbose)
          This method extracts a module from a given sub-ontology of the associated ontology for a given signature and locality type.
 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.
protected  java.util.Set<OWLAxiom> extract(java.util.Set<OWLEntity> sig, boolean verbose)
           
 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.
protected  OWLOntology extractAsOntology(java.util.Set<OWLEntity> signature, IRI iri, boolean verbose)
           
protected  boolean[] extractLogicalAxioms(boolean[] subOnt, java.util.Set<OWLEntity> signature, LocalityClass localityClass, boolean verbose)
          This auxiliary method extracts a module from a given sub-ontology of the associated ontology for a given signature and locality type.
protected  java.util.Set<OWLAxiom> extractUnnestedModule(java.util.Set<OWLEntity> sig, LocalityClass cls, boolean verbose)
           
 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
 

Field Detail

moduleType

protected ModuleType moduleType
Type of module


ontologyAxiomSet

protected SyntacticLocalityModuleExtractor.OntologyAxiomSet ontologyAxiomSet
Represents the associated ontology.


ontology

protected OWLOntology ontology

manager

protected OWLOntologyManager manager
Represents the manager for the associated ontology.

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

extractLogicalAxioms

protected boolean[] extractLogicalAxioms(boolean[] subOnt,
                                         java.util.Set<OWLEntity> signature,
                                         LocalityClass localityClass,
                                         boolean verbose)
This auxiliary method extracts a module from a given sub-ontology of the associated ontology for a given signature and locality type. The module will contain only logical axioms, no annotation or declaration axioms. The sub-ontology and module are represented as arrays of Booleans.

This method is (if necessary, iteratively) called by the public method extract.

Parameters:
subOnt - an array of Booleans representing the sub-ontology
signature - the seed signature (set of entities) for the module; on return of the method, this will contain the signature of the module
localityClass - the type of locality
verbose - a flag for verbose output (test purposes)
Returns:
an array of Booleans representing the module

extract

protected java.util.Set<OWLAxiom> extract(java.util.Set<OWLAxiom> subOnt,
                                          java.util.Set<OWLEntity> signature,
                                          LocalityClass localityClass,
                                          boolean verbose)
This method extracts a module from a given sub-ontology of the associated ontology for a given signature and locality type. The module will only contain logical axioms, no annotation or declaration axioms. The sub-ontology and module are represented as sets of axioms.

Parameters:
subOnt - a set of axioms representing the sub-ontology
signature - the seed signature (set of entities) for the module; on return of the method, this will contain the signature of the module
localityClass - the type of locality
verbose - a flag for verbose output (test purposes)
Returns:
a set of axioms representing the module

enrich

protected java.util.Set<OWLAxiom> enrich(java.util.Set<OWLAxiom> module,
                                         java.util.Set<OWLEntity> sig,
                                         boolean verbose)
This method enriches a module that contains only logical axioms with all necessary entity declaration axioms, entity annotation axioms, and axiom annotation axioms. The module and enriched module are represented as sets of axioms.

Parameters:
module - a set of axioms representing the original module
sig - a set of entities representing the signature of the original module
verbose - a flag for verbose output (test purposes)
Returns:
a set of axioms representing the enriched module

extractUnnestedModule

protected java.util.Set<OWLAxiom> extractUnnestedModule(java.util.Set<OWLEntity> sig,
                                                        LocalityClass cls,
                                                        boolean verbose)

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

protected java.util.Set<OWLAxiom> extract(java.util.Set<OWLEntity> sig,
                                          boolean verbose)

extractAsOntology

public OWLOntology extractAsOntology(java.util.Set<OWLEntity> signature,
                                     IRI iri)
                              throws OWLOntologyCreationException,
                                     OWLOntologyChangeException
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

protected OWLOntology extractAsOntology(java.util.Set<OWLEntity> signature,
                                        IRI iri,
                                        boolean verbose)
                                 throws OWLOntologyCreationException,
                                        OWLOntologyChangeException
Throws:
OWLOntologyCreationException
OWLOntologyChangeException