|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OWLOntologyManager
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 |
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(java.net.URI ontologyURI)
Determines if there is an ontology with the specified URI that is managed by this manager. |
OWLOntology |
createOntology(java.net.URI ontologyURI)
Creates a new (empty) ontology that has the specified ontology URI. |
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. |
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. |
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. |
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 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 |
---|
OWLDataFactory getOWLDataFactory()
java.util.Set<OWLOntology> getOntologies()
getOntologies
in interface OWLOntologySetProvider
boolean contains(java.net.URI ontologyURI)
ontologyURI
- The URI of the ontology to test for
true
if there is an ontology with the specified URI that is managed
by this manager, otherwise false
.OWLOntology getOntology(java.net.URI ontologyURI) throws UnknownOWLOntologyException
ontologyURI
- The URI of the ontology to be obtained (this is not the
physical URI of the ontology).
UnknownOWLOntologyException
- if there isn't an ontology in this manager
which has the specified URI.OWLOntology getImportedOntology(OWLImportsDeclaration declaration)
declaration
- The declaration that points to the imported ontology.
null
if the imports declaration could not be resolved to an ontology, because
the ontology was not imported.java.util.Set<OWLOntology> getImports(OWLOntology ontology) throws UnknownOWLOntologyException
ontology
- The ontology whose direct imports are to be
retrieved.
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.
UnknownOWLOntologyException
- if there isn't an ontology in this manager
which has the specified URI.java.util.Set<OWLOntology> getImportsClosure(OWLOntology ontology) throws UnknownOWLOntologyException
ontology
- The ontology whose imports closure is to be retrieved.
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.
UnknownOWLOntologyException
- if there isn't an ontology in this manager
which has the specified URI.java.util.List<OWLOntologyChange> applyChanges(java.util.List<? extends OWLOntologyChange> changes) throws OWLOntologyChangeException
changes
- The changes to be applied.
OWLOntologyChangeException
- If one or more of the changes could not be applied. See subclasses
of ontology change exception for more specific details.java.util.List<OWLOntologyChange> addAxioms(OWLOntology ont, java.util.Set<? extends OWLAxiom> axioms) throws OWLOntologyChangeException
ont
- The ontology to which the axioms should be added.axioms
- The axioms to be added.
OWLOntologyChangeException
java.util.List<OWLOntologyChange> addAxiom(OWLOntology ont, OWLAxiom axiom) throws OWLOntologyChangeException
ont
- The ontology to add the axiom to.axiom
- The axiom to be added
OWLOntologyChangeException
java.util.List<OWLOntologyChange> applyChange(OWLOntologyChange change) throws OWLOntologyChangeException
change
- The change to be applied
OWLOntologyChangeException
- If the change could not be applied. See subclasses
of ontology change exception for more specific details.OWLOntology createOntology(java.net.URI ontologyURI) throws OWLOntologyCreationException
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.
OWLOntologyCreationException
- If the ontology could not be created.OWLOntology loadOntology(java.net.URI ontologyURI) throws OWLOntologyCreationException
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 OWLOntologyURIMapper
s.
ontologyURI
- The ontology URI (sometimes called logical URI
of the ontology to be loaded)
OWLOntology
representation of the ontology
that was loaded. If an ontology with the specified URI is already loaded
then that ontology will be returned.
OWLOntologyCreationException
- If there was a problem in creating and
loading the ontology.OWLOntology loadOntologyFromPhysicalURI(java.net.URI uri) throws OWLOntologyCreationException
uri
- The physical URI which points to a concrete representation
of an ontology.
OWLOntologyCreationException
- If the ontology could not be created and loaded.OWLOntology loadOntology(OWLOntologyInputSource inputSource) throws OWLOntologyCreationException
inputSource
-
OWLOntologyCreationException
OWLOntology reloadOntology(java.net.URI ontologyURI) throws OWLOntologyCreationException
ontologyURI
- The URI of the ontology to be reloaded.
OWLOntologyCreationException
- If the ontology could not be reloaded.void removeOntology(java.net.URI ontologyURI)
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.java.net.URI getPhysicalURIForOntology(OWLOntology ontology) throws UnknownOWLOntologyException
ontology
- The ontology whose physical URI is to be obtained.
UnknownOWLOntologyException
- If the specified ontology is not managed by this manager.void setPhysicalURIForOntology(OWLOntology ontology, java.net.URI physicalURI) throws UnknownOWLOntologyException
ontology
- The ontology that has already been loaded.physicalURI
- The new physical URI of the ontology.
UnknownOWLOntologyException
- If the specified ontology is not managed by this manager.OWLOntologyFormat getOntologyFormat(OWLOntology ontology) throws UnknownOWLOntologyException
ontology
- The ontology whose format it to be obtained.
UnknownOWLOntologyException
- If the specified ontology is not managed by this manager.void setOntologyFormat(OWLOntology ontology, OWLOntologyFormat ontologyFormat) throws UnknownOWLOntologyException
ontology
- The ontology whose format is to be set.ontologyFormat
- The format for the specified ontology.
UnknownOWLOntologyException
void saveOntology(OWLOntology ontology) throws OWLOntologyStorageException, UnknownOWLOntologyException
ontology
- The ontology to be saved.
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
void saveOntology(OWLOntology ontology, java.net.URI physicalURI) throws OWLOntologyStorageException, UnknownOWLOntologyException
ontology
- The ontology to be saved.physicalURI
- The physical URI which will be used to determine how and where the
ontology will be saved.
OWLOntologyStorageException
- If the ontology cannot be saved.
UnknownOWLOntologyException
void saveOntology(OWLOntology ontology, OWLOntologyFormat ontologyFormat) throws OWLOntologyStorageException, UnknownOWLOntologyException
OWLOntologyStorageException
UnknownOWLOntologyException
void saveOntology(OWLOntology ontology, OWLOntologyFormat ontologyFormat, java.net.URI physcialURI) throws OWLOntologyStorageException, UnknownOWLOntologyException
OWLOntologyStorageException
UnknownOWLOntologyException
void saveOntology(OWLOntology ontology, OWLOntologyOutputTarget outputTarget) throws OWLOntologyStorageException, UnknownOWLOntologyException
OWLOntologyStorageException
UnknownOWLOntologyException
void saveOntology(OWLOntology ontology, OWLOntologyFormat ontologyFormat, OWLOntologyOutputTarget outputTarget) throws OWLOntologyStorageException, UnknownOWLOntologyException
OWLOntologyStorageException
UnknownOWLOntologyException
void addURIMapper(OWLOntologyURIMapper mapper)
mapper
- The mapper to be added.void removeURIMapper(OWLOntologyURIMapper mapper)
mapper
- The mapper to be removed.void clearURIMappers()
void addOntologyFactory(OWLOntologyFactory factory)
factory
- The factory to be added.void removeOntologyFactory(OWLOntologyFactory factory)
factory
- The factory to be removed.void addOntologyStorer(OWLOntologyStorer storer)
storer
- The storer to be addedvoid removeOntologyStorer(OWLOntologyStorer storer)
storer
- The storer to be removedvoid addOntologyChangeListener(OWLOntologyChangeListener listener)
addOntologyChangeListener
method which takes a
broadcast strategy as an argument should be used.
listener
- void addOntologyChangeListener(OWLOntologyChangeListener listener, OWLOntologyChangeBroadcastStrategy strategy)
listener
- The listener to be added.strategy
- The strategy that should be used for broadcasting changes to
the listener.void removeOntologyChangeListener(OWLOntologyChangeListener listener)
listener
- The listener to be removed.void makeLoadImportRequest(OWLImportsDeclaration declaration) throws OWLOntologyCreationException
declaration
- The declaration that describes the import to be loaded.
OWLOntologyCreationException
void setSilentMissingImportsHandling(boolean b)
b
- true
if loading should continue when an imported
ontology cannot be loaded, other wise false
. The default
value is false
.boolean isSilentMissingImportsHandling()
true
if silent missing imports handler is
enabled, otherwise false
.void addMissingImportListener(MissingImportListener listener)
listener
- The listener to be added.void removeMissingImportListener(MissingImportListener listener)
listener
- The listener to be removed.void addOntologyLoaderListener(OWLOntologyLoaderListener listener)
void removeOntologyLoaderListener(OWLOntologyLoaderListener listener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |