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
OWLAxiom
s and a possibly empty set of
OWLAnnotation
s. 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.
|
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 stream of general axioms in this ontology.
|
default Set<OWLAxiom> |
getABoxAxioms(Imports includeImportsClosure)
Gets the axioms that form the ABox for this ontology, i.e., the ones whose type is in the
AxiomType::ABoxAxiomTypes.
|
default OWLDocumentFormat |
getFormat() |
default Set<OWLClassAxiom> |
getGeneralClassAxioms()
Gets the set of general axioms in this ontology.
|
default Set<OWLOntology> |
getImports()
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. |
default Set<OWLImportsDeclaration> |
getImportsDeclarations()
Gets the set of imports declarations for this ontology.
|
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)
Gets the axioms that form the RBox for this ontology, i.e., the ones whose type is in the
AxiomType::RBoxAxiomTypes.
|
default Set<OWLEntity> |
getSignature(Imports imports)
Gets the entities that are in the signature of this ontology.
|
default Set<OWLAxiom> |
getTBoxAxioms(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 |
hashIndex() |
Stream<OWLOntology> |
imports()
Gets the stream 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 stream of imports declarations for this ontology.
|
default int |
initHashCode() |
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, hashIteration, hasSharedStructure, isAnonymousExpression, isBottomEntity, isIRI, isTopEntity, nestedClassExpressions
compareTo
getSignature, signature, unsortedSignature
anonymousIndividuals, getAnonymousIndividuals
componentsAnnotationsFirst, componentsWithoutAnnotations
isAnonymous, isNamed
annotations, annotations, annotations, annotationsAsList, getAnnotations, getAnnotations
directImports, directImportsDocuments, getDirectImports, getDirectImportsDocuments
getOntologyID
containsAxiom, containsAxiomIgnoreAnnotations, getAxiomCount, getAxiomCount, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxiomsIgnoreAnnotations, getLogicalAxiomCount, getLogicalAxioms, getReferencingAxioms
axioms, 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, referencingAxioms
getLogicalAxioms, logicalAxioms
axioms, equalAxioms, getAxioms
containsAxiom
containsAnnotationPropertyInSignature, containsClassInSignature, containsDataPropertyInSignature, containsDatatypeInSignature, containsEntityInSignature, containsEntityInSignature, containsIndividualInSignature, containsObjectPropertyInSignature, containsReference, getAnnotationPropertiesInSignature, getClassesInSignature, getDataPropertiesInSignature, getDatatypesInSignature, getEntitiesInSignature, getIndividualsInSignature, getObjectPropertiesInSignature, getReferencedAnonymousIndividuals
annotationPropertiesInSignature, classesInSignature, containsAnnotationPropertyInSignature, containsAnnotationPropertyInSignature, containsClassInSignature, containsClassInSignature, containsDataPropertyInSignature, containsDataPropertyInSignature, containsDatatypeInSignature, containsDatatypeInSignature, containsEntitiesOfTypeInSignature, containsEntitiesOfTypeInSignature, 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, referencedAnonymousIndividuals
entitiesInSignature, getEntitiesInSignature
classesInSignature, getClassesInSignature
annotationPropertiesInSignature, getAnnotationPropertiesInSignature
getObjectPropertiesInSignature, objectPropertiesInSignature
dataPropertiesInSignature, getDataPropertiesInSignature
datatypesInSignature, getDatatypesInSignature
getIndividualsInSignature, individualsInSignature
containsEntityInSignature
annotationAssertionAxioms, 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, transitiveObjectPropertyAxioms
applyChanges, applyChanges, applyChangesAndGetDetails
add
add, add
remove
remove, remove, remove
default boolean isAxiom()
default boolean isIndividual()
isIndividual
in interface OWLObject
default boolean isOntology()
isOntology
in interface OWLObject
default Stream<?> components()
components
in interface HasComponents
default int initHashCode()
initHashCode
in interface OWLObject
default int hashIndex()
hashIndex
in interface HasHashIndex
default int typeIndex()
default ChangeApplied applyChange(OWLOntologyChange change)
HasApplyChange
OWLOntologyManager
implementation, the instance used should be the one
that the ontology returns through the getOWLOntologyManager()
call. The reason is
that some changes, e.g., change of ontology id and change of imports directives, affect data
that only that manager instance knows about, such as the imports closure; changes of ontology
id through the wrong manager will make the ontology unreachable through its new id in the
manager associated with the ontology. Configuration for loading and saving parameters is also
held by the manager, if not explicitly specified for the ontology. While the change might be
successful, other bugs might be made apparent later.applyChange
in interface HasApplyChange
change
- The change to be applieddefault ChangeApplied applyDirectChange(OWLOntologyChange change)
HasApplyDirectChange
applyDirectChange
in interface HasApplyDirectChange
change
- The change to be applieddefault ChangeDetails applyChangesAndGetDetails(List<? extends OWLOntologyChange> changes)
HasApplyChanges
OWLOntologyManager
implementation, the instance used should be the one
that the ontology returns through the getOWLOntologyManager()
call. The reason is
that some changes, e.g., change of ontology id and change of imports directives, affect data
that only that manager instance knows about, such as the imports closure; changes of ontology
id through the wrong manager will make the ontology unreachable through its new id in the
manager associated with the ontology. Configuration for loading and saving parameters is also
held by the manager, if not explicitly specified for the ontology. While the change might be
successful, other bugs might be made apparent later.applyChangesAndGetDetails
in interface HasApplyChanges
changes
- The changes to be applied.default ChangeApplied addAxiom(OWLAxiom axiom)
HasDirectAddAxiom
addAxiom
in interface HasDirectAddAxiom
axiom
- The axiom to be addeddefault ChangeApplied addAxioms(Collection<? extends OWLAxiom> axioms)
HasDirectAddAxioms
addAxioms
in interface HasDirectAddAxioms
axioms
- The axioms to be added. Not null
.default ChangeApplied addAxioms(Stream<? extends OWLAxiom> axioms)
HasDirectAddAxioms
addAxioms
in interface HasDirectAddAxioms
axioms
- The axioms to be added. Not null
.default ChangeApplied addAxioms(OWLAxiom... axioms)
HasDirectAddAxioms
addAxioms
in interface HasDirectAddAxioms
axioms
- The axioms to be added. Not null
.default ChangeApplied removeAxiom(OWLAxiom axiom)
HasDirectRemoveAxiom
removeAxiom
in interface HasDirectRemoveAxiom
axiom
- The axiom to be removeddefault ChangeApplied removeAxioms(Collection<? extends OWLAxiom> axioms)
HasDirectRemoveAxioms
removeAxioms
in interface HasDirectRemoveAxioms
axioms
- The axioms to be removed.default ChangeApplied removeAxioms(Stream<? extends OWLAxiom> axioms)
HasDirectRemoveAxioms
removeAxioms
in interface HasDirectRemoveAxioms
axioms
- The axioms to be removed.default ChangeApplied removeAxioms(OWLAxiom... axioms)
HasDirectRemoveAxioms
removeAxioms
in interface HasDirectRemoveAxioms
axioms
- 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()
.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.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
.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.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.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.default Set<OWLClassAxiom> getGeneralClassAxioms()
OWLClass
es)OWLClass
es)Stream<OWLClassAxiom> generalClassAxioms()
OWLClass
es)OWLClass
es)default Set<OWLEntity> getSignature(Imports imports)
imports
- if INCLUDED, the imports closure is included.OWLEntity
objects. The set that is returned is a copy; modifications
to the returned set will not be reflected in this object.HasClassesInSignature.classesInSignature()
,
HasObjectPropertiesInSignature.objectPropertiesInSignature()
,
HasDataPropertiesInSignature.dataPropertiesInSignature()
,
HasIndividualsInSignature.individualsInSignature()
default Stream<OWLEntity> signature(Imports imports)
imports
- if INCLUDED, the imports closure is included.OWLEntity
objects.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)
OWLObject
default <O> O accept(OWLObjectVisitorEx<O> visitor)
OWLObject
Copyright © 2020 The University of Manchester. All rights reserved.