public interface OWLOntology extends OWLObject, HasAnnotations, HasDirectImports, HasImportsClosure, HasOntologyID, OWLAxiomCollection, OWLAxiomCollectionBooleanArgs, OWLAxiomCollectionNoArgs, OWLSignature, OWLSignatureBooleanArgs, OWLAxiomIndex
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 |
---|---|
void |
accept(OWLNamedObjectVisitor visitor)
accept for named object visitor
|
<O> O |
accept(OWLNamedObjectVisitorEx<O> visitor)
Accepts a visitor
|
default boolean |
containsEntitiesOfTypeInSignature(EntityType<?> type,
Imports includeImportsClosure)
Determine whether the instance has entities of the specified type in its signature or in its
import closure - e.g., whether an ontology has classes, object propertyies, or named
individuals in its signature.
|
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.
|
Set<OWLAnnotation> |
getAnnotations()
Gets the annotations on this ontology.
|
Set<OWLOntology> |
getDirectImports()
Gets the set of loaded ontologies that this ontology is related to via the
directlyImports relation.
|
Set<IRI> |
getDirectImportsDocuments()
Gets the set of document IRIs that are directly imported by this ontology.
|
Set<OWLClassAxiom> |
getGeneralClassAxioms()
Gets the set of general axioms in this ontology.
|
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. |
Set<OWLOntology> |
getImportsClosure()
Gets the set of loaded ontologies that this ontology is related to via the
reflexive transitive closure of the directlyImports relation as defined in Section
3.4 of the OWL 2 Structural Specification.
|
Set<OWLImportsDeclaration> |
getImportsDeclarations()
Gets the set of imports declarations for this ontology.
|
OWLOntologyID |
getOntologyID()
Gets the identity of this ontology (i.e.
|
OWLOntologyManager |
getOWLOntologyManager()
Gets the manager that manages this ontology.
|
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.
|
Set<OWLEntity> |
getSignature()
Gets the entities that are in the signature of this ontology.
|
Set<OWLEntity> |
getSignature(Imports includeImportsClosure)
Gets the entities that are in the signature of this ontology.
|
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.
|
boolean |
isDeclared(OWLEntity owlEntity)
Determines if this ontology declares an entity i.e.
|
boolean |
isDeclared(OWLEntity owlEntity,
Imports includeImportsClosure)
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.
|
void |
saveOntology()
Saves the ontology.
|
void |
saveOntology(IRI documentIRI)
Saves the ontology, using the specified document IRI to determine where/how the ontology
should be saved.
|
void |
saveOntology(OutputStream outputStream)
Saves the ontology, to the specified output stream
|
void |
saveOntology(OWLDocumentFormat ontologyFormat)
Saves the ontology in the specified ontology format to its document URI.
|
void |
saveOntology(OWLDocumentFormat ontologyFormat,
IRI documentIRI)
Saves the ontology to the specified document IRI in the specified ontology format.
|
void |
saveOntology(OWLDocumentFormat ontologyFormat,
OutputStream outputStream)
Saves the ontology to the specified output stream in the specified ontology format.
|
void |
saveOntology(OWLDocumentFormat ontologyFormat,
OWLOntologyDocumentTarget documentTarget)
Saves the ontology to the specified output target in the specified ontology format.
|
void |
saveOntology(OWLOntologyDocumentTarget documentTarget)
Saves the ontology to the specified
OWLOntologyDocumentTarget . |
void |
setOWLOntologyManager(OWLOntologyManager manager)
Sets the manager for this ontology.
|
accept, accept, getNestedClassExpressions, isBottomEntity, isIndividual, isIRI, isTopEntity, toString
compareTo
getAnonymousIndividuals
isAnonymous, isNamed
containsAxiom, getAxiomCount, getAxiomCount, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxiomsIgnoreAnnotations, getLogicalAxiomCount, getLogicalAxioms, getReferencingAxioms
containsAxiom, containsAxiomIgnoreAnnotations, getAxiomCount, getAxiomCount, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxiomsIgnoreAnnotations, getLogicalAxiomCount, getLogicalAxioms, getReferencingAxioms
containsAxiomIgnoreAnnotations, getAxiomCount, getAxiomCount, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxioms, getAxiomsIgnoreAnnotations, getLogicalAxiomCount, getReferencingAxioms
getLogicalAxioms
getAxioms
containsAxiom
containsAnnotationPropertyInSignature, containsAnnotationPropertyInSignature, containsClassInSignature, containsClassInSignature, containsDataPropertyInSignature, containsDataPropertyInSignature, containsDatatypeInSignature, containsDatatypeInSignature, containsEntitiesOfTypeInSignature, containsEntityInSignature, containsEntityInSignature, containsEntityInSignature, containsIndividualInSignature, containsIndividualInSignature, containsObjectPropertyInSignature, containsObjectPropertyInSignature, containsReference, containsReference, getAnnotationPropertiesInSignature, getClassesInSignature, getDataPropertiesInSignature, getDatatypesInSignature, getEntitiesInSignature, getIndividualsInSignature, getObjectPropertiesInSignature, getPunnedIRIs, getReferencedAnonymousIndividuals
getAnnotationPropertiesInSignature
containsAnnotationPropertyInSignature, containsClassInSignature, containsDataPropertyInSignature, containsDatatypeInSignature, containsEntityInSignature, containsEntityInSignature, containsIndividualInSignature, containsObjectPropertyInSignature, containsReference, getAnnotationPropertiesInSignature, getClassesInSignature, getDataPropertiesInSignature, getDatatypesInSignature, getEntitiesInSignature, getIndividualsInSignature, getObjectPropertiesInSignature, getReferencedAnonymousIndividuals
getEntitiesInSignature
getClassesInSignature
getObjectPropertiesInSignature
getDataPropertiesInSignature
getDatatypesInSignature
getIndividualsInSignature
containsEntityInSignature
contains, filterAxioms, getAnnotationAssertionAxioms, getAnnotationPropertyDomainAxioms, getAnnotationPropertyRangeAxioms, getAsymmetricObjectPropertyAxioms, 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
void accept(@Nonnull OWLNamedObjectVisitor visitor)
visitor
- the visitor@Nonnull <O> O accept(@Nonnull OWLNamedObjectVisitorEx<O> visitor)
O
- visitor return typevisitor
- The visitor@Nonnull OWLOntologyManager getOWLOntologyManager()
void setOWLOntologyManager(OWLOntologyManager manager)
manager
- the new manager for this ontology@Nonnull OWLOntologyID getOntologyID()
getOntologyID
in interface HasOntologyID
@Nonnull Set<OWLAnnotation> getAnnotations()
getAnnotations
in interface HasAnnotations
@Nonnull Set<IRI> getDirectImportsDocuments()
directlyImportsDocument
association as discussed in
Section 3.4 of the OWL 2 Structural specification.UnknownOWLOntologyException
- If this ontology is no longer managed by its manager
because it was removed from the manager.@Nonnull Set<OWLOntology> getDirectImports()
getDirectImportsDocuments()
method. This will be the
case if some of the ontologies that are directly imported by this ontology are not loaded for
what ever reason.getDirectImports
in interface HasDirectImports
UnknownOWLOntologyException
- If this ontology is no longer managed by its manager
because it was removed from the manager.@Nonnull Set<OWLOntology> getImports()
UnknownOWLOntologyException
- if this ontology is no longer managed by its manager
because it was removed from the manager.@Nonnull Set<OWLOntology> getImportsClosure()
getImports()
method plus this ontology.)getImportsClosure
in interface HasImportsClosure
UnknownOWLOntologyException
- If this ontology is no longer managed by its manager
because it was removed from the manager.default boolean containsEntitiesOfTypeInSignature(EntityType<?> type, Imports includeImportsClosure)
OWLSignature
containsEntitiesOfTypeInSignature
in interface OWLSignature
type
- type of entity to checkincludeImportsClosure
- if INCLUDED, include imports closure.@Nonnull Set<OWLImportsDeclaration> getImportsDeclarations()
boolean isEmpty()
HasAxioms.getAxioms()
returns the empty set), and it does not have any annotations (i.e.
getAnnotations()
returns the empty set).true
if the ontology is empty, otherwise false
.@Nonnull Set<OWLAxiom> getTBoxAxioms(@Nonnull Imports includeImportsClosure)
includeImportsClosure
- if INCLUDED, the imports closure is included.@Nonnull Set<OWLAxiom> getABoxAxioms(@Nonnull Imports includeImportsClosure)
includeImportsClosure
- if INCLUDED, the imports closure is included.@Nonnull Set<OWLAxiom> getRBoxAxioms(@Nonnull Imports includeImportsClosure)
includeImportsClosure
- if INCLUDED, the imports closure is included.@Nonnull Set<OWLClassAxiom> getGeneralClassAxioms()
OWLClass
es)OWLClass
es)@Nonnull Set<OWLEntity> getSignature()
getSignature
in interface HasSignature
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()
@Nonnull Set<OWLEntity> getSignature(@Nonnull Imports includeImportsClosure)
includeImportsClosure
- 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()
boolean isDeclared(@Nonnull OWLEntity owlEntity)
owlEntity
- The entity to be tested fortrue
if the ontology contains a declaration for the specified entity,
otherwise false
.boolean isDeclared(@Nonnull OWLEntity owlEntity, @Nonnull Imports includeImportsClosure)
owlEntity
- The entity to be tested forincludeImportsClosure
- if INCLUDED, the imports closure is included.true
if the ontology or its imports closure contains a declaration for the
specified entity, otherwise false
.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.void saveOntology(@Nonnull IRI documentIRI) throws OWLOntologyStorageException
documentIRI
- The document IRI where the ontology should be saved toOWLOntologyStorageException
- If the ontology cannot be savedvoid saveOntology(@Nonnull 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 streamvoid saveOntology(@Nonnull OWLDocumentFormat ontologyFormat) throws OWLOntologyStorageException
ontologyFormat
- The format in which the ontology should be saved.OWLOntologyStorageException
- If the ontology cannot be saved.void saveOntology(@Nonnull OWLDocumentFormat ontologyFormat, @Nonnull 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.void saveOntology(@Nonnull OWLDocumentFormat ontologyFormat, @Nonnull 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.void saveOntology(@Nonnull OWLOntologyDocumentTarget documentTarget) throws OWLOntologyStorageException
OWLOntologyDocumentTarget
.documentTarget
- The output target where the ontology will be saved to.OWLOntologyStorageException
- If the ontology could not be saved.void saveOntology(@Nonnull OWLDocumentFormat ontologyFormat, @Nonnull 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.Copyright © 2020 The University of Manchester. All rights reserved.