public class OWLOntologyManagerImpl extends Object implements OWLOntologyManager, OWLOntologyFactory.OWLOntologyCreationHandler, Serializable
| Constructor and Description |
|---|
OWLOntologyManagerImpl(OWLDataFactory dataFactory) |
| Modifier and Type | Method and Description |
|---|---|
List<OWLOntologyChange> |
addAxiom(OWLOntology ont,
OWLAxiom axiom)
A convenience method that adds a single axiom to an ontology.
|
List<OWLOntologyChange> |
addAxioms(OWLOntology ont,
Set<? extends OWLAxiom> axioms)
A convenience method that adds a set of axioms to an ontology.
|
void |
addImpendingOntologyChangeListener(ImpendingOWLOntologyChangeListener listener) |
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)
Adds an ontology change progress listener.
|
void |
addOntologyChangesVetoedListener(OWLOntologyChangesVetoedListener listener) |
void |
addOntologyFactory(OWLOntologyFactory factory)
Adds an ontology factory that is capable of creating an ontology given a
particular document IRI.
|
void |
addOntologyLoaderListener(OWLOntologyLoaderListener listener)
Adds an ontology loaded listener to this manager.
|
void |
addOntologyStorer(OWLOntologyStorer storer)
Add an ontology storer.
|
List<OWLOntologyChange> |
applyChange(OWLOntologyChange change)
A convenience method that applies just one change to an ontology that is
managed by this manager.
|
List<OWLOntologyChange> |
applyChanges(List<? extends OWLOntologyChange> changes)
Applies a list of changes to some or all of the ontologies that are
managed by this manager.
|
protected void |
broadcastChanges(List<? extends OWLOntologyChange> changes)
Broadcasts to attached listeners, using the various broadcasting
strategies that were specified for each listener.
|
protected void |
broadcastImpendingChanges(List<? extends OWLOntologyChange> changes) |
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(OWLOntology ontology) |
boolean |
contains(OWLOntologyID id)
Determines if there is an ontology with the specified id that is managed
by this manager
|
boolean |
containsVersion(IRI ontologyVersionIRI)
Determines if there is an ontology with the specified version IRI, 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,
IRI versionIRI)
Deprecated.
|
OWLOntology |
createOntology(IRI ontologyIRI,
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,
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(Set<OWLAxiom> axioms)
Creates a new ontology that is initialised to contain specific axioms.
|
OWLOntology |
createOntology(Set<OWLAxiom> axioms,
IRI iri)
Creates a new ontology that has the specified ontology IRI and is
initialised to contain specific axioms.
|
protected void |
fireBeginChanges(int size) |
protected void |
fireChangeApplied(OWLOntologyChange change) |
protected void |
fireEndChanges() |
protected void |
fireFinishedLoadingEvent(OWLOntologyID ontologyID,
IRI documentIRI,
boolean imported,
OWLOntologyCreationException ex) |
protected void |
fireMissingImportEvent(MissingImportEvent evt) |
protected void |
fireStartedLoadingEvent(OWLOntologyID ontologyID,
IRI documentIRI,
boolean imported) |
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.
|
Set<OWLOntology> |
getImports(OWLOntology ontology)
Gets the set of ontologies that are in the transitive closure of the
directly imports relation.
|
Set<OWLOntology> |
getImportsClosure(OWLOntology ontology)
Gets the imports closure for the specified ontology.
|
protected IRI |
getNextAutoGeneratedIRI() |
Set<OWLOntology> |
getOntologies()
Gets the (possibly empty) set of
OWLOntology objects contained within
this object. |
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
|
IRI |
getOntologyDocumentIRI(OWLOntology ontology)
Gets the document IRI for a given ontology.
|
Collection<OWLOntologyFactory> |
getOntologyFactories()
Gets the ontology factories that are registered with this manager.
|
OWLOntologyFormat |
getOntologyFormat(OWLOntology ontology)
Gets the ontology format for the specified ontology.
|
Set<OWLOntologyID> |
getOntologyIDsByVersion(IRI ontologyVersionIRI)
Gets a set of OWLOntologyIDs representing ontologies that are managed by
this manager.
|
OWLDataFactory |
getOWLDataFactory()
Gets a data factory which can be used to create OWL API objects such as
classes, properties, individuals, axioms etc.
|
OWLOntologyManagerProperties |
getProperties()
Deprecated.
|
List<OWLOntology> |
getSortedImportsClosure(OWLOntology ontology)
Gets the topologically ordered imports closure.
|
Set<OWLOntology> |
getVersions(IRI ontology)
Gets the versions (if any) of the ontology that have the specified IRI
|
protected void |
installDefaultOntologyFactories() |
protected void |
installDefaultURIMappers() |
boolean |
isSilentMissingImportsHandling()
Determines if silent missing imports handling is enabled.
|
protected OWLOntology |
loadImports(OWLImportsDeclaration declaration,
OWLOntologyLoaderConfiguration configuration) |
OWLOntology |
loadOntology(IRI ontologyIRI)
Loads an ontology that is assumed to have the specified
ontologyIRI as its IRI or version IRI. |
protected OWLOntology |
loadOntology(IRI ontologyIRI,
boolean allowExists,
OWLOntologyLoaderConfiguration configuration) |
protected OWLOntology |
loadOntology(IRI ontologyIRI,
OWLOntologyDocumentSource documentSource,
OWLOntologyLoaderConfiguration configuration)
This is the method that all the other load method delegate to.
|
OWLOntology |
loadOntologyFromOntologyDocument(File file)
Loads an ontology from an ontology document contained in a local file.
|
OWLOntology |
loadOntologyFromOntologyDocument(InputStream inputStream)
Loads an ontology from an ontology document obtained from an input
stream.
|
OWLOntology |
loadOntologyFromOntologyDocument(IRI documentIRI)
Loads an ontology from an ontology document specified by an IRI.
|
OWLOntology |
loadOntologyFromOntologyDocument(OWLOntologyDocumentSource documentSource)
A convenience method that load an ontology from an input source.
|
OWLOntology |
loadOntologyFromOntologyDocument(OWLOntologyDocumentSource documentSource,
OWLOntologyLoaderConfiguration config)
A convenience method that load an ontology from an input source with
specified configuration.
|
void |
makeLoadImportRequest(OWLImportsDeclaration declaration)
Requests that the manager loads an imported ontology that is described by
an imports statement.
|
void |
makeLoadImportRequest(OWLImportsDeclaration declaration,
OWLOntologyLoaderConfiguration configuration)
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.
|
List<OWLOntologyChange> |
removeAxiom(OWLOntology ont,
OWLAxiom axiom)
A convenience method that removes a single axiom from an ontology.
|
List<OWLOntologyChange> |
removeAxioms(OWLOntology ont,
Set<? extends OWLAxiom> axioms)
A convenience method that removes a set of axioms from an ontology.
|
void |
removeImpendingOntologyChangeListener(ImpendingOWLOntologyChangeListener listener) |
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 |
removeOntology(OWLOntologyID ontologyID)
Attempts to remove an ontology.
|
void |
removeOntologyChangeListener(OWLOntologyChangeListener listener)
Removes a previously added listener.
|
void |
removeOntologyChangeProgessListener(OWLOntologyChangeProgressListener listener)
Removes a previously added ontology change listener.
|
void |
removeOntologyChangesVetoedListener(OWLOntologyChangesVetoedListener listener) |
void |
removeOntologyFactory(OWLOntologyFactory factory)
Removes a previously added factory.
|
void |
removeOntologyLoaderListener(OWLOntologyLoaderListener listener)
Removes a previously added ontology loaded listener.
|
void |
removeOntologyStorer(OWLOntologyStorer storer)
Removes a previously added storer
|
protected void |
resetImportsClosureCache() |
void |
saveOntology(OWLOntology ontology)
Saves the specified ontology.
|
void |
saveOntology(OWLOntology ontology,
IRI documentIRI)
Saves the specified ontology, using the specified document IRI to
determine where/how the ontology should be saved.
|
void |
saveOntology(OWLOntology ontology,
OutputStream outputStream)
Saves the specified ontology, to the specified output stream
|
void |
saveOntology(OWLOntology ontology,
OWLOntologyDocumentTarget documentTarget)
Saves the specified ontology to the specified
OWLOntologyDocumentTarget. |
void |
saveOntology(OWLOntology ontology,
OWLOntologyFormat ontologyFormat)
Saves the specified ontology in the specified ontology format to its
document URI.
|
void |
saveOntology(OWLOntology ontology,
OWLOntologyFormat ontologyFormat,
IRI documentIRI)
Saves the specified ontology to the specified document IRI in the
specified ontology format.
|
void |
saveOntology(OWLOntology ontology,
OWLOntologyFormat ontologyFormat,
OutputStream outputStream)
Saves the specified ontology to the specified output stream in the
specified ontology format.
|
void |
saveOntology(OWLOntology ontology,
OWLOntologyFormat ontologyFormat,
OWLOntologyDocumentTarget documentTarget)
Saves the specified ontology to the specified output target in the
specified ontology format.
|
void |
setDefaultChangeBroadcastStrategy(OWLOntologyChangeBroadcastStrategy strategy)
Sets the default strategy that is used to broadcast ontology changes.
|
void |
setOntologyDocumentIRI(OWLOntology ontology,
IRI documentIRI)
Overrides the current document IRI for a given ontology.
|
void |
setOntologyFormat(OWLOntology ontology,
OWLOntologyFormat format)
Sets the format for the specified ontology.
|
void |
setSilentMissingImportsHandling(boolean b)
The default behaviour when an import cannot be loaded is to throw an
exception.
|
protected final Map<OWLOntologyID,OWLOntology> ontologiesByID
protected final Map<OWLOntologyID,IRI> documentIRIsByID
protected final Map<OWLOntologyID,OWLOntologyFormat> ontologyFormatsByOntology
protected final Map<OWLImportsDeclaration,OWLOntologyID> ontologyIDsByImportsDeclaration
protected final List<OWLOntologyIRIMapper> documentMappers
protected final List<OWLOntologyFactory> ontologyFactories
protected final List<OWLOntologyStorer> ontologyStorers
protected AtomicInteger loadCount
protected AtomicInteger importsLoadCount
@Deprecated protected boolean silentMissingImportsHandling
protected final OWLDataFactory dataFactory
protected final Map<OWLOntologyID,Set<OWLOntology>> importsClosureCache
protected final OWLOntologyManagerProperties properties
protected final List<MissingImportListener> missingImportsListeners
protected final List<OWLOntologyLoaderListener> loaderListeners
protected final List<OWLOntologyChangeProgressListener> progressListeners
protected final AtomicLong autoGeneratedURICounter
protected OWLOntologyChangeBroadcastStrategy defaultChangeBroadcastStrategy
protected final ImpendingOWLOntologyChangeBroadcastStrategy defaultImpendingChangeBroadcastStrategy
public OWLOntologyManagerImpl(OWLDataFactory dataFactory)
dataFactory - data factory@Deprecated public OWLOntologyManagerProperties getProperties()
public OWLDataFactory getOWLDataFactory()
OWLOntologyManagergetOWLDataFactory in interface HasDataFactorygetOWLDataFactory in interface OWLOntologyManagerpublic Set<OWLOntology> getOntologies()
HasGetOntologiesOWLOntology objects contained within
this object.getOntologies in interface HasGetOntologiesgetOntologies in interface OWLOntologyManagernull.public Set<OWLOntology> getOntologies(OWLAxiom axiom)
OWLOntologyManagergetOntologies in interface OWLOntologyManageraxiom - The axiomspublic boolean contains(OWLOntology ontology)
public boolean contains(IRI ontologyIRI)
OWLOntologyManagercontains in interface OWLOntologyManagerontologyIRI - The IRI of the ontology to test for (the version IRI is assumed to
be null)true if there is an ontology with the specified IRI, and
no version IRI, that is managed by this manager, otherwise
false.public boolean contains(OWLOntologyID id)
OWLOntologyManagercontains in interface HasContainsOntologycontains in interface OWLOntologyManagerid - The id of the ontology to test fortrue if there is an ontology with the specified id that
is managed by this manager, otherwise false.public boolean containsVersion(IRI ontologyVersionIRI)
OWLOntologyManagercontainsVersion in interface OWLOntologyManagerontologyVersionIRI - The version IRI of the ontology to test for (the ontology IRI may
be anything)true if there is an ontology with the specified version
IRI, that is managed by this manager, otherwise false.public Set<OWLOntologyID> getOntologyIDsByVersion(IRI ontologyVersionIRI)
OWLOntologyManagergetOntologyIDsByVersion in interface OWLOntologyManagerontologyVersionIRI - The version IRI to match against all of the known ontologies.public OWLOntology getOntology(IRI ontologyIRI)
OWLOntologyManagergetOntology in interface OWLOntologyManagerontologyIRI - The IRI of the ontology to be retrieved.null if this manager does not manage an ontology with the
specified IRI and no version IRI.public OWLOntology getOntology(OWLOntologyID ontologyID)
OWLOntologyManagergetOntology in interface HasGetOntologyByIdgetOntology in interface OWLOntologyManagerontologyID - The ID of the ontology to retrievenull if this
manager does not manage an ontology with the specified ontology
ID.public Set<OWLOntology> getVersions(IRI ontology)
OWLOntologyManagergetVersions in interface OWLOntologyManagerontology - The ontology IRIpublic OWLOntology getImportedOntology(OWLImportsDeclaration declaration)
OWLOntologyManagergetImportedOntology in interface OWLOntologyManagerdeclaration - 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 loaded or has been
removed from this managerpublic Set<OWLOntology> getDirectImports(OWLOntology ontology) throws UnknownOWLOntologyException
OWLOntologyManagergetDirectImports in interface OWLOntologyManagerontology - The ontology whose direct imports are to be retrieved.UnknownOWLOntologyExceptionpublic Set<OWLOntology> getImports(OWLOntology ontology) throws UnknownOWLOntologyException
OWLOntologyManagergetImports in interface OWLOntologyManagerontology - The ontology whose imports are to be retrieved.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.
If the ontology is not managed by this manager then the empty set
will be returned.UnknownOWLOntologyExceptionpublic Set<OWLOntology> getImportsClosure(OWLOntology ontology)
OWLOntologyManagergetImportsClosure in interface OWLOntologyManagerontology - 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. If the ontology is not managed by this manager then
the empty set will be returned.public List<OWLOntology> getSortedImportsClosure(OWLOntology ontology) throws UnknownOWLOntologyException
OWLOntologyManagergetSortedImportsClosure in interface OWLOntologyManagerontology - The ontology whose imports closure is to be determined.UnknownOWLOntologyExceptionpublic List<OWLOntologyChange> applyChanges(List<? extends OWLOntologyChange> changes)
OWLOntologyManagerapplyChanges in interface HasApplyChangesapplyChanges in interface OWLOntologyManagerchanges - The changes to be applied.public List<OWLOntologyChange> addAxiom(OWLOntology ont, OWLAxiom axiom)
OWLOntologyManageraddAxiom in interface OWLOntologyManageront - The ontology to add the axiom to.axiom - The axiom to be addedpublic List<OWLOntologyChange> addAxioms(OWLOntology ont, Set<? extends OWLAxiom> axioms)
OWLOntologyManageraddAxioms in interface HasAddAxiomsaddAxioms in interface OWLOntologyManageront - The ontology to which the axioms should be added.axioms - The axioms to be added.public List<OWLOntologyChange> removeAxiom(OWLOntology ont, OWLAxiom axiom)
OWLOntologyManagerremoveAxiom in interface OWLOntologyManageront - The ontology to remove the axiom from.axiom - The axiom to be removedpublic List<OWLOntologyChange> removeAxioms(OWLOntology ont, Set<? extends OWLAxiom> axioms)
OWLOntologyManagerremoveAxioms in interface OWLOntologyManageront - The ontology from which the axioms should be removed.axioms - The axioms to be removed.public List<OWLOntologyChange> applyChange(OWLOntologyChange change)
OWLOntologyManagerapplyChange in interface OWLOntologyManagerchange - The change to be appliedpublic void ontologyCreated(OWLOntology ontology)
OWLOntologyFactory.OWLOntologyCreationHandlerontologyCreated in interface OWLOntologyFactory.OWLOntologyCreationHandlerontology - The newly created ontology.public void setOntologyFormat(OWLOntology ontology, OWLOntologyFormat format)
OWLOntologyManagersetOntologyFormat in interface OWLOntologyFactory.OWLOntologyCreationHandlersetOntologyFormat in interface OWLOntologyManagerontology - The ontology whose format is to be set.format - The format for the specified ontology.public OWLOntologyFormat getOntologyFormat(OWLOntology ontology)
OWLOntologyManagergetOntologyFormat in interface OWLOntologyManagerontology - The ontology whose format it to be obtained.public OWLOntology createOntology() throws OWLOntologyCreationException
OWLOntologyManagercreateOntology in interface OWLOntologyManagerOWLOntologyCreationException - if there was a problem creating the ontologypublic OWLOntology createOntology(IRI ontologyIRI) throws OWLOntologyCreationException
OWLOntologyManagerOWLOntologyIRIMappers. If no mappers
are installed or the ontology IRI was not mapped to a document IRI by any
of the installed mappers, then the ontology document IRI will be set to
the value of ontologyIRI.createOntology in interface OWLOntologyManagerontologyIRI - The IRI of the ontology to be created. The ontology IRI will be
mapped to a document 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.OWLOntologyCreationException - If the ontology could not be created.OWLOntologyAlreadyExistsException - if the manager already contains an ontology with the specified
ontologyIRI (and no version IRI).OWLOntologyDocumentAlreadyExistsException - if the specified ontologyIRI is mapped to a ontology
document IRI for which there already exists a mapping in this
manager.@Deprecated public OWLOntology createOntology(IRI ontologyIRI, IRI versionIRI) throws OWLOntologyCreationException
OWLOntologyCreationExceptionpublic OWLOntology createOntology(OWLOntologyID ontologyID) throws OWLOntologyCreationException
OWLOntologyManagercreateOntology in interface OWLOntologyManagerontologyID - The ID of the ontology to be created. OWLOntologyIRIMappers. If no
mappers are installed or the ontology IRI was not mapped to a
document IRI by any of the installed mappers, then the ontology
document IRI will be set to the value of ontologyIRI.OWLOntologyCreationException - If the ontology could not be created.OWLOntologyAlreadyExistsException - if the manager already contains an ontology with the specified
ontologyID (and no version IRI).OWLOntologyDocumentAlreadyExistsException - if the specified ontologyID is mapped to a ontology
document IRI for which there already exists a mapping in this
manager.public OWLOntology createOntology(IRI ontologyIRI, Set<OWLOntology> ontologies) throws OWLOntologyCreationException
OWLOntologyManagerOWLOntologyIRIMappers. If no mappers
are installed or the ontology IRI was not mapped to a document IRI by any
of the installed mappers, then the ontology document IRI will be set to
the value of ontologyIRI.createOntology in interface OWLOntologyManagerontologyIRI - The IRI of the new ontology.ontologies - The ontologies whose axioms should be copied into the new ontologyOWLOntologyCreationException - if there was a problem creating the new ontology, if the new
ontology already exists in this manager.OWLOntologyAlreadyExistsException - if the manager already contains an ontology with the specified
ontologyIRI (and no version IRI).OWLOntologyDocumentAlreadyExistsException - if the specified ontologyIRI is mapped to a ontology
document IRI for which there already exists a mapping in this
manager.public OWLOntology createOntology(IRI ontologyIRI, Set<OWLOntology> ontologies, boolean copyLogicalAxiomsOnly) throws OWLOntologyCreationException
OWLOntologyManagerOWLOntologyIRIMappers. If no mappers
are installed or the ontology IRI was not mapped to a document IRI by any
of the installed mappers, then the ontology document IRI will be set to
the value of ontologyIRI.createOntology in interface OWLOntologyManagerontologyIRI - The IRI of the new ontology.ontologies - The ontologies whose axioms should be copied into the new ontologycopyLogicalAxiomsOnly - 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.OWLOntologyCreationException - if there was a problem creating the new ontology, if the new
ontology already exists in this manager.OWLOntologyAlreadyExistsException - if the manager already contains an ontology with the specified
ontologyIRI (and no ontology version IRI).OWLOntologyDocumentAlreadyExistsException - if the specified ontologyIRI is mapped to a ontology
document IRI for which there already exists a mapping in this
manager.public OWLOntology createOntology(Set<OWLAxiom> axioms, IRI iri) throws OWLOntologyCreationException
OWLOntologyManagercreateOntology in interface OWLOntologyManageraxioms - The axioms that should be copied into the new ontologyiri - The IRI of the new ontology. OWLOntologyIRIMappers. If no
mappers are installed or the ontology IRI was not mapped to a
document IRI by any of the installed mappers, then the ontology
document IRI will be set to the value of ontologyIRI.OWLOntologyCreationException - if there was a problem creating the new ontology, if the new
ontology already exists in this manager.OWLOntologyAlreadyExistsException - if the manager already contains an ontology with the specified
ontologyIRI.OWLOntologyDocumentAlreadyExistsException - if the specified ontologyIRI is mapped to a ontology
document IRI for which there already exists a mapping in this
manager.public OWLOntology createOntology(Set<OWLAxiom> axioms) throws OWLOntologyCreationException
OWLOntologyManagercreateOntology in interface OWLOntologyManageraxioms - The axioms that should be copied into the new ontologyOWLOntologyCreationException - if there was a problem creating the new ontology.protected IRI getNextAutoGeneratedIRI()
public OWLOntology loadOntology(IRI ontologyIRI) throws OWLOntologyCreationException
OWLOntologyManagerontologyIRI as its IRI or version IRI. OWLOntologyIRIMapper
objects. By default, if no custom OWLOntologyIRIMappers have been
registered using the OWLOntologyManager.addIRIMapper(OWLOntologyIRIMapper) method,
or no mapping can be found, the ontology document IRI is taken to be the
specified ontology IRI.loadOntology in interface OWLOntologyManagerontologyIRI - The IRI that identifies the ontology. It is expected that the
ontology will also have this IRI (although the OWL API will
tolerated situations where this is not the case).OWLOntology representation of the ontology that was
loaded.OWLOntologyCreationException - If there was a problem in creating and loading the ontology.UnparsableOntologyException - if the ontology was being parsed from a document and the document
contained syntax errors.UnloadableImportException - if the ontology imports ontologies and one of the imports could
not be loaded for what ever reason. If the
MissingImportHandlingStrategy is set to
MissingImportHandlingStrategy.SILENT then this exception
will not be thrown. The UnloadableImportException
contains information about the import declaration that triggered
the import and the cause of this exception is an
OWLOntologyCreationException which contains information
about why the import could not be loaded.OWLOntologyCreationIOException - if there was an IOException when trying to load the
ontology.OWLOntologyAlreadyExistsException - if the manager already contains an ontology with the specified
ontologyIRI (where the ontology doesn't have a version
IRI).OWLOntologyDocumentAlreadyExistsException - if the specified ontologyIRI is mapped to a ontology
document IRI for which there already exists a mapping in this
manager.protected OWLOntology loadOntology(IRI ontologyIRI, boolean allowExists, OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException
OWLOntologyCreationExceptionpublic OWLOntology loadOntologyFromOntologyDocument(IRI documentIRI) throws OWLOntologyCreationException
OWLOntologyManagerOWLOntologyManager.loadOntology(IRI) method, no mapping is
performed on the specified IRI.loadOntologyFromOntologyDocument in interface OWLOntologyManagerdocumentIRI - The ontology document IRI where the ontology will be loaded from.OWLOntologyCreationException - If there was a problem in creating and loading the ontology.UnparsableOntologyException - if the ontology was being parsed from a document and the document
contained syntax errors.UnloadableImportException - if the ontology imports ontologies and one of the imports could
not be loaded for what ever reason. If the
MissingImportHandlingStrategy is set to
MissingImportHandlingStrategy.SILENT then this exception
will not be thrown. The UnloadableImportException
contains information about the import declaration that triggered
the import and the cause of this exception is an
OWLOntologyCreationException which contains information
about why the import could not be loaded.OWLOntologyCreationIOException - if there was an IOException when trying to load the
ontology.OWLOntologyDocumentAlreadyExistsException - if the specified documentIRI is already the document IRI
for a loaded ontology.OWLOntologyAlreadyExistsException - if the manager already contains an ontology whose ontology IRI
and version IRI is the same as the ontology IRI and version IRI
of the ontology contained in the document pointed to by
documentIRI.public OWLOntology loadOntologyFromOntologyDocument(OWLOntologyDocumentSource documentSource) throws OWLOntologyCreationException
OWLOntologyManagerloadOntologyFromOntologyDocument in interface OWLOntologyManagerdocumentSource - The input source that describes where the ontology should be
loaded from.OWLOntologyCreationException - If there was a problem in creating and loading the ontology.UnparsableOntologyException - if the ontology was being parsed from a document and the document
contained syntax errors.UnloadableImportException - if the ontology imports ontologies and one of the imports could
not be loaded for what ever reason. If the
MissingImportHandlingStrategy is set to
MissingImportHandlingStrategy.SILENT then this exception
will not be thrown. The UnloadableImportException
contains information about the import declaration that triggered
the import and the cause of this exception is an
OWLOntologyCreationException which contains information
about why the import could not be loaded.OWLOntologyCreationIOException - if there was an IOException when trying to load the
ontology.OWLOntologyDocumentAlreadyExistsException - if the document IRI of the input source is already the document
IRI for a loaded ontology.OWLOntologyAlreadyExistsException - if the manager already contains an ontology whose ontology IRI
and version IRI is the same as the ontology IRI and version IRI
of the ontology contained in the document represented by the
input source.public OWLOntology loadOntologyFromOntologyDocument(OWLOntologyDocumentSource documentSource, OWLOntologyLoaderConfiguration config) throws OWLOntologyCreationException
OWLOntologyManagerloadOntologyFromOntologyDocument in interface OWLOntologyManagerdocumentSource - The input source that describes where the ontology should be
loaded from.config - the configuration to useOWLOntologyCreationException - If there was a problem in creating and loading the ontology.UnparsableOntologyException - if the ontology was being parsed from a document and the document
contained syntax errors.UnloadableImportException - if the ontology imports ontologies and one of the imports could
not be loaded for what ever reason. If the
MissingImportHandlingStrategy is set to
MissingImportHandlingStrategy.SILENT then this exception
will not be thrown. The UnloadableImportException
contains information about the import declaration that triggered
the import and the cause of this exception is an
OWLOntologyCreationException which contains information
about why the import could not be loaded.OWLOntologyCreationIOException - if there was an IOException when trying to load the
ontology.OWLOntologyDocumentAlreadyExistsException - if the document IRI of the input source is already the document
IRI for a loaded ontology.OWLOntologyAlreadyExistsException - if the manager already contains an ontology whose ontology IRI
and version IRI is the same as the ontology IRI and version IRI
of the ontology contained in the document represented by the
input source.public OWLOntology loadOntologyFromOntologyDocument(File file) throws OWLOntologyCreationException
OWLOntologyManagerloadOntologyFromOntologyDocument in interface OWLOntologyManagerfile - The file that contains a representation of an ontologyOWLOntologyCreationException - If there was a problem in creating and loading the ontology.UnparsableOntologyException - if the ontology could not be parsed.UnloadableImportException - if the ontology imports ontologies and one of the imports could
not be loaded for what ever reason. If the
MissingImportHandlingStrategy is set to
MissingImportHandlingStrategy.SILENT then this exception
will not be thrown. The UnloadableImportException
contains information about the import declaration that triggered
the import and the cause of this exception is an
OWLOntologyCreationException which contains information
about why the import could not be loaded.OWLOntologyCreationIOException - if there was an IOException when trying to load the
ontology.OWLOntologyDocumentAlreadyExistsException - if the IRI of the specified file is already the document IRI for
a loaded ontology.OWLOntologyAlreadyExistsException - if the manager already contains an ontology whose ontology IRI
and version IRI is the same as the ontology IRI and version IRI
of the ontology contained in the document pointed to by
documentIRI.public OWLOntology loadOntologyFromOntologyDocument(InputStream inputStream) throws OWLOntologyCreationException
OWLOntologyManagerloadOntologyFromOntologyDocument in interface OWLOntologyManagerinputStream - The input stream that can be used to obtain a representation of an
ontologyOWLOntologyCreationException - If there was a problem in creating and loading the ontology.UnparsableOntologyException - if the ontology could not be parsed.UnloadableImportException - if the ontology imports ontologies and one of the imports could
not be loaded for what ever reason. If the
MissingImportHandlingStrategy is set to
MissingImportHandlingStrategy.SILENT then this exception
will not be thrown. The UnloadableImportException
contains information about the import declaration that triggered
the import and the cause of this exception is an
OWLOntologyCreationException which contains information
about why the import could not be loaded.OWLOntologyCreationIOException - if there was an IOException when trying to load the
ontology.OWLOntologyAlreadyExistsException - if the manager already contains an ontology whose ontology IRI
and version IRI is the same as the ontology IRI and version IRI
of the ontology obtained from parsing the content of the input
stream.protected OWLOntology loadOntology(IRI ontologyIRI, OWLOntologyDocumentSource documentSource, OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException
ontologyIRI - The URI of the ontology to be loaded. This is only used to report
to listeners and may be nulldocumentSource - The input source that specifies where the ontology should be
loaded from.configuration - load configurationOWLOntologyCreationException - If the ontology could not be loaded.public void removeOntology(OWLOntology ontology)
OWLOntologyManagerremoveOntology in interface OWLOntologyManagerontology - The ontology to be removed. If this manager does not manage the
ontology then nothing happens.public void removeOntology(OWLOntologyID ontologyID)
OWLOntologyManagerremoveOntology in interface OWLOntologyManagerontologyID - The ontology to be removed. If this manager does not manage the
ontology then nothing happens.public IRI getOntologyDocumentIRI(OWLOntology ontology) throws UnknownOWLOntologyException
OWLOntologyManagergetOntologyDocumentIRI in interface OWLOntologyManagerontology - The ontology whose document IRI is to be obtained.null.UnknownOWLOntologyException - If the specified ontology is not managed by this manager.public void setOntologyDocumentIRI(OWLOntology ontology, IRI documentIRI) throws UnknownOWLOntologyException
OWLOntologyManagersetOntologyDocumentIRI in interface OWLOntologyManagerontology - The ontology that has already been loaded.documentIRI - The new ontology document IRIUnknownOWLOntologyException - If the specified ontology is not managed by this manager.protected void resetImportsClosureCache()
public void saveOntology(OWLOntology ontology) throws OWLOntologyStorageException, UnknownOWLOntologyException
OWLOntologyManagersaveOntology in interface OWLOntologyManagerontology - 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 - if this manager does not manage the specified ontologypublic void saveOntology(OWLOntology ontology, OWLOntologyFormat ontologyFormat) throws OWLOntologyStorageException, UnknownOWLOntologyException
OWLOntologyManagersaveOntology in interface OWLOntologyManagerontology - The ontology to be saved.ontologyFormat - The format in which the ontology should be saved.OWLOntologyStorageException - If the ontology cannot be saved.UnknownOWLOntologyException - if the specified ontology is not managed by this managerpublic void saveOntology(OWLOntology ontology, IRI documentIRI) throws OWLOntologyStorageException, UnknownOWLOntologyException
OWLOntologyManagersaveOntology in interface OWLOntologyManagerontology - The ontology to be saved.documentIRI - The document IRI where the ontology should be saved toOWLOntologyStorageException - If the ontology cannot be savedUnknownOWLOntologyException - if the specified ontology is not managed by this manager.public void saveOntology(OWLOntology ontology, OWLOntologyFormat ontologyFormat, IRI documentIRI) throws OWLOntologyStorageException, UnknownOWLOntologyException
OWLOntologyManagersaveOntology in interface OWLOntologyManagerontology - The ontology to be savedontologyFormat - The format in which to save the ontologydocumentIRI - The document IRI where the ontology should be saved toOWLOntologyStorageException - If the ontology could not be saved.UnknownOWLOntologyException - if the specified ontology is not managed by the manager.public void saveOntology(OWLOntology ontology, OutputStream outputStream) throws OWLOntologyStorageException
OWLOntologyManagersaveOntology in interface OWLOntologyManagerontology - The ontology to be saved.outputStream - The output stream where the ontology will be saved toOWLOntologyStorageException - If there was a problem saving this ontology to the specified
output streampublic void saveOntology(OWLOntology ontology, OWLOntologyFormat ontologyFormat, OutputStream outputStream) throws OWLOntologyStorageException
OWLOntologyManagersaveOntology in interface OWLOntologyManagerontology - The ontology to be savedontologyFormat - The format in which to save the ontologyoutputStream - The output stream where the ontology will be saved to.OWLOntologyStorageException - If the ontology could not be saved.public void saveOntology(OWLOntology ontology, OWLOntologyDocumentTarget documentTarget) throws OWLOntologyStorageException, UnknownOWLOntologyException
OWLOntologyManagerOWLOntologyDocumentTarget.saveOntology in interface OWLOntologyManagerontology - The ontology to be saved.documentTarget - The output target where the ontology will be saved to.OWLOntologyStorageException - If the ontology could not be saved.UnknownOWLOntologyException - if the specified ontology is not managed by this manager.public void saveOntology(OWLOntology ontology, OWLOntologyFormat ontologyFormat, OWLOntologyDocumentTarget documentTarget) throws OWLOntologyStorageException, UnknownOWLOntologyException
OWLOntologyManagersaveOntology in interface OWLOntologyManagerontology - The ontology to be saved.ontologyFormat - The output format in which to save the ontologydocumentTarget - The output target where the ontology will be saved toOWLOntologyStorageException - If the ontology could not be saved.UnknownOWLOntologyException - If the specified ontology is not managed by this manager.public void addOntologyStorer(OWLOntologyStorer storer)
OWLOntologyManageraddOntologyStorer in interface OWLOntologyManagerstorer - The storer to be addedpublic void removeOntologyStorer(OWLOntologyStorer storer)
OWLOntologyManagerremoveOntologyStorer in interface OWLOntologyManagerstorer - The storer to be removedpublic void addIRIMapper(OWLOntologyIRIMapper mapper)
OWLOntologyManageraddIRIMapper in interface OWLOntologyManagermapper - The mapper to be added.public void clearIRIMappers()
OWLOntologyManagerclearIRIMappers in interface OWLOntologyManagerpublic void removeIRIMapper(OWLOntologyIRIMapper mapper)
OWLOntologyManagerremoveIRIMapper in interface OWLOntologyManagermapper - The mapper to be removed. If this manager does not managed the
specified mapper then nothing will happen.public void addOntologyFactory(OWLOntologyFactory factory)
OWLOntologyManageraddOntologyFactory in interface OWLOntologyManagerfactory - The factory to be added.public void removeOntologyFactory(OWLOntologyFactory factory)
OWLOntologyManagerremoveOntologyFactory in interface OWLOntologyManagerfactory - The factory to be removed.public Collection<OWLOntologyFactory> getOntologyFactories()
OWLOntologyManagergetOntologyFactories in interface OWLOntologyManagerprotected void installDefaultURIMappers()
protected void installDefaultOntologyFactories()
public void addOntologyChangeListener(OWLOntologyChangeListener listener)
OWLOntologyManageraddOntologyChangeListener method which takes a broadcast strategy
as an argument should be used.addOntologyChangeListener in interface OWLOntologyManagerlistener - The listener to be added.protected void broadcastChanges(List<? extends OWLOntologyChange> changes)
changes - The ontology changes to broadcastprotected void broadcastImpendingChanges(List<? extends OWLOntologyChange> changes) throws OWLOntologyChangeVetoException
OWLOntologyChangeVetoExceptionpublic void setDefaultChangeBroadcastStrategy(OWLOntologyChangeBroadcastStrategy strategy)
OWLOntologyManagersetDefaultChangeBroadcastStrategy in interface OWLOntologyManagerstrategy - The strategy to be used for broadcasting changes. This strategy
will override any previously set broadcast strategy. The strategy
should not be null.DefaultChangeBroadcastStrategy,
EDTChangeBroadcastStrategypublic void addOntologyChangeListener(OWLOntologyChangeListener listener, OWLOntologyChangeBroadcastStrategy strategy)
OWLOntologyManageraddOntologyChangeListener in interface OWLOntologyManagerlistener - The listener to be added.strategy - The strategy that should be used for broadcasting changes to the
listener.public void addImpendingOntologyChangeListener(ImpendingOWLOntologyChangeListener listener)
addImpendingOntologyChangeListener in interface OWLOntologyManagerlistener - the listener to addpublic void removeImpendingOntologyChangeListener(ImpendingOWLOntologyChangeListener listener)
removeImpendingOntologyChangeListener in interface OWLOntologyManagerlistener - the listener to removepublic void removeOntologyChangeListener(OWLOntologyChangeListener listener)
OWLOntologyManagerremoveOntologyChangeListener in interface OWLOntologyManagerlistener - The listener to be removed.public void addOntologyChangesVetoedListener(OWLOntologyChangesVetoedListener listener)
addOntologyChangesVetoedListener in interface OWLOntologyManagerlistener - the listener to addpublic void removeOntologyChangesVetoedListener(OWLOntologyChangesVetoedListener listener)
removeOntologyChangesVetoedListener in interface OWLOntologyManagerlistener - the listener to removeprotected OWLOntology loadImports(OWLImportsDeclaration declaration, OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException
OWLOntologyCreationExceptionpublic void makeLoadImportRequest(OWLImportsDeclaration declaration) throws UnloadableImportException
OWLOntologyManagermakeLoadImportRequest in interface OWLOntologyManagerdeclaration - The declaration that describes the import to be loaded.UnloadableImportException - if there was a problem creating and loading the import and silent
missing imports handling is not turned on. If silent missing
import handling is turned on then this exception will not be
thrown.public void makeLoadImportRequest(OWLImportsDeclaration declaration, OWLOntologyLoaderConfiguration configuration) throws UnloadableImportException
OWLOntologyManagermakeLoadImportRequest in interface OWLOntologyManagerdeclaration - The declaration that describes the import to be loaded.configuration - The configuration object that passes arguments to the mechanism
used for loading.UnloadableImportException - if there was a problem creating and loading the import and silent
missing imports handling is not turned on. If silent missing
import handling is turned on then this exception will not be
thrown.public void setSilentMissingImportsHandling(boolean b)
OWLOntologyManagersetSilentMissingImportsHandling in interface OWLOntologyManagerb - true if loading should continue when an imported ontology
cannot be loaded, other wise false. The default value is
false.public boolean isSilentMissingImportsHandling()
OWLOntologyManagerisSilentMissingImportsHandling in interface OWLOntologyManagertrue if silent missing imports handler is enabled,
otherwise false.public void addMissingImportListener(MissingImportListener listener)
OWLOntologyManageraddMissingImportListener in interface OWLOntologyManagerlistener - The listener to be added.public void removeMissingImportListener(MissingImportListener listener)
OWLOntologyManagerremoveMissingImportListener in interface OWLOntologyManagerlistener - The listener to be removed.protected void fireMissingImportEvent(MissingImportEvent evt)
public void addOntologyLoaderListener(OWLOntologyLoaderListener listener)
OWLOntologyManageraddOntologyLoaderListener in interface OWLOntologyManagerlistener - The listener to be added.public void removeOntologyLoaderListener(OWLOntologyLoaderListener listener)
OWLOntologyManagerremoveOntologyLoaderListener in interface OWLOntologyManagerlistener - The listener to be removed.protected void fireStartedLoadingEvent(OWLOntologyID ontologyID, IRI documentIRI, boolean imported)
protected void fireFinishedLoadingEvent(OWLOntologyID ontologyID, IRI documentIRI, boolean imported, OWLOntologyCreationException ex)
public void addOntologyChangeProgessListener(OWLOntologyChangeProgressListener listener)
OWLOntologyManageraddOntologyChangeProgessListener in interface OWLOntologyManagerlistener - The listener to be added.public void removeOntologyChangeProgessListener(OWLOntologyChangeProgressListener listener)
OWLOntologyManagerremoveOntologyChangeProgessListener in interface OWLOntologyManagerlistener - The listener to be removed.protected void fireBeginChanges(int size)
protected void fireEndChanges()
protected void fireChangeApplied(OWLOntologyChange change)
Copyright © 2014 The University of Manchester. All Rights Reserved.