com.clarkparsia.modularity
Interface ModuleExtractor

All Known Implementing Classes:
AbstractModuleExtractor, AxiomBasedModuleExtractor

public interface ModuleExtractor

Title:

Description:

Copyright: Copyright (c) 2008

Company: Clark & Parsia, LLC.

Author:
Evren Sirin

Method Summary
 void addAxiom(org.semanticweb.owlapi.model.OWLAxiom axiom)
          Adds an axiom to the extractor.
 void addOntologies(java.util.Set<org.semanticweb.owlapi.model.OWLOntology> ontologies)
          Adds all the axioms from a set of ontologies to the extractor.
 void addOntology(org.semanticweb.owlapi.model.OWLOntology ontology)
          Adds all the axioms of an ontology to the extractor.
 boolean canUpdate()
          Returns if the extracted modules can be updated.
 void deleteAxiom(org.semanticweb.owlapi.model.OWLAxiom axiom)
          Deletes an axiom from the extractor.
 java.util.Set<org.semanticweb.owlapi.model.OWLAxiom> extractModule(java.util.Set<? extends org.semanticweb.owlapi.model.OWLEntity> signature)
          Extract the module for a given set of entities.
 MultiValueMap<org.semanticweb.owlapi.model.OWLEntity,org.semanticweb.owlapi.model.OWLEntity> extractModules()
          Extract modules for all classes from scratch
 org.semanticweb.owlapi.model.OWLOntology getAxiomOntology()
           
 java.util.Set<org.semanticweb.owlapi.model.OWLAxiom> getAxioms()
          Returns all the axioms loaded in the extractor.
 java.util.Set<org.semanticweb.owlapi.model.OWLAxiom> getAxioms(org.semanticweb.owlapi.model.OWLEntity entity)
          Return the axioms which references this entity
 java.util.Set<org.semanticweb.owlapi.model.OWLEntity> getEntities()
          Returns all the entities referenced in loaded axioms.
 org.semanticweb.owlapi.model.OWLOntology getModule(org.semanticweb.owlapi.model.OWLEntity entity)
           
 org.semanticweb.owlapi.model.OWLOntology getModuleFromSignature(java.util.Set<org.semanticweb.owlapi.model.OWLEntity> signature)
          Returns a new ontology that contains the axioms that are in the module for given set of entities
 MultiValueMap<org.semanticweb.owlapi.model.OWLEntity,org.semanticweb.owlapi.model.OWLEntity> getModules()
           
 Timers getTimers()
          Returns the timers used by this extractor to collect statistics about performance.
 boolean isChanged()
          Checks if axioms have been added/removed and modules need to be updated
 boolean isClassificationNeeded(Expressivity expressivity)
          Checks if the changes that has not yet been updated require re-classification
 void load(java.util.zip.ZipInputStream inputStream)
          Restores the previously saved state of the ModuleExtractor from a stream.
 void save(java.util.zip.ZipOutputStream outputStream)
          Save the current state of the ModuleExtractor.
 java.util.Set<org.semanticweb.owlapi.model.OWLEntity> updateModules(Taxonomy<org.semanticweb.owlapi.model.OWLClass> taxonomy, boolean add)
          Update the modules with the changes that have been put into the queue so far.
 

Method Detail

addAxiom

void addAxiom(org.semanticweb.owlapi.model.OWLAxiom axiom)
Adds an axiom to the extractor.

Parameters:
axiom -

addOntologies

void addOntologies(java.util.Set<org.semanticweb.owlapi.model.OWLOntology> ontologies)
Adds all the axioms from a set of ontologies to the extractor.

Parameters:
ontology -

addOntology

void addOntology(org.semanticweb.owlapi.model.OWLOntology ontology)
Adds all the axioms of an ontology to the extractor.

Parameters:
ontology -

canUpdate

boolean canUpdate()
Returns if the extracted modules can be updated. Returns false if the initial module extraction has not been performed yet.

Returns:

deleteAxiom

void deleteAxiom(org.semanticweb.owlapi.model.OWLAxiom axiom)
Deletes an axiom from the extractor.

Parameters:
axiom -

extractModules

MultiValueMap<org.semanticweb.owlapi.model.OWLEntity,org.semanticweb.owlapi.model.OWLEntity> extractModules()
Extract modules for all classes from scratch

Returns:

getModules

MultiValueMap<org.semanticweb.owlapi.model.OWLEntity,org.semanticweb.owlapi.model.OWLEntity> getModules()

getAxioms

java.util.Set<org.semanticweb.owlapi.model.OWLAxiom> getAxioms()
Returns all the axioms loaded in the extractor.

Returns:
an unmodifiable set of axioms

getAxiomOntology

org.semanticweb.owlapi.model.OWLOntology getAxiomOntology()

getAxioms

java.util.Set<org.semanticweb.owlapi.model.OWLAxiom> getAxioms(org.semanticweb.owlapi.model.OWLEntity entity)
Return the axioms which references this entity

Parameters:
entity -
Returns:

getEntities

java.util.Set<org.semanticweb.owlapi.model.OWLEntity> getEntities()
Returns all the entities referenced in loaded axioms.

Returns:
an unmodifiable set of entities

getModule

org.semanticweb.owlapi.model.OWLOntology getModule(org.semanticweb.owlapi.model.OWLEntity entity)

getModuleFromSignature

org.semanticweb.owlapi.model.OWLOntology getModuleFromSignature(java.util.Set<org.semanticweb.owlapi.model.OWLEntity> signature)
Returns a new ontology that contains the axioms that are in the module for given set of entities

Parameters:
signature -
Returns:
Throws:
org.semanticweb.owlapi.model.OWLException

getTimers

Timers getTimers()
Returns the timers used by this extractor to collect statistics about performance.

Returns:

isChanged

boolean isChanged()
Checks if axioms have been added/removed and modules need to be updated

Returns:
true if axioms have been added/removed

isClassificationNeeded

boolean isClassificationNeeded(Expressivity expressivity)
Checks if the changes that has not yet been updated require re-classification

Returns:
true if classification is needed, false otherwise

updateModules

java.util.Set<org.semanticweb.owlapi.model.OWLEntity> updateModules(Taxonomy<org.semanticweb.owlapi.model.OWLClass> taxonomy,
                                                                    boolean add)
                                                                    throws java.lang.UnsupportedOperationException
Update the modules with the changes that have been put into the queue so far.

Parameters:
add - If true apply only addition changes, otherwise apply deletions
Returns:
The set of entities whose modules are affected by the changes
Throws:
java.lang.UnsupportedOperationException - if modules cannot be updated as reported by canUpdate() function

extractModule

java.util.Set<org.semanticweb.owlapi.model.OWLAxiom> extractModule(java.util.Set<? extends org.semanticweb.owlapi.model.OWLEntity> signature)
Extract the module for a given set of entities.

Parameters:
signature - set of entities
Returns:
module for the given signature

save

void save(java.util.zip.ZipOutputStream outputStream)
          throws java.io.IOException,
                 java.lang.IllegalStateException
Save the current state of the ModuleExtractor. The output is saved to a ZipOutputStream to allow storage in multiple files in one stream.

Parameters:
outputStream - the zip output stream where the data should be stored
Throws:
java.io.IOException - if an I/O error occurs during the saving
java.lang.IllegalStateException - if there are outstanding changes that have not yet been applied to the modules (e.g., via updateModules())

load

void load(java.util.zip.ZipInputStream inputStream)
          throws java.io.IOException,
                 java.lang.IllegalArgumentException
Restores the previously saved state of the ModuleExtractor from a stream. The input is read from a ZipInputStream because the data may potentially span multiple files. The method assumes that the zip file entries saved by the save() method are the immediately next ones in the stream.

Parameters:
inputStream - the zip input stream from which the data should be read
Throws:
java.io.IOException - if an I/O error occurs during the read
java.lang.IllegalArgumentException - if the next zip file entry in the stream was not saved by a compatible ModuleExtractor


Copyright © 2004 Evren Sirin. All Rights Reserved.