uk.ac.manchester.cs.owl
Class OWLOntologyManagerImpl

java.lang.Object
  extended by uk.ac.manchester.cs.owl.OWLOntologyManagerImpl
All Implemented Interfaces:
OWLOntologyFactory.OWLOntologyCreationHandler, OWLOntologyManager, OWLOntologySetProvider

public class OWLOntologyManagerImpl
extends java.lang.Object
implements OWLOntologyManager, OWLOntologyFactory.OWLOntologyCreationHandler

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 27-Oct-2006


Constructor Summary
OWLOntologyManagerImpl(OWLDataFactory dataFactory)
           
 
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 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 addOntologyFactory(OWLOntologyFactory factory)
          Adds an ontology factory that is capable of creating an ontology given a particular physical URI.
 void addOntologyLoaderListener(OWLOntologyLoaderListener listener)
           
 void addOntologyStorer(OWLOntologyStorer storer)
          Add an ontology storer.
 void addURIMapper(OWLOntologyURIMapper mapper)
          Adds a mapper to this manager.
 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 clearURIMappers()
          Clears any installed URI mappers
 boolean contains(OWLOntology ontology)
           
 boolean contains(java.net.URI ontologyURI)
          Determines if there is an ontology with the specified URI that is managed by this manager.
 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, java.net.URI ontologyURI)
          Creates a new ontology that has the specified ontology URI and is initialised to contain specific axioms.
 OWLOntology createOntology(java.net.URI ontologyURI)
          Creates a new (empty) ontology that has the specified ontology URI.
 OWLOntology createOntology(java.net.URI ontologyURI, java.util.Set<OWLOntology> ontologies)
          Creates a new ontology that has the specified ontology URI and is initialised to contain the axioms that are contained in the specified ontologies.
 OWLOntology createOntology(java.net.URI ontologyURI, java.util.Set<OWLOntology> ontologies, boolean copyLogicalAxiomsOnly)
          Creates a new ontology that has the specified ontology URI and is initialised to contain the axioms that are contained in the specified ontologies.
 OWLOntology getImportedOntology(OWLImportsDeclaration declaration)
          Given an imports declaration, obtains the ontology that this imports has been resolved to.
 java.util.Set<OWLOntology> getImports(OWLOntology ontology)
          Gets the set of ontologies that are directly imported by the specified ontology.
 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(java.net.URI ontologyURI)
          Gets a previously loaded/created ontology that corresponds to the specified ontology URI.
 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 URI for a given ontology.
 OWLOntologyManagerProperties getProperties()
           
 java.util.List<OWLOntology> getSortedImportsClosure(OWLOntology ontology)
          Gets the topologically ordered imports closure.
 boolean isSilentMissingImportsHandling()
          Determines if silent missing imports handling is enabled.
 OWLOntology loadOntology(OWLOntologyInputSource inputSource)
          A convenience method that load an ontology from an input source.
 OWLOntology loadOntology(java.net.URI ontologyURI)
          Loads the ontology specified by the ontologyURI parameter.
 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.
 void ontologyCreated(OWLOntology ontology)
          The factory calls this method as soon as it has created an ontology.
 OWLOntology reloadOntology(java.net.URI ontologyURI)
          Reloads an ontology that is already managed by this manager.
 void removeMissingImportListener(MissingImportListener listener)
          Removes a previously added missing import listener.
 void removeOntology(java.net.URI ontologyURI)
          Attempts to remove an ontology.
 void removeOntologyChangeListener(OWLOntologyChangeListener listener)
          Removes a previously added listener.
 void removeOntologyFactory(OWLOntologyFactory factory)
          Removes a previously added factory.
 void removeOntologyLoaderListener(OWLOntologyLoaderListener listener)
           
 void removeOntologyStorer(OWLOntologyStorer storer)
          Removes a previously added storer
 void removeURIMapper(OWLOntologyURIMapper mapper)
          Removes a mapper from this manager.
 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 physcialURI)
           
 void saveOntology(OWLOntology ontology, OWLOntologyOutputTarget outputTarget)
           
 void saveOntology(OWLOntology ontology, java.net.URI physicalURI)
          Saves the specified ontology, using the specified URI to determine where/how the ontology should be saved.
 void setOntologyFormat(OWLOntology ontology, OWLOntologyFormat format)
          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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OWLOntologyManagerImpl

public OWLOntologyManagerImpl(OWLDataFactory dataFactory)
Method Detail

getProperties

public OWLOntologyManagerProperties getProperties()

getOWLDataFactory

public OWLDataFactory getOWLDataFactory()
Description copied from interface: OWLOntologyManager
Gets a data factory which can be used to create OWL API objects such as classes, properties, individuals, axioms etc.

Specified by:
getOWLDataFactory in interface OWLOntologyManager

getOntologies

public java.util.Set<OWLOntology> getOntologies()
Description copied from interface: OWLOntologyManager
Gets all of the ontologies that are managed by this manager.

Specified by:
getOntologies in interface OWLOntologyManager
Specified by:
getOntologies in interface OWLOntologySetProvider

getOntologies

public java.util.Set<OWLOntology> getOntologies(OWLAxiom axiom)
Description copied from interface: OWLOntologyManager
Gets the ontologies that are managed by this manager that contain the specified axiom.

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

contains

public boolean contains(OWLOntology ontology)

contains

public boolean contains(java.net.URI ontologyURI)
Description copied from interface: OWLOntologyManager
Determines if there is an ontology with the specified URI that is managed by this manager.

Specified by:
contains in interface OWLOntologyManager
Parameters:
ontologyURI - The URI of the ontology to test for
Returns:
true if there is an ontology with the specified URI that is managed by this manager, otherwise false.

getOntology

public OWLOntology getOntology(java.net.URI ontologyURI)
Description copied from interface: OWLOntologyManager
Gets a previously loaded/created ontology that corresponds to the specified ontology URI.

Specified by:
getOntology in interface OWLOntologyManager
Parameters:
ontologyURI - The URI of the ontology to be obtained (this is not the physical URI of the ontology).
Returns:
The ontology that has the specified URI.

getImportedOntology

public OWLOntology getImportedOntology(OWLImportsDeclaration declaration)
Description copied from interface: OWLOntologyManager
Given an imports declaration, obtains the ontology that this imports has been resolved to.

Specified by:
getImportedOntology in interface OWLOntologyManager
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 imported.

getImports

public java.util.Set<OWLOntology> getImports(OWLOntology ontology)
Description copied from interface: OWLOntologyManager
Gets the set of ontologies that are directly imported by the specified ontology.

Specified by:
getImports in interface OWLOntologyManager
Parameters:
ontology - The ontology whose direct imports are to be retrieved.
Returns:
A set of OWLOntology instances that represent the direct imports of the specified 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.

getImportsClosure

public java.util.Set<OWLOntology> getImportsClosure(OWLOntology ontology)
Description copied from interface: OWLOntologyManager
Gets the imports closure for the specified ontology.

Specified by:
getImportsClosure in interface OWLOntologyManager
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.

getSortedImportsClosure

public java.util.List<OWLOntology> getSortedImportsClosure(OWLOntology ontology)
                                                    throws UnknownOWLOntologyException
Description copied from interface: OWLOntologyManager
Gets the topologically ordered imports closure.

Specified by:
getSortedImportsClosure in interface OWLOntologyManager
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

public java.util.List<OWLOntologyChange> applyChanges(java.util.List<? extends OWLOntologyChange> changes)
                                               throws OWLOntologyChangeException
Description copied from interface: OWLOntologyManager
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.

Specified by:
applyChanges in interface OWLOntologyManager
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.

addAxiom

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

Specified by:
addAxiom in interface OWLOntologyManager
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

addAxioms

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

Specified by:
addAxioms in interface OWLOntologyManager
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

applyChange

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

Specified by:
applyChange in interface OWLOntologyManager
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.

ontologyCreated

public void ontologyCreated(OWLOntology ontology)
Description copied from interface: OWLOntologyFactory.OWLOntologyCreationHandler
The factory calls this method as soon as it has created an ontology. If the factory is loading an ontology then the ontology will not have been populated with axioms at this stage.

Specified by:
ontologyCreated in interface OWLOntologyFactory.OWLOntologyCreationHandler
Parameters:
ontology - The newly created ontology.

setOntologyFormat

public void setOntologyFormat(OWLOntology ontology,
                              OWLOntologyFormat format)
Description copied from interface: OWLOntologyManager
Sets the format for the specified ontology.

Specified by:
setOntologyFormat in interface OWLOntologyFactory.OWLOntologyCreationHandler
Specified by:
setOntologyFormat in interface OWLOntologyManager
Parameters:
ontology - The ontology whose format is to be set.
format - The format for the specified ontology.

getOntologyFormat

public OWLOntologyFormat getOntologyFormat(OWLOntology ontology)
Description copied from interface: OWLOntologyManager
Gets the ontology format for the specified ontology.

Specified by:
getOntologyFormat in interface OWLOntologyManager
Parameters:
ontology - The ontology whose format it to be obtained.
Returns:
The format of the ontology.

createOntology

public OWLOntology createOntology(java.net.URI ontologyURI)
                           throws OWLOntologyCreationException
Description copied from interface: OWLOntologyManager
Creates a new (empty) ontology that has the specified ontology URI.

Specified by:
createOntology in interface OWLOntologyManager
Parameters:
ontologyURI - The URI of the ontology to be created. The ontology URI will be mapped to a physical URI 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 URI already exists then this existing ontology will be returned.
Throws:
OWLOntologyCreationException - If the ontology could not be created.

createOntology

public OWLOntology createOntology(java.net.URI ontologyURI,
                                  java.util.Set<OWLOntology> ontologies)
                           throws OWLOntologyCreationException,
                                  OWLOntologyChangeException
Description copied from interface: OWLOntologyManager
Creates a new ontology that has the specified ontology URI 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.

Specified by:
createOntology in interface OWLOntologyManager
Parameters:
ontologyURI - The URI of the new ontology.
ontologies - The ontologies whose axioms should be copied into the new ontology
Returns:
An ontology that has the specified URI 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.

createOntology

public OWLOntology createOntology(java.net.URI ontologyURI,
                                  java.util.Set<OWLOntology> ontologies,
                                  boolean copyLogicalAxiomsOnly)
                           throws OWLOntologyCreationException,
                                  OWLOntologyChangeException
Description copied from interface: OWLOntologyManager
Creates a new ontology that has the specified ontology URI 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.

Specified by:
createOntology in interface OWLOntologyManager
Parameters:
ontologyURI - The URI 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 URI 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

public OWLOntology createOntology(java.util.Set<OWLAxiom> axioms,
                                  java.net.URI ontologyURI)
                           throws OWLOntologyCreationException,
                                  OWLOntologyChangeException
Description copied from interface: OWLOntologyManager
Creates a new ontology that has the specified ontology URI and is initialised to contain specific axioms.

Specified by:
createOntology in interface OWLOntologyManager
Parameters:
axioms - The axioms that should be copied into the new ontology
ontologyURI - The URI of the new ontology.
Returns:
An ontology that has the specified URI 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

public OWLOntology createOntology(java.util.Set<OWLAxiom> axioms)
                           throws OWLOntologyCreationException,
                                  OWLOntologyChangeException
Description copied from interface: OWLOntologyManager
Creates a new ontology that is initialised to contain specific axioms. A URI will be automatically generated. The URI is such that the manager does not contain an ontology with the URI. This method can be used is situation

Specified by:
createOntology in interface OWLOntologyManager
Parameters:
axioms - The axioms that should be copied into the new ontology
Returns:
An ontology that has the specified URI 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.

loadOntology

public OWLOntology loadOntology(java.net.URI ontologyURI)
                         throws OWLOntologyCreationException
Description copied from interface: OWLOntologyManager
Loads the ontology specified by the ontologyURI parameter. Note that this is NOT the physical URI that points to a concrete representation (e.g. an RDF/XML OWL file) of an ontology. The mapping to a physical URI will be determined by using one of the loaded OWLOntologyURIMappers.

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

loadOntologyFromPhysicalURI

public OWLOntology loadOntologyFromPhysicalURI(java.net.URI uri)
                                        throws OWLOntologyCreationException
Description copied from interface: OWLOntologyManager
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.

Specified by:
loadOntologyFromPhysicalURI in interface OWLOntologyManager
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

public OWLOntology loadOntology(OWLOntologyInputSource inputSource)
                         throws OWLOntologyCreationException
Description copied from interface: OWLOntologyManager
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.

Specified by:
loadOntology in interface OWLOntologyManager
Throws:
OWLOntologyCreationException

reloadOntology

public OWLOntology reloadOntology(java.net.URI ontologyURI)
                           throws OWLOntologyCreationException
Description copied from interface: OWLOntologyManager
Reloads an ontology that is already managed by this manager. If the manager does not already manage an ontology that has the specified URI, it will attempt to load the ontology.

Specified by:
reloadOntology in interface OWLOntologyManager
Parameters:
ontologyURI - The URI of the ontology to be reloaded.
Returns:
The ontology which was reloaded
Throws:
OWLOntologyCreationException - If the ontology could not be reloaded.

removeOntology

public void removeOntology(java.net.URI ontologyURI)
Description copied from interface: OWLOntologyManager
Attempts to remove an ontology. The ontology which is identified by the specified URI is removed regardless of whether it is referenced by other ontologies via imports statements.

Specified by:
removeOntology in interface OWLOntologyManager
Parameters:
ontologyURI - The URI of the ontology to be removed. If this manager does not contain an ontology identified by the specified URI then nothing happens.

getPhysicalURIForOntology

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

Specified by:
getPhysicalURIForOntology in interface OWLOntologyManager
Parameters:
ontology - The ontology whose physical URI is to be obtained.
Returns:
The physical URI of the ontology.
Throws:
UnknownOWLOntologyException - If the specified ontology is not managed by this manager.

setPhysicalURIForOntology

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

Specified by:
setPhysicalURIForOntology in interface OWLOntologyManager
Parameters:
ontology - The ontology that has already been loaded.
physicalURI - The new physical URI of the ontology.
Throws:
UnknownOWLOntologyException - If the specified ontology is not managed by this manager.

saveOntology

public void saveOntology(OWLOntology ontology)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Description copied from interface: OWLOntologyManager
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 URI 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.

Specified by:
saveOntology in interface OWLOntologyManager
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

public void saveOntology(OWLOntology ontology,
                         OWLOntologyFormat ontologyFormat)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Specified by:
saveOntology in interface OWLOntologyManager
Throws:
OWLOntologyStorageException
UnknownOWLOntologyException

saveOntology

public void saveOntology(OWLOntology ontology,
                         java.net.URI physicalURI)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Description copied from interface: OWLOntologyManager
Saves the specified ontology, using the specified URI to determine where/how the ontology should be saved.

Specified by:
saveOntology in interface OWLOntologyManager
Parameters:
ontology - The ontology to be saved.
physicalURI - The physical URI which will be used to determine how and where the ontology will be saved.
Throws:
OWLOntologyStorageException - If the ontology cannot be saved.
UnknownOWLOntologyException

saveOntology

public void saveOntology(OWLOntology ontology,
                         OWLOntologyFormat ontologyFormat,
                         java.net.URI physcialURI)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Specified by:
saveOntology in interface OWLOntologyManager
Throws:
OWLOntologyStorageException
UnknownOWLOntologyException

saveOntology

public void saveOntology(OWLOntology ontology,
                         OWLOntologyOutputTarget outputTarget)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Specified by:
saveOntology in interface OWLOntologyManager
Throws:
OWLOntologyStorageException
UnknownOWLOntologyException

saveOntology

public void saveOntology(OWLOntology ontology,
                         OWLOntologyFormat ontologyFormat,
                         OWLOntologyOutputTarget outputTarget)
                  throws OWLOntologyStorageException,
                         UnknownOWLOntologyException
Specified by:
saveOntology in interface OWLOntologyManager
Throws:
OWLOntologyStorageException
UnknownOWLOntologyException

addOntologyStorer

public void addOntologyStorer(OWLOntologyStorer storer)
Description copied from interface: OWLOntologyManager
Add an ontology storer.

Specified by:
addOntologyStorer in interface OWLOntologyManager
Parameters:
storer - The storer to be added

removeOntologyStorer

public void removeOntologyStorer(OWLOntologyStorer storer)
Description copied from interface: OWLOntologyManager
Removes a previously added storer

Specified by:
removeOntologyStorer in interface OWLOntologyManager
Parameters:
storer - The storer to be removed

addURIMapper

public void addURIMapper(OWLOntologyURIMapper mapper)
Description copied from interface: OWLOntologyManager
Adds a mapper to this manager. The mapper is used to obtain physical URIs for ontology URIs (logical URIs). The mapper will be added so that it is given the highest priority (i.e. it will be tried first).

Specified by:
addURIMapper in interface OWLOntologyManager
Parameters:
mapper - The mapper to be added.

clearURIMappers

public void clearURIMappers()
Description copied from interface: OWLOntologyManager
Clears any installed URI mappers

Specified by:
clearURIMappers in interface OWLOntologyManager

removeURIMapper

public void removeURIMapper(OWLOntologyURIMapper mapper)
Description copied from interface: OWLOntologyManager
Removes a mapper from this manager.

Specified by:
removeURIMapper in interface OWLOntologyManager
Parameters:
mapper - The mapper to be removed.

addOntologyFactory

public void addOntologyFactory(OWLOntologyFactory factory)
Description copied from interface: OWLOntologyManager
Adds an ontology factory that is capable of creating an ontology given a particular physical URI.

Specified by:
addOntologyFactory in interface OWLOntologyManager
Parameters:
factory - The factory to be added.

removeOntologyFactory

public void removeOntologyFactory(OWLOntologyFactory factory)
Description copied from interface: OWLOntologyManager
Removes a previously added factory.

Specified by:
removeOntologyFactory in interface OWLOntologyManager
Parameters:
factory - The factory to be removed.

addOntologyChangeListener

public void addOntologyChangeListener(OWLOntologyChangeListener listener)
Description copied from interface: OWLOntologyManager
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.

Specified by:
addOntologyChangeListener in interface OWLOntologyManager

addOntologyChangeListener

public void addOntologyChangeListener(OWLOntologyChangeListener listener,
                                      OWLOntologyChangeBroadcastStrategy strategy)
Description copied from interface: OWLOntologyManager
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.

Specified by:
addOntologyChangeListener in interface OWLOntologyManager
Parameters:
listener - The listener to be added.
strategy - The strategy that should be used for broadcasting changes to the listener.

removeOntologyChangeListener

public void removeOntologyChangeListener(OWLOntologyChangeListener listener)
Description copied from interface: OWLOntologyManager
Removes a previously added listener.

Specified by:
removeOntologyChangeListener in interface OWLOntologyManager
Parameters:
listener - The listener to be removed.

makeLoadImportRequest

public void makeLoadImportRequest(OWLImportsDeclaration declaration)
                           throws OWLOntologyCreationException
Description copied from interface: OWLOntologyManager
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.

Specified by:
makeLoadImportRequest in interface OWLOntologyManager
Parameters:
declaration - The declaration that describes the import to be loaded.
Throws:
OWLOntologyCreationException

setSilentMissingImportsHandling

public void setSilentMissingImportsHandling(boolean b)
Description copied from interface: OWLOntologyManager
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.

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

isSilentMissingImportsHandling

public boolean isSilentMissingImportsHandling()
Description copied from interface: OWLOntologyManager
Determines if silent missing imports handling is enabled.

Specified by:
isSilentMissingImportsHandling in interface OWLOntologyManager
Returns:
true if silent missing imports handler is enabled, otherwise false.

addMissingImportListener

public void addMissingImportListener(MissingImportListener listener)
Description copied from interface: OWLOntologyManager
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.

Specified by:
addMissingImportListener in interface OWLOntologyManager
Parameters:
listener - The listener to be added.

removeMissingImportListener

public void removeMissingImportListener(MissingImportListener listener)
Description copied from interface: OWLOntologyManager
Removes a previously added missing import listener.

Specified by:
removeMissingImportListener in interface OWLOntologyManager
Parameters:
listener - The listener to be removed.

addOntologyLoaderListener

public void addOntologyLoaderListener(OWLOntologyLoaderListener listener)
Specified by:
addOntologyLoaderListener in interface OWLOntologyManager

removeOntologyLoaderListener

public void removeOntologyLoaderListener(OWLOntologyLoaderListener listener)
Specified by:
removeOntologyLoaderListener in interface OWLOntologyManager