public interface OWLOntology extends OWLObject, HasAnnotations, HasDirectImports, HasImportsClosure, HasOntologyID, OWLAxiomCollection, OWLAxiomCollectionBooleanArgs, OWLSignature, OWLSignatureBooleanArgs, OWLAxiomIndex, HasApplyChange, HasApplyChanges, HasDirectAddAxiom, HasDirectAddAxioms, HasDirectRemoveAxiom, HasDirectRemoveAxioms, HasApplyDirectChange
OWLOntology consists of a possibly empty set of
OWLAxioms and a possibly empty set of
OWLAnnotations. An ontology can have an ontology IRI which can be
used to identify the ontology. If it has an ontology IRI then it may also
have an ontology version IRI. Since OWL 2, an ontology need not have an
ontology IRI. (See the OWL 2
Structural Specification An ontology cannot be modified directly. Changes
must be applied via its OWLOntologyManager.| Modifier and Type | Method and Description |
|---|---|
Stream<OWLAxiom> |
aboxAxioms(Imports includeImportsClosure)
Gets the axioms that form the ABox for this ontology, i.e., the ones
whose type is in the AxiomType::ABoxAxiomTypes.
|
default void |
accept(OWLNamedObjectVisitor visitor)
accept for named object visitor
|
default <O> O |
accept(OWLNamedObjectVisitorEx<O> visitor)
Accepts a visitor
|
default void |
accept(OWLObjectVisitor visitor)
Accepts a visitor
|
default <O> O |
accept(OWLObjectVisitorEx<O> visitor)
Accepts a visitor
|
default ChangeApplied |
addAxiom(OWLAxiom axiom)
A convenience method that adds a single axiom to an ontology.
|
default ChangeApplied |
addAxioms(Collection<? extends OWLAxiom> axioms)
A convenience method that adds a set of axioms to an ontology.
|
default ChangeApplied |
addAxioms(OWLAxiom... axioms)
A convenience method that adds a set of axioms to an ontology.
|
default ChangeApplied |
addAxioms(Stream<? extends OWLAxiom> axioms)
A convenience method that adds a set of axioms to an ontology.
|
default ChangeApplied |
applyChange(OWLOntologyChange change)
A convenience method that applies just one change to an ontology that is
managed by this manager.
|
default ChangeDetails |
applyChangesAndGetDetails(List<? extends OWLOntologyChange> changes)
Applies a list ontology changes to a collection of ontologies.
|
default ChangeApplied |
applyDirectChange(OWLOntologyChange change)
A convenience method that applies just one change to this ontology.
|
default Stream<?> |
components() |
Stream<OWLClassAxiom> |
generalClassAxioms()
Gets the set of general axioms in this ontology.
|
default Set<OWLAxiom> |
getABoxAxioms(Imports includeImportsClosure)
Deprecated.
use the stream method
|
default OWLDocumentFormat |
getFormat() |
default Set<OWLClassAxiom> |
getGeneralClassAxioms()
Deprecated.
use the stream method
|
default Set<OWLOntology> |
getImports()
Deprecated.
use the stream method
|
default Set<OWLImportsDeclaration> |
getImportsDeclarations()
Deprecated.
use the stream method
|
default OWLDocumentFormat |
getNonnullFormat()
Gets the ontology format for this ontology, ensuring it is not null (an
error is thrown if the ontology has no format).
|
OWLOntologyManager |
getOWLOntologyManager()
Gets the manager that manages this ontology.
|
default Set<OWLAxiom> |
getRBoxAxioms(Imports includeImportsClosure)
Deprecated.
use the stream method
|
default Set<OWLEntity> |
getSignature(Imports imports)
Deprecated.
use the stream method
|
default Set<OWLAxiom> |
getTBoxAxioms(Imports includeImportsClosure)
Deprecated.
use the stream method
|
default int |
hashIndex() |
Stream<OWLOntology> |
imports()
Gets the set of loaded ontologies that this ontology is related
to via the transitive closure of the
directlyImports
relation.
For example, if this ontology imports ontology B, and ontology B imports ontology C, then this method will return the set consisting of ontology B and ontology C. |
Stream<OWLImportsDeclaration> |
importsDeclarations()
Gets the set of imports declarations for this ontology.
|
default boolean |
isAxiom() |
boolean |
isDeclared(OWLEntity owlEntity)
Determines if this ontology declares an entity i.e.
|
default boolean |
isDeclared(OWLEntity owlEntity,
Imports imports)
Determines if this ontology or its imports closure declares an entity
i.e.
|
boolean |
isEmpty()
Determines if this ontology is empty - an ontology is empty if it does
not contain any axioms (i.e.
|
default boolean |
isIndividual() |
default boolean |
isOntology() |
Stream<OWLAxiom> |
rboxAxioms(Imports includeImportsClosure)
Gets the axioms that form the RBox for this ontology, i.e., the ones
whose type is in the AxiomType::RBoxAxiomTypes.
|
default ChangeApplied |
removeAxiom(OWLAxiom axiom)
A convenience method that removes a single axiom from this object.
|
default ChangeApplied |
removeAxioms(Collection<? extends OWLAxiom> axioms)
A convenience method that removes a set of axioms from this object.
|
default ChangeApplied |
removeAxioms(OWLAxiom... axioms)
A convenience method that removes a set of axioms from this object.
|
default ChangeApplied |
removeAxioms(Stream<? extends OWLAxiom> axioms)
A convenience method that removes a set of axioms from this object.
|
default void |
saveOntology()
Saves the ontology.
|
default void |
saveOntology(IRI documentIRI)
Saves the ontology, using the specified document IRI to determine
where/how the ontology should be saved.
|
default void |
saveOntology(OutputStream outputStream)
Saves the ontology, to the specified output stream
|
default void |
saveOntology(OWLDocumentFormat ontologyFormat)
Saves the ontology in the specified ontology format to its document URI.
|
default void |
saveOntology(OWLDocumentFormat ontologyFormat,
IRI documentIRI)
Saves the ontology to the specified document IRI in the specified
ontology format.
|
default void |
saveOntology(OWLDocumentFormat ontologyFormat,
OutputStream outputStream)
Saves the ontology to the specified output stream in the specified
ontology format.
|
default void |
saveOntology(OWLDocumentFormat ontologyFormat,
OWLOntologyDocumentTarget documentTarget)
Saves the ontology to the specified output target in the specified
ontology format.
|
default void |
saveOntology(OWLOntologyDocumentTarget documentTarget)
Saves the ontology to the specified
OWLOntologyDocumentTarget. |
void |
setOWLOntologyManager(OWLOntologyManager manager)
Sets the manager for this ontology.
|
default Stream<OWLEntity> |
signature(Imports imports)
Gets the entities that are in the signature of this ontology.
|
Stream<OWLAxiom> |
tboxAxioms(Imports includeImportsClosure)
Gets the axioms that form the TBox for this ontology, i.e., the ones
whose type is in the AxiomType::TBoxAxiomTypes.
|
default int |
typeIndex() |
getNestedClassExpressions, hasSharedStructure, isAnonymousExpression, isBottomEntity, isIRI, isTopEntity, nestedClassExpressionscompareTogetSignature, signatureanonymousIndividuals, getAnonymousIndividualsannotationPropertiesInSignature, getAnnotationPropertiesInSignaturecomponentsAnnotationsFirst, componentsWithoutAnnotationsisAnonymousannotations, annotations, annotations, getAnnotations, getAnnotationsdirectImports, directImportsDocuments, getDirectImports, getDirectImportsDocumentsgetOntologyIDcontainsAxiom, containsAxiomIgnoreAnnotations, getAxiomCount, getAxiomCount, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxiomsIgnoreAnnotations, getLogicalAxiomCount, getLogicalAxioms, getReferencingAxiomsaxioms, axioms, axioms, axioms, axioms, axioms, axioms, axioms, axioms, axioms, axioms, axioms, axioms, axioms, axiomsIgnoreAnnotations, axiomsIgnoreAnnotations, containsAxiom, containsAxiomIgnoreAnnotations, getAxiomCount, getAxiomCount, getAxiomCount, getAxiomCount, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxiomsIgnoreAnnotations, getAxiomsIgnoreAnnotations, getLogicalAxiomCount, getLogicalAxiomCount, getLogicalAxioms, getReferencingAxioms, getReferencingAxioms, logicalAxioms, referencingAxioms, referencingAxiomsgetLogicalAxioms, logicalAxiomsaxioms, equalAxioms, getAxiomscontainsAxiomcontainsAnnotationPropertyInSignature, containsClassInSignature, containsDataPropertyInSignature, containsDatatypeInSignature, containsEntityInSignature, containsEntityInSignature, containsIndividualInSignature, containsObjectPropertyInSignature, containsReference, getAnnotationPropertiesInSignature, getClassesInSignature, getDataPropertiesInSignature, getDatatypesInSignature, getEntitiesInSignature, getIndividualsInSignature, getObjectPropertiesInSignature, getReferencedAnonymousIndividualsannotationPropertiesInSignature, classesInSignature, containsAnnotationPropertyInSignature, containsAnnotationPropertyInSignature, containsClassInSignature, containsClassInSignature, containsDataPropertyInSignature, containsDataPropertyInSignature, containsDatatypeInSignature, containsDatatypeInSignature, containsEntityInSignature, containsEntityInSignature, containsEntityInSignature, containsIndividualInSignature, containsIndividualInSignature, containsObjectPropertyInSignature, containsObjectPropertyInSignature, containsReference, containsReference, dataPropertiesInSignature, datatypesInSignature, entitiesInSignature, getAnnotationPropertiesInSignature, getClassesInSignature, getDataPropertiesInSignature, getDatatypesInSignature, getEntitiesInSignature, getIndividualsInSignature, getObjectPropertiesInSignature, getPunnedIRIs, getReferencedAnonymousIndividuals, getReferencedAnonymousIndividuals, individualsInSignature, objectPropertiesInSignature, referencedAnonymousIndividuals, referencedAnonymousIndividualsentitiesInSignature, getEntitiesInSignatureclassesInSignature, getClassesInSignaturegetObjectPropertiesInSignature, objectPropertiesInSignaturedataPropertiesInSignature, getDataPropertiesInSignaturedatatypesInSignature, getDatatypesInSignaturegetIndividualsInSignature, individualsInSignaturecontainsEntityInSignatureannotationAssertionAxioms, annotationAssertionAxioms, annotationPropertyDomainAxioms, annotationPropertyRangeAxioms, asymmetricObjectPropertyAxioms, axioms, axioms, axioms, axioms, axioms, axioms, classAssertionAxioms, classAssertionAxioms, contains, contains, dataPropertyAssertionAxioms, dataPropertyDomainAxioms, dataPropertyRangeAxioms, dataSubPropertyAxiomsForSubProperty, dataSubPropertyAxiomsForSuperProperty, datatypeDefinitions, declarationAxioms, differentIndividualAxioms, disjointClassesAxioms, disjointDataPropertiesAxioms, disjointObjectPropertiesAxioms, disjointUnionAxioms, equivalentClassesAxioms, equivalentDataPropertiesAxioms, equivalentObjectPropertiesAxioms, filterAxioms, filterAxioms, functionalDataPropertyAxioms, functionalObjectPropertyAxioms, getAnnotationAssertionAxioms, getAnnotationAssertionAxioms, getAnnotationPropertyDomainAxioms, getAnnotationPropertyRangeAxioms, getAsymmetricObjectPropertyAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getClassAssertionAxioms, getClassAssertionAxioms, getDataPropertyAssertionAxioms, getDataPropertyDomainAxioms, getDataPropertyRangeAxioms, getDataSubPropertyAxiomsForSubProperty, getDataSubPropertyAxiomsForSuperProperty, getDatatypeDefinitions, getDeclarationAxioms, getDifferentIndividualAxioms, getDisjointClassesAxioms, getDisjointDataPropertiesAxioms, getDisjointObjectPropertiesAxioms, getDisjointUnionAxioms, getEquivalentClassesAxioms, getEquivalentDataPropertiesAxioms, getEquivalentObjectPropertiesAxioms, getFunctionalDataPropertyAxioms, getFunctionalObjectPropertyAxioms, getHasKeyAxioms, getInverseFunctionalObjectPropertyAxioms, getInverseObjectPropertyAxioms, getIrreflexiveObjectPropertyAxioms, getNegativeDataPropertyAssertionAxioms, getNegativeObjectPropertyAssertionAxioms, getObjectPropertyAssertionAxioms, getObjectPropertyDomainAxioms, getObjectPropertyRangeAxioms, getObjectSubPropertyAxiomsForSubProperty, getObjectSubPropertyAxiomsForSuperProperty, getReflexiveObjectPropertyAxioms, getSameIndividualAxioms, getSubAnnotationPropertyOfAxioms, getSubClassAxiomsForSubClass, getSubClassAxiomsForSuperClass, getSymmetricObjectPropertyAxioms, getTransitiveObjectPropertyAxioms, hasKeyAxioms, inverseFunctionalObjectPropertyAxioms, inverseObjectPropertyAxioms, irreflexiveObjectPropertyAxioms, negativeDataPropertyAssertionAxioms, negativeObjectPropertyAssertionAxioms, objectPropertyAssertionAxioms, objectPropertyDomainAxioms, objectPropertyRangeAxioms, objectSubPropertyAxiomsForSubProperty, objectSubPropertyAxiomsForSuperProperty, reflexiveObjectPropertyAxioms, sameIndividualAxioms, subAnnotationPropertyOfAxioms, subClassAxiomsForSubClass, subClassAxiomsForSuperClass, symmetricObjectPropertyAxioms, transitiveObjectPropertyAxiomsapplyChanges, applyChanges, applyChangesAndGetDetailsaddadd, addremoveremove, remove, removedefault boolean isAxiom()
default boolean isIndividual()
isIndividual in interface OWLObjectdefault boolean isOntology()
isOntology in interface OWLObjectdefault Stream<?> components()
components in interface HasComponentsdefault int hashIndex()
hashIndex in interface HasHashIndexdefault int typeIndex()
default ChangeApplied applyChange(OWLOntologyChange change)
HasApplyChangeapplyChange in interface HasApplyChangechange - The change to be applieddefault ChangeApplied applyDirectChange(OWLOntologyChange change)
HasApplyDirectChangeapplyDirectChange in interface HasApplyDirectChangechange - The change to be applieddefault ChangeDetails applyChangesAndGetDetails(List<? extends OWLOntologyChange> changes)
HasApplyChangesapplyChangesAndGetDetails in interface HasApplyChangeschanges - The changes to be applied.default ChangeApplied addAxiom(OWLAxiom axiom)
HasDirectAddAxiomaddAxiom in interface HasDirectAddAxiomaxiom - The axiom to be addeddefault ChangeApplied addAxioms(Collection<? extends OWLAxiom> axioms)
HasDirectAddAxiomsaddAxioms in interface HasDirectAddAxiomsaxioms - The axioms to be added. Not null.default ChangeApplied addAxioms(Stream<? extends OWLAxiom> axioms)
HasDirectAddAxiomsaddAxioms in interface HasDirectAddAxiomsaxioms - The axioms to be added. Not null.default ChangeApplied addAxioms(OWLAxiom... axioms)
HasDirectAddAxiomsaddAxioms in interface HasDirectAddAxiomsaxioms - The axioms to be added. Not null.default ChangeApplied removeAxiom(OWLAxiom axiom)
HasDirectRemoveAxiomremoveAxiom in interface HasDirectRemoveAxiomaxiom - The axiom to be removeddefault ChangeApplied removeAxioms(Collection<? extends OWLAxiom> axioms)
HasDirectRemoveAxiomsremoveAxioms in interface HasDirectRemoveAxiomsaxioms - The axioms to be removed.default ChangeApplied removeAxioms(Stream<? extends OWLAxiom> axioms)
HasDirectRemoveAxiomsremoveAxioms in interface HasDirectRemoveAxiomsaxioms - The axioms to be removed.default ChangeApplied removeAxioms(OWLAxiom... axioms)
HasDirectRemoveAxiomsremoveAxioms in interface HasDirectRemoveAxiomsaxioms - The axioms to be removed.default void accept(OWLNamedObjectVisitor visitor)
visitor - the visitordefault <O> O accept(OWLNamedObjectVisitorEx<O> visitor)
O - visitor return typevisitor - The visitorOWLOntologyManager getOWLOntologyManager()
void setOWLOntologyManager(@Nullable OWLOntologyManager manager)
manager - the new manager for this ontology@Nullable default OWLDocumentFormat getFormat()
default OWLDocumentFormat getNonnullFormat()
getFormat().@Deprecated default Set<OWLOntology> getImports()
UnknownOWLOntologyException - if this ontology is no longer managed by its manager
because it was removed from the manager.Stream<OWLOntology> imports()
UnknownOWLOntologyException - if this ontology is no longer managed by its manager
because it was removed from the manager.@Deprecated default Set<OWLImportsDeclaration> getImportsDeclarations()
Stream<OWLImportsDeclaration> importsDeclarations()
boolean isEmpty()
HasAxioms.axioms() is empty), and it does not
have any annotations (i.e. HasAnnotations.annotations() is empty).true if the ontology is empty, otherwise false.@Deprecated default Set<OWLAxiom> getTBoxAxioms(Imports includeImportsClosure)
includeImportsClosure - if INCLUDED, the imports closure is included.Stream<OWLAxiom> tboxAxioms(Imports includeImportsClosure)
includeImportsClosure - if INCLUDED, the imports closure is included.@Deprecated default Set<OWLAxiom> getABoxAxioms(Imports includeImportsClosure)
includeImportsClosure - if INCLUDED, the imports closure is included.Stream<OWLAxiom> aboxAxioms(Imports includeImportsClosure)
includeImportsClosure - if INCLUDED, the imports closure is included.@Deprecated default Set<OWLAxiom> getRBoxAxioms(Imports includeImportsClosure)
includeImportsClosure - if INCLUDED, the imports closure is included.Stream<OWLAxiom> rboxAxioms(Imports includeImportsClosure)
includeImportsClosure - if INCLUDED, the imports closure is included.@Deprecated default Set<OWLClassAxiom> getGeneralClassAxioms()
OWLClasses)OWLClasses)Stream<OWLClassAxiom> generalClassAxioms()
OWLClasses)OWLClasses)@Deprecated default Set<OWLEntity> getSignature(Imports imports)
imports - if INCLUDED, the imports closure is included.OWLEntity objects. The set that is returned is a copy - it will not
be updated if the ontology changes. It is therefore safe to apply changes to this ontology
while iterating over this set.HasClassesInSignature.getClassesInSignature(),
HasObjectPropertiesInSignature.getObjectPropertiesInSignature(),
HasDataPropertiesInSignature.getDataPropertiesInSignature(),
HasIndividualsInSignature.getIndividualsInSignature()default Stream<OWLEntity> signature(Imports imports)
imports - if INCLUDED, the imports closure is included.OWLEntity objects. The set that is returned is a copy - it will not
be updated if the ontology changes. It is therefore safe to apply changes to this ontology
while iterating over this set.HasClassesInSignature.classesInSignature(),
HasObjectPropertiesInSignature.objectPropertiesInSignature(),
HasDataPropertiesInSignature.dataPropertiesInSignature(),
HasIndividualsInSignature.individualsInSignature()boolean isDeclared(OWLEntity owlEntity)
owlEntity - The entity to be tested fortrue if the ontology contains a declaration for the specified entity,
otherwise false.default boolean isDeclared(OWLEntity owlEntity, Imports imports)
owlEntity - The entity to be tested forimports - if INCLUDED, the imports closure is included.true if the ontology or its imports closure contains a declaration for the
specified entity, otherwise false.default void saveOntology()
throws OWLOntologyStorageException
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.default void saveOntology(IRI documentIRI) throws OWLOntologyStorageException
documentIRI - The document IRI where the ontology should be saved toOWLOntologyStorageException - If the ontology cannot be saveddefault void saveOntology(OutputStream outputStream) throws OWLOntologyStorageException
outputStream - The output stream where the ontology will be saved toOWLOntologyStorageException - If there was a problem saving this ontology to the
specified output streamdefault void saveOntology(OWLDocumentFormat ontologyFormat) throws OWLOntologyStorageException
ontologyFormat - The format in which the ontology should be saved.OWLOntologyStorageException - If the ontology cannot be saved.default void saveOntology(OWLDocumentFormat ontologyFormat, IRI documentIRI) throws OWLOntologyStorageException
ontologyFormat - 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.default void saveOntology(OWLDocumentFormat ontologyFormat, OutputStream outputStream) throws OWLOntologyStorageException
ontologyFormat - 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.default void saveOntology(OWLOntologyDocumentTarget documentTarget) throws OWLOntologyStorageException
OWLOntologyDocumentTarget.documentTarget - The output target where the ontology will be saved to.OWLOntologyStorageException - If the ontology could not be saved.default void saveOntology(OWLDocumentFormat ontologyFormat, OWLOntologyDocumentTarget documentTarget) throws OWLOntologyStorageException
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.default void accept(OWLObjectVisitor visitor)
OWLObjectdefault <O> O accept(OWLObjectVisitorEx<O> visitor)
OWLObjectCopyright © 2017 The University of Manchester. All rights reserved.