owlapy.abstracts.abstract_owl_ontology

Classes

AbstractOWLOntology

Represents an OWL 2 Ontology in the OWL 2 specification.

Module Contents

class owlapy.abstracts.abstract_owl_ontology.AbstractOWLOntology[source]

Bases: owlapy.owl_object.OWLObject

Represents an OWL 2 Ontology in the OWL 2 specification.

An 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).

__slots__ = ()
type_index: Final = 1
abstract classes_in_signature() Iterable[owlapy.class_expression.OWLClass][source]

Gets the classes in the signature of this object.

Returns:

Classes in the signature of this object.

abstract data_properties_in_signature() Iterable[owlapy.owl_property.OWLDataProperty][source]

Get the data properties that are in the signature of this object.

Returns:

Data properties that are in the signature of this object.

abstract object_properties_in_signature() Iterable[owlapy.owl_property.OWLObjectProperty][source]

A convenience method that obtains the object properties that are in the signature of this object.

Returns:

Object properties that are in the signature of this object.

abstract individuals_in_signature() Iterable[owlapy.owl_individual.OWLNamedIndividual][source]

A convenience method that obtains the individuals that are in the signature of this object.

Returns:

Individuals that are in the signature of this object.

abstract equivalent_classes_axioms(c: owlapy.class_expression.OWLClass) Iterable[owlapy.owl_axiom.OWLEquivalentClassesAxiom][source]

Gets all of the equivalent axioms in this ontology that contain the specified class as an operand.

Parameters:

c – The class for which the EquivalentClasses axioms should be retrieved.

Returns:

EquivalentClasses axioms contained in this ontology.

abstract general_class_axioms() Iterable[owlapy.owl_axiom.OWLClassAxiom][source]
Get the general class axioms of this ontology. This includes SubClass axioms with a complex class expression

as the sub class and EquivalentClass axioms and DisjointClass axioms with only complex class expressions.

Returns:

General class axioms contained in this ontology.

abstract data_property_domain_axioms(property: owlapy.owl_property.OWLDataProperty) Iterable[owlapy.owl_axiom.OWLDataPropertyDomainAxiom][source]

Gets the OWLDataPropertyDomainAxiom objects where the property is equal to the specified property.

Parameters:

property – The property which is equal to the property of the retrieved axioms.

Returns:

The axioms matching the search.

abstract data_property_range_axioms(property: owlapy.owl_property.OWLDataProperty) Iterable[owlapy.owl_axiom.OWLDataPropertyRangeAxiom][source]

Gets the OWLDataPropertyRangeAxiom objects where the property is equal to the specified property.

Parameters:

property – The property which is equal to the property of the retrieved axioms.

Returns:

The axioms matching the search.

abstract object_property_domain_axioms(property: owlapy.owl_property.OWLObjectProperty) Iterable[owlapy.owl_axiom.OWLObjectPropertyDomainAxiom][source]

Gets the OWLObjectPropertyDomainAxiom objects where the property is equal to the specified property.

Parameters:

property – The property which is equal to the property of the retrieved axioms.

Returns:

The axioms matching the search.

abstract object_property_range_axioms(property: owlapy.owl_property.OWLObjectProperty) Iterable[owlapy.owl_axiom.OWLObjectPropertyRangeAxiom][source]

Gets the OWLObjectPropertyRangeAxiom objects where the property is equal to the specified property.

Parameters:

property – The property which is equal to the property of the retrieved axioms.

Returns:

The axioms matching the search.

abstract get_ontology_id() _OI[source]

Gets the OWLOntologyID belonging to this object.

Returns:

The OWLOntologyID.

is_anonymous() bool[source]

Check whether this ontology does contain an IRI or not.

abstract add_axiom(axiom: owlapy.owl_axiom.OWLAxiom | Iterable[owlapy.owl_axiom.OWLAxiom])[source]

Add the specified axiom/axioms to the ontology.

Parameters:

axiom – Can be a single axiom or a collection of axioms.

Returns:

Nothing.

abstract remove_axiom(axiom: owlapy.owl_axiom.OWLAxiom | Iterable[owlapy.owl_axiom.OWLAxiom])[source]

Removes the specified axiom/axioms to the ontology.

Parameters:

axiom – Can be a single axiom or a collection of axioms.

Returns:

Nothing.

abstract save(document_iri: owlapy.iri.IRI | None = None)[source]

Saves this ontology, using its IRI to determine where/how the ontology should be saved.

Parameters:

document_iri – Whether you want to save in a different location.