org.semanticweb.owlapi.model
Interface OWLOntologyManager

All Superinterfaces:
OWLOntologySetProvider
All Known Implementing Classes:
OWLOntologyManagerImpl

public interface OWLOntologyManager
extends OWLOntologySetProvider

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group Date: 24-Oct-2006 The OWLOntologyManager manages a set of ontologies. It is the main point for creating, loading and accessing ontologies.


Method Summary
 java.util.List<OWLOntologyChange> addAxiom(OWLOntology ont, OWLAxiom axiom)
          A convenience method that adds a single axioms to an ontology.
 java.util.List<OWLOntologyChange> addAxioms(OWLOntology ont, java.util.Set<? extends OWLAxiom> axioms)
          A convenience method that adds a set of axioms to an ontology.
 void addIRIMapper(OWLOntologyIRIMapper mapper)
          Adds a mapper to this manager.
 void addMissingImportListener(MissingImportListener listener)
          In the case where silent missing imports handling is enabled, a listener can be attached via this method so that there is a mechanism that allows clients to be informed of the reason when an import cannot be loaded.
 void addOntologyChangeListener(OWLOntologyChangeListener listener)
          Adds an ontology change listener, which listens to all changes for all ontologies.
 void addOntologyChangeListener(OWLOntologyChangeListener listener, OWLOntologyChangeBroadcastStrategy strategy)
          Adds an ontology change listener, which listens to ontology changes.
 void addOntologyChangeProgessListener(OWLOntologyChangeProgressListener listener)
           
 void addOntologyFactory(OWLOntologyFactory factory)
          Adds an ontology factory that is capable of creating an ontology given a particular physical IRI.
 void addOntologyLoaderListener(OWLOntologyLoaderListener listener)
           
 void addOntologyStorer(OWLOntologyStorer storer)
          Add an ontology storer.
 java.util.List<OWLOntologyChange> applyChange(OWLOntologyChange change)
          A convenience method that applies just one change to an ontology that is managed by this manager.
 java.util.List<OWLOntologyChange> applyChanges(java.util.List<? extends OWLOntologyChange> changes)
          Applies a list of changes to some or all of the ontologies that are managed by this manager.
 void clearIRIMappers()
          Clears any installed IRI mappers
 boolean contains(IRI ontologyIRI)
          Determines if there is an ontology with the specified IRI, and no version IRI, that is managed by this manager
 boolean contains(OWLOntologyID id)
          Determines if there is an ontology with the specified id that is managed by this manager
 OWLOntology createOntology()
          Creates a new (empty) ontology that does not have an ontology IRI (and therefore does not have a version IRI)
 OWLOntology createOntology(IRI ontologyIRI)
          Creates a new (empty) ontology that has the specified ontology IRI (and no version IRI)
 OWLOntology createOntology(IRI ontologyIRI, java.util.Set<OWLOntology> ontologies)
          Creates a new ontology that has the specified ontology IRI and is initialised to contain the axioms that are contained in the specified ontologies.
 OWLOntology createOntology(IRI ontologyIRI, java.util.Set<OWLOntology> ontologies, boolean copyLogicalAxiomsOnly)
          Creates a new ontology that has the specified ontology IRI and is initialised to contain the axioms that are contained in the specified ontologies.
 OWLOntology createOntology(OWLOntologyID ontologyID)
          Creates a new (empty) ontology that has the specified ontology ID.
 OWLOntology createOntology(java.util.Set<OWLAxiom> axioms)
          Creates a new ontology that is initialised to contain specific axioms.
 OWLOntology createOntology(java.util.Set<OWLAxiom> axioms, IRI ontologyIRI)
          Creates a new ontology that has the specified ontology IRI and is initialised to contain specific axioms.
 java.util.Set<OWLOntology> getDirectImports(OWLOntology ontology)
          Gets the set of loaded ontologies that the specified ontology is related to via the directlyImports relation as defined in Section 3.4 of the OWL 2 Structural specification
 OWLOntology getImportedOntology(OWLImportsDeclaration declaration)
          Given an imports declaration, obtains the ontology that this import has been resolved to.
 java.util.Set<OWLOntology> getImports(OWLOntology ontology)
          Gets the set of ontologies that are in the transitive closure of the directly imports relation.
 java.util.Set<OWLOntology> getImportsClosure(OWLOntology ontology)
          Gets the imports closure for the specified ontology.
 java.util.Set<OWLOntology> getOntologies()
          Gets all of the ontologies that are managed by this manager.
 java.util.Set<OWLOntology> getOntologies(OWLAxiom axiom)
          Gets the ontologies that are managed by this manager that contain the specified axiom.
 OWLOntology getOntology(IRI ontologyIRI)
          Gets a previously loaded/created ontology that has the specified ontology IRI and no version IRI.
 OWLOntology getOntology(OWLOntologyID ontologyID)
          Gets a previously loaded/created ontology that has the specified ontology ID
 OWLOntologyFormat getOntologyFormat(OWLOntology ontology)
          Gets the ontology format for the specified ontology.
 OWLDataFactory getOWLDataFactory()
          Gets a data factory which can be used to create OWL API objects such as classes, properties, individuals, axioms etc.
 java.net.URI getPhysicalURIForOntology(OWLOntology ontology)
          Gets the physical IRI for a given ontology.
 java.util.List<OWLOntology> getSortedImportsClosure(OWLOntology ontology)
          Gets the topologically ordered imports closure.
 java.util.Set<OWLOntology> getVersions(IRI ontology)
          Gets the versions (if any) of the ontology that have the specified IRI
 boolean isSilentMissingImportsHandling()
          Determines if silent missing imports handling is enabled.
 OWLOntology loadOntology(IRI ontologyIRI)
          Loads the ontology specified by the ontologyIRI parameter.
 OWLOntology loadOntology(OWLOntologyInputSource inputSource)
          A convenience method that load an ontology from an input source.
 OWLOntology loadOntologyFromPhysicalURI(java.net.URI uri)
          A convenience method that loads an ontology from a physical URI.
 void makeLoadImportRequest(OWLImportsDeclaration declaration)
          Requests that the manager loads an imported ontology that is described by an imports statement.
 java.util.List<OWLOntologyChange> removeAxiom(OWLOntology ont, OWLAxiom axiom)
          A convenience method that removes a single axioms from an ontology.
 java.util.List<OWLOntologyChange> removeAxioms(OWLOntology ont, java.util.Set<? extends OWLAxiom> axioms)
          A convenience method that removes a set of axioms from an ontology.
 void removeIRIMapper(OWLOntologyIRIMapper mapper)
          Removes a mapper from this manager.
 void removeMissingImportListener(MissingImportListener listener)
          Removes a previously added missing import listener.
 void removeOntology(OWLOntology ontology)
          Attempts to remove an ontology.
 void removeOntologyChangeListener(OWLOntologyChangeListener listener)
          Removes a previously added listener.
 void removeOntologyChangeProgessListener(OWLOntologyChangeProgressListener listener)
           
 void removeOntologyFactory(OWLOntologyFactory factory)
          Removes a previously added factory.
 void removeOntologyLoaderListener(OWLOntologyLoaderListener listener)
           
 void removeOntologyStorer(OWLOntologyStorer storer)
          Removes a previously added storer
 void saveOntology(OWLOntology ontology)
          Saves the specified ontology.
 void saveOntology(OWLOntology ontology, OWLOntologyFormat ontologyFormat)
           
 void saveOntology(OWLOntology ontology, OWLOntologyFormat ontologyFormat, OWLOntologyOutputTarget outputTarget)
           
 void saveOntology(OWLOntology ontology, OWLOntologyFormat ontologyFormat, java.net.URI physicalURI)
           
 void saveOntology(OWLOntology ontology, OWLOntologyOutputTarget outputTarget)
           
 void saveOntology(OWLOntology ontology, java.net.URI physicalURI)
          Saves the specified ontology, using the specified IRI to determine where/how the ontology should be saved.
 void setDefaultChangeBroadcastStrategy(OWLOntologyChangeBroadcastStrategy strategy)
          Sets the default strategy that is used to broadcast ontology changes.
 void setOntologyFormat(OWLOntology ontology, OWLOntologyFormat ontologyFormat)
          Sets the format for the specified ontology.
 void setPhysicalURIForOntology(OWLOntology ontology, java.net.URI physicalURI)
          Overrides the current physical URI for a given ontology.
 void setSilentMissingImportsHandling(boolean b)
          The default behaviour when an import cannot be loaded is to throw an exception.
 

Method Detail

getOWLDataFactory

OWLDataFactory getOWLDataFactory()
Gets a data factory which can be used to create OWL API objects such as classes, properties, individuals, axioms etc.

Returns:
A reference to a data factory for creating OWL API objects.

getOntologies

java.util.Set<OWLOntology> getOntologies()
Gets all of the ontologies that are managed by this manager.

Specified by:
getOntologies in interface OWLOntologySetProvider
Returns:
The set of ontologies managed by this manager.

getOntologies

java.util.Set<OWLOntology> getOntologies(OWLAxiom axiom)
Gets the ontologies that are managed by this manager that contain the specified axiom.

Parameters:
axiom - The axioms
Returns:
The set of ontologies such that for each ontology, O the specified axiom is contained in O.

getVersions

java.util.Set<OWLOntology> getVersions(IRI ontology)
Gets the versions (if any) of the ontology that have the specified IRI

Parameters:
ontology - The ontology IRI
Returns:
The set of ontologies that have the specified ontology IRI.

contains

boolean contains(IRI ontologyIRI)
Determines if there is an ontology with the specified IRI, and no version IRI, that is managed by this manager

Parameters:
ontologyIRI - The IRI of the ontology to test for (the version IRI is assumed to be null)
Returns:
true if there is an ontology with the specified IRI, and no version IRI, that is managed by this manager, otherwise false.

contains

boolean contains(OWLOntologyID id)
Determines if there is an ontology with the specified id that is managed by this manager

Parameters:
id - The id of the ontology to test for
Returns:
true if there is an ontology with the specified id that is managed by this manager, otherwise false.

getOntology

OWLOntology getOntology(IRI ontologyIRI)
Gets a previously loaded/created ontology that has the specified ontology IRI and no version IRI.

Parameters:
ontologyIRI - The IRI of the ontology to be retrieved.
Returns:
The ontology that has the specified IRI and no version IRI, or null if this manager does not manage an ontology with the specified IRI and no version IRI.

getOntology

OWLOntology getOntology(OWLOntologyID ontologyID)
Gets a previously loaded/created ontology that has the specified ontology ID

Parameters:
ontologyID - The ID of the ontology to retrieve
Returns:
The ontology that has the specified ID, or null if this manager does not manage an ontology with the specified ontology ID.

getImportedOntology

OWLOntology getImportedOntology(OWLImportsDeclaration declaration)
Given an imports declaration, obtains the ontology that this import has been resolved to.

Parameters:
declaration - The declaration that points to the imported ontology.
Returns:
The ontology that the imports declaration resolves to, or null if the imports declaration could not be resolved to an ontology, because the ontology was not loaded or has been removed from this manager

getDirectImports

java.util.Set<OWLOntology> getDirectImports(OWLOntology ontology)
                                            throws UnknownOWLOntologyException
Gets the set of loaded ontologies that the specified ontology is related to via the directlyImports relation as defined in Section 3.4 of the OWL 2 Structural specification

Parameters:
ontology - The ontology whose direct imports are to be retrieved.
Returns:
The set of loaded ontologies that the specified ontology is related to via the directlyImports relation.
Throws:
UnknownOWLOntologyException - if there isn't an ontology in this manager which has the specified IRI.

getImports

java.util.Set<OWLOntology> getImports(OWLOntology ontology)
                                      throws UnknownOWLOntologyException
Gets the set of ontologies that are in the transitive closure of the directly imports relation.

Parameters:
ontology - The ontology whose imports are to be retrieved.
Returns:
A set of OWLOntologyies that are in the transitive closure of the directly imports relation of this ontology. If, for what ever reason, an imported ontology could not be loaded, then it will not be contained in the returned set of ontologies.
Throws:
UnknownOWLOntologyException - if there isn't an ontology in this manager which has the specified IRI.

getImportsClosure

java.util.Set<OWLOntology> getImportsClosure(OWLOntology ontology)
                                             throws UnknownOWLOntologyException
Gets the imports closure for the specified ontology.

Parameters:
ontology - The ontology whose imports closure is to be retrieved.
Returns:
A Set of ontologies that contains the imports closure for the specified ontology. This set will also include the specified ontology. Example: if A imports B and B imports C, then calling this method with A will return the set consisting of A, B and C. If, for what ever reason, an imported ontology could not be loaded, then it will not be contained in the returned set of ontologies.
Throws:
UnknownOWLOntologyException - if there isn't an ontology in this manager which has the specified IRI.

getSortedImportsClosure

java.util.List<OWLOntology> getSortedImportsClosure(OWLOntology ontology)
                                                    throws UnknownOWLOntologyException
Gets the topologically ordered imports closure.

Parameters:
ontology - The ontology whose imports closure is to be determined.
Returns:
A list that represents a topological ordering of the imports closure. The first element in the list will be the specified ontology.
Throws:
UnknownOWLOntologyException - if there isn't an ontology in this manager that corresponds to the specified ontology

applyChanges

java.util.List<OWLOntologyChange> applyChanges(java.util.List<? extends OWLOntologyChange> changes)
                                               throws OWLOntologyChangeException
Applies a list of changes to some or all of the ontologies that are managed by this manager. The changes will be applied to the appropraite ontologies.

Parameters:
changes - The changes to be applied.
Returns:
The changes that were actually applied.
Throws:
OWLOntologyChangeException - If one or more of the changes could not be applied. See subclasses of ontology change exception for more specific details.

addAxioms

java.util.List<OWLOntologyChange> addAxioms(OWLOntology ont,
                                            java.util.Set<? extends OWLAxiom> axioms)
                                            throws OWLOntologyChangeException
A convenience method that adds a set of axioms to an ontology. The appropriate AddAxiom change objects are automatically generated.

Parameters:
ont - The ontology to which the axioms should be added.
axioms - The axioms to be added.
Returns:
A list of ontology changes that represent the changes which took place in order to add the axioms.
Throws:
OWLOntologyChangeException - if there was a problem adding the axioms

addAxiom

java.util.List<OWLOntologyChange> addAxiom(OWLOntology ont,
                                           OWLAxiom axiom)
                                           throws OWLOntologyChangeException
A convenience method that adds a single axioms to an ontology. The appropriate AddAxiom change object is automatically generated.

Parameters:
ont - The ontology to add the axiom to.
axiom - The axiom to be added
Returns:
A list of ontology changes that represent the changes that actually took place.
Throws:
OWLOntologyChangeException - if there was a problem adding the axiom

removeAxiom

java.util.List<OWLOntologyChange> removeAxiom(OWLOntology ont,
                                              OWLAxiom axiom)
                                              throws OWLOntologyChangeException
A convenience method that removes a single axioms from an ontology. The appropriate RemoveAxiom change object is automatically generated.

Parameters:
ont - The ontology to remove the axiom from.
axiom - The axiom to be removed
Returns:
A list of ontology changes that represent the changes that actually took place.
Throws:
OWLOntologyChangeException - if there was a problem removing the axiom

removeAxioms

java.util.List<OWLOntologyChange> removeAxioms(OWLOntology ont,
                                               java.util.Set<? extends OWLAxiom> axioms)
                                               throws OWLOntologyChangeException
A convenience method that removes a set of axioms from an ontology. The appropriate RemoveAxiom change objects are automatically generated.

Parameters:
ont - The ontology from which the axioms should be removed.
axioms - The axioms to be removed.
Returns:
A list of ontology changes that represent the changes which took place in order to remove the axioms.
Throws:
OWLOntologyChangeException - if there was a problem removing the axioms

applyChange

java.util.List<OWLOntologyChange> applyChange(OWLOntologyChange change)
                                              throws OWLOntologyChangeException
A convenience method that applies just one change to an ontology that is managed by this manager.

Parameters:
change - The change to be applied
Returns:
The changes that resulted of the applied ontology change.
Throws:
OWLOntologyChangeException - If the change could not be applied. See subclasses of ontology change exception for more specific details.

createOntology

OWLOntology createOntology()
                           throws OWLOntologyCreationException
Creates a new (empty) ontology that does not have an ontology IRI (and therefore does not have a version IRI)

Returns:
The newly created ontology
Throws:
OWLOntologyCreationException - if there was a problem creating the ontology

createOntology

OWLOntology createOntology(java.util.Set<OWLAxiom> axioms)
                           throws OWLOntologyCreationException,
                                  OWLOntologyChangeException
Creates a new ontology that is initialised to contain specific axioms. The ontology will not have an IRI.

Parameters:
axioms - The axioms that should be copied into the new ontology
Returns:
An ontology without an IRI that contains all of the specified axioms
Throws:
OWLOntologyCreationException - if there was a problem creating the new ontology, if the new ontology already exists in this manager.
OWLOntologyChangeException - if there was a problem copying the axioms.

createOntology

OWLOntology createOntology(java.util.Set<OWLAxiom> axioms,
                           IRI ontologyIRI)
                           throws OWLOntologyCreationException,
                                  OWLOntologyChangeException
Creates a new ontology that has the specified ontology IRI and is initialised to contain specific axioms.

Parameters:
ontologyIRI - The IRI of the new ontology.
axioms - The axioms that should be copied into the new ontology
Returns:
An ontology that has the specified IRI and contains all of the specified axioms
Throws:
OWLOntologyCreationException - if there was a problem creating the new ontology, if the new ontology already exists in this manager.
OWLOntologyChangeException - if there was a problem copying the axioms.

createOntology

OWLOntology createOntology(IRI ontologyIRI)
                           throws OWLOntologyCreationException
Creates a new (empty) ontology that has the specified ontology IRI (and no version IRI)

Parameters:
ontologyIRI - The IRI of the ontology to be created. The ontology IRI will be mapped to a physical IRI in order to determine the type of ontology factory that will be used to create the ontology. If this mapping is null then a default (in memory) implementation of the ontology will most likely be created.
Returns:
The newly created ontology, or if an ontology with the specified IRI already exists then this existing ontology will be returned.
Throws:
OWLOntologyCreationException - If the ontology could not be created.

createOntology

OWLOntology createOntology(OWLOntologyID ontologyID)
                           throws OWLOntologyCreationException
Creates a new (empty) ontology that has the specified ontology ID.

Parameters:
ontologyID - The ID of the ontology to be created. The ontology IRI will be mapped to a physical IRI in order to determine the type of ontology factory that will be used to create the ontology. If this mapping is null then a default (in memory) implementation of the ontology will most likely be created.
Returns:
The newly created ontology, or if an ontology with the specified IRI already exists then this existing ontology will be returned.
Throws:
OWLOntologyCreationException - If the ontology could not be created.

createOntology

OWLOntology createOntology(IRI ontologyIRI,
                           java.util.Set<OWLOntology> ontologies,
                           boolean copyLogicalAxiomsOnly)
                           throws OWLOntologyCreationException,
                                  OWLOntologyChangeException
Creates a new ontology that has the specified ontology IRI and is initialised to contain the axioms that are contained in the specified ontologies. Note that the specified ontologies need not be managed by this manager.

Parameters:
ontologyIRI - The IRI of the new ontology.
ontologies - The ontologies whose axioms should be copied into the new ontology
copyLogicalAxiomsOnly - If set to true only logical axioms are copied into the new ontology. If set to false then all axioms (including annotation axioms) are copied into the new ontology.
Returns:
An ontology that has the specified IRI and contains all of the axioms that are contained in the specified ontologies possibly minus all non-logical axioms
Throws:
OWLOntologyCreationException - if there was a problem creating the new ontology, if the new ontology already exists in this manager.
OWLOntologyChangeException - if there was a problem copying the axioms.

createOntology

OWLOntology createOntology(IRI ontologyIRI,
                           java.util.Set<OWLOntology> ontologies)
                           throws OWLOntologyCreationException,
                                  OWLOntologyChangeException
Creates a new ontology that has the specified ontology IRI and is initialised to contain the axioms that are contained in the specified ontologies. Note that the specified ontologies need not be managed by this manager.

Parameters:
ontologyIRI - The IRI of the new ontology.
ontologies - The ontologies whose axioms should be copied into the new ontology
Returns:
An ontology that has the specified IRI and contains all of the axioms that are contained in the specified ontologies
Throws:
OWLOntologyCreationException - if there was a problem creating the new ontology, if the new ontology already exists in this manager.
OWLOntologyChangeException - if there was a problem copying the axioms.

loadOntology

OWLOntology loadOntology(IRI ontologyIRI)
                         throws OWLOntologyCreationException
Loads the ontology specified by the ontologyIRI parameter. Note that this is NOT the physical IRI that points to a concrete representation (e.g. an RDF/XML OWL file) of an ontology. The mapping to a physical IRI will be determined by using one of the loaded OWLOntologyIRIMappers.

Parameters:
ontologyIRI - The ontology IRI (sometimes called logical IRI of the ontology to be loaded)
Returns:
The OWLOntology representation of the ontology that was loaded. If an ontology with the specified IRI is already loaded then that ontology will be returned.
Throws:
OWLOntologyCreationException - If there was a problem in creating and loading the ontology.

loadOntologyFromPhysicalURI

OWLOntology loadOntologyFromPhysicalURI(java.net.URI uri)
                                        throws OWLOntologyCreationException
A convenience method that loads an ontology from a physical URI. If the ontology contains imports, then the appropriate mappers should be set up before calling this method.

Parameters:
uri - The physical URI which points to a concrete representation of an ontology.
Returns:
The ontology that was loaded.
Throws:
OWLOntologyCreationException - If the ontology could not be created and loaded.

loadOntology

OWLOntology loadOntology(OWLOntologyInputSource inputSource)
                         throws OWLOntologyCreationException
A convenience method that load an ontology from an input source. If the ontology contains imports then the appropriate mappers should be set up before calling this method.

Parameters:
inputSource - The input source that describes where the ontology should be loaded from.
Returns:
The ontology that was loaded. Note that other ontologies may be loaded as a result of the ontology being loaded, but these are not returned here.
Throws:
OWLOntologyCreationException - if there was a problem loading the ontology from the specified input source, or if the ontology imports other ontologies the exception is thrown if there was a problem handing imports.

removeOntology

void removeOntology(OWLOntology ontology)
Attempts to remove an ontology. The ontology which is identified by the specified IRI is removed regardless of whether it is referenced by other ontologies via imports statements.

Parameters:
ontology - The ontology to be removed. If this manager does not manage the ontology then nothing happens.

getPhysicalURIForOntology

java.net.URI getPhysicalURIForOntology(OWLOntology ontology)
                                       throws UnknownOWLOntologyException
Gets the physical IRI for a given ontology. This will either be the physical IRI from where the ontology was obtained from during loading, or the physcial IRI which was specified (via a mapper) when the (empty) ontology was created. Note that this may not correspond to the first physical IRI found in the list of mappings from ontology IRI to physcial IRI. The reason for this is that it might not have been possible to load the ontology from the first physical IRI found in the mapping table.

Parameters:
ontology - The ontology whose physical IRI is to be obtained.
Returns:
The physical IRI of the ontology.
Throws:
UnknownOWLOntologyException - If the specified ontology is not managed by this manager.

setPhysicalURIForOntology

void setPhysicalURIForOntology(OWLOntology ontology,
                               java.net.URI physicalURI)
                               throws UnknownOWLOntologyException
Overrides the current physical URI for a given ontology. This method does not alter the IRI mappers which are installed, but alters the physical URI of an ontology that has already been loaded.

Parameters:
ontology - The ontology that has already been loaded.
physicalURI - The new physcial URI
Throws:
UnknownOWLOntologyException - If the specified ontology is not managed by this manager.

getOntologyFormat

OWLOntologyFormat getOntologyFormat(OWLOntology ontology)
                                    throws UnknownOWLOntologyException
Gets the ontology format for the specified ontology.

Parameters:
ontology - The ontology whose format it to be obtained.
Returns:
The format of the ontology.
Throws:
UnknownOWLOntologyException - If the specified ontology is not managed by this manager.

setOntologyFormat

void setOntologyFormat(OWLOntology ontology,
                       OWLOntologyFormat ontologyFormat)
Sets the format for the specified ontology.

Parameters:
ontology - The ontology whose format is to be set.
ontologyFormat - The format for the specified ontology.

saveOntology

void saveOntology(OWLOntology ontology)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Saves the specified ontology. The ontology will be saved to the location that it was loaded from, or if it was created programmatically, it will be saved to the location specified by an ontology IRI mapper at creation time. The ontology will be saved in the same format which it was loaded from, or the default ontology format if the ontology was created programmatically.

Parameters:
ontology - The ontology to be saved.
Throws:
OWLOntologyStorageException - An exception will be thrown if there is a problem with saving the ontology, or the ontology can't be saved in the format it was loaded from.
UnknownOWLOntologyException

saveOntology

void saveOntology(OWLOntology ontology,
                  java.net.URI physicalURI)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Saves the specified ontology, using the specified IRI to determine where/how the ontology should be saved.

Parameters:
ontology - The ontology to be saved.
physicalURI - The physical URI that specified how and where the ontology should be saved.
Throws:
OWLOntologyStorageException - If the ontology cannot be saved.
UnknownOWLOntologyException

saveOntology

void saveOntology(OWLOntology ontology,
                  OWLOntologyFormat ontologyFormat)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Throws:
OWLOntologyStorageException
UnknownOWLOntologyException

saveOntology

void saveOntology(OWLOntology ontology,
                  OWLOntologyFormat ontologyFormat,
                  java.net.URI physicalURI)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Throws:
OWLOntologyStorageException
UnknownOWLOntologyException

saveOntology

void saveOntology(OWLOntology ontology,
                  OWLOntologyOutputTarget outputTarget)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Throws:
OWLOntologyStorageException
UnknownOWLOntologyException

saveOntology

void saveOntology(OWLOntology ontology,
                  OWLOntologyFormat ontologyFormat,
                  OWLOntologyOutputTarget outputTarget)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Throws:
OWLOntologyStorageException
UnknownOWLOntologyException

addIRIMapper

void addIRIMapper(OWLOntologyIRIMapper mapper)
Adds a mapper to this manager. The mapper is used to obtain physical IRIs for ontology IRIs (logical IRIs). The mapper will be added so that it is given the highest priority (i.e. it will be tried first).

Parameters:
mapper - The mapper to be added.

removeIRIMapper

void removeIRIMapper(OWLOntologyIRIMapper mapper)
Removes a mapper from this manager.

Parameters:
mapper - The mapper to be removed.

clearIRIMappers

void clearIRIMappers()
Clears any installed IRI mappers


addOntologyFactory

void addOntologyFactory(OWLOntologyFactory factory)
Adds an ontology factory that is capable of creating an ontology given a particular physical IRI.

Parameters:
factory - The factory to be added.

removeOntologyFactory

void removeOntologyFactory(OWLOntologyFactory factory)
Removes a previously added factory.

Parameters:
factory - The factory to be removed.

addOntologyStorer

void addOntologyStorer(OWLOntologyStorer storer)
Add an ontology storer.

Parameters:
storer - The storer to be added

removeOntologyStorer

void removeOntologyStorer(OWLOntologyStorer storer)
Removes a previously added storer

Parameters:
storer - The storer to be removed

addOntologyChangeListener

void addOntologyChangeListener(OWLOntologyChangeListener listener)
Adds an ontology change listener, which listens to all changes for all ontologies. To customise the changes/ontologies that are listened to, the addOntologyChangeListener method which takes a broadcast strategy as an argument should be used.

Parameters:
listener - The listener to be added.

addOntologyChangeListener

void addOntologyChangeListener(OWLOntologyChangeListener listener,
                               OWLOntologyChangeBroadcastStrategy strategy)
Adds an ontology change listener, which listens to ontology changes. An ontology change broadcast strategy must be specified, which determines the changes that are broadcast to the listener.

Parameters:
listener - The listener to be added.
strategy - The strategy that should be used for broadcasting changes to the listener.

setDefaultChangeBroadcastStrategy

void setDefaultChangeBroadcastStrategy(OWLOntologyChangeBroadcastStrategy strategy)
Sets the default strategy that is used to broadcast ontology changes.

Parameters:
strategy - The strategy to be used for broadcasting changes. This strategy will override any previously set broadcast strategy. The strategy should not be null.
See Also:
DefaultChangeBroadcastStrategy, EDTChangeBroadcastStrategy

removeOntologyChangeListener

void removeOntologyChangeListener(OWLOntologyChangeListener listener)
Removes a previously added listener.

Parameters:
listener - The listener to be removed.

makeLoadImportRequest

void makeLoadImportRequest(OWLImportsDeclaration declaration)
                           throws OWLOntologyCreationException
Requests that the manager loads an imported ontology that is described by an imports statement. This method is generally used by parsers and other kinds of loaders. For simply loading an ontology, use the loadOntologyXXX methods.

Parameters:
declaration - The declaration that describes the import to be loaded.
Throws:
OWLOntologyCreationException - if there was a problem creating and loading the import and silent missing imports handling is not turned on.

setSilentMissingImportsHandling

void setSilentMissingImportsHandling(boolean b)
The default behaviour when an import cannot be loaded is to throw an exception. This completely stops the loading process. If it is desired that loading continues then this option can be set with this method.

Parameters:
b - true if loading should continue when an imported ontology cannot be loaded, other wise false. The default value is false.

isSilentMissingImportsHandling

boolean isSilentMissingImportsHandling()
Determines if silent missing imports handling is enabled.

Returns:
true if silent missing imports handler is enabled, otherwise false.

addMissingImportListener

void addMissingImportListener(MissingImportListener listener)
In the case where silent missing imports handling is enabled, a listener can be attached via this method so that there is a mechanism that allows clients to be informed of the reason when an import cannot be loaded.

Parameters:
listener - The listener to be added.

removeMissingImportListener

void removeMissingImportListener(MissingImportListener listener)
Removes a previously added missing import listener.

Parameters:
listener - The listener to be removed.

addOntologyLoaderListener

void addOntologyLoaderListener(OWLOntologyLoaderListener listener)

removeOntologyLoaderListener

void removeOntologyLoaderListener(OWLOntologyLoaderListener listener)

addOntologyChangeProgessListener

void addOntologyChangeProgessListener(OWLOntologyChangeProgressListener listener)

removeOntologyChangeProgessListener

void removeOntologyChangeProgessListener(OWLOntologyChangeProgressListener listener)