:py:mod:`owlapy.owl_ontology` ============================= .. py:module:: owlapy.owl_ontology .. autoapi-nested-parse:: OWL Ontology Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: owlapy.owl_ontology.OWLOntologyID owlapy.owl_ontology.OWLOntology .. py:class:: OWLOntologyID(ontology_iri: Optional[owlapy.iri.IRI] = None, version_iri: Optional[owlapy.iri.IRI] = None) An object that identifies an ontology. Since OWL 2, ontologies do not have to have an ontology IRI, or if they have an ontology IRI then they can optionally also have a version IRI. Instances of this OWLOntologyID class bundle identifying information of an ontology together. If an ontology doesn't have an ontology IRI then we say that it is "anonymous". .. py:attribute:: __slots__ :value: ('_ontology_iri', '_version_iri') .. py:method:: get_ontology_iri() -> Optional[owlapy.iri.IRI] Gets the ontology IRI. :returns: Ontology IRI. If the ontology is anonymous, it will return None. .. py:method:: get_version_iri() -> Optional[owlapy.iri.IRI] Gets the version IRI. :returns: Version IRI or None. .. py:method:: get_default_document_iri() -> Optional[owlapy.iri.IRI] Gets the IRI which is used as a default for the document that contain a representation of an ontology with this ID. This will be the version IRI if there is an ontology IRI and version IRI, else it will be the ontology IRI if there is an ontology IRI but no version IRI, else it will be None if there is no ontology IRI. See Ontology Documents in the OWL 2 Structural Specification. :returns: the IRI that can be used as a default for an ontology document, or None. .. py:method:: is_anonymous() -> bool .. py:method:: __repr__() Return repr(self). .. py:method:: __eq__(other) Return self==value. .. py:class:: OWLOntology Bases: :py:obj:`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). An ontology cannot be modified directly. Changes must be applied via its OWLOntologyManager. .. py:attribute:: __slots__ :value: () .. py:attribute:: type_index :type: Final :value: 1 .. py:method:: classes_in_signature() -> Iterable[owlapy.class_expression.OWLClass] :abstractmethod: Gets the classes in the signature of this object. :returns: Classes in the signature of this object. .. py:method:: data_properties_in_signature() -> Iterable[owlapy.owl_property.OWLDataProperty] :abstractmethod: Get the data properties that are in the signature of this object. :returns: Data properties that are in the signature of this object. .. py:method:: object_properties_in_signature() -> Iterable[owlapy.owl_property.OWLObjectProperty] :abstractmethod: 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. .. py:method:: individuals_in_signature() -> Iterable[owlapy.owl_individual.OWLNamedIndividual] :abstractmethod: 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. .. py:method:: equivalent_classes_axioms(c: owlapy.class_expression.OWLClass) -> Iterable[owlapy.owl_axiom.OWLEquivalentClassesAxiom] :abstractmethod: Gets all of the equivalent axioms in this ontology that contain the specified class as an operand. :param c: The class for which the EquivalentClasses axioms should be retrieved. :returns: EquivalentClasses axioms contained in this ontology. .. py:method:: general_class_axioms() -> Iterable[owlapy.owl_axiom.OWLClassAxiom] :abstractmethod: 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. .. py:method:: data_property_domain_axioms(property: owlapy.owl_property.OWLDataProperty) -> Iterable[owlapy.owl_axiom.OWLDataPropertyDomainAxiom] :abstractmethod: Gets the OWLDataPropertyDomainAxiom objects where the property is equal to the specified property. :param property: The property which is equal to the property of the retrieved axioms. :returns: The axioms matching the search. .. py:method:: data_property_range_axioms(property: owlapy.owl_property.OWLDataProperty) -> Iterable[owlapy.owl_axiom.OWLDataPropertyRangeAxiom] :abstractmethod: Gets the OWLDataPropertyRangeAxiom objects where the property is equal to the specified property. :param property: The property which is equal to the property of the retrieved axioms. :returns: The axioms matching the search. .. py:method:: object_property_domain_axioms(property: owlapy.owl_property.OWLObjectProperty) -> Iterable[owlapy.owl_axiom.OWLObjectPropertyDomainAxiom] :abstractmethod: Gets the OWLObjectPropertyDomainAxiom objects where the property is equal to the specified property. :param property: The property which is equal to the property of the retrieved axioms. :returns: The axioms matching the search. .. py:method:: object_property_range_axioms(property: owlapy.owl_property.OWLObjectProperty) -> Iterable[owlapy.owl_axiom.OWLObjectPropertyRangeAxiom] :abstractmethod: Gets the OWLObjectPropertyRangeAxiom objects where the property is equal to the specified property. :param property: The property which is equal to the property of the retrieved axioms. :returns: The axioms matching the search. .. py:method:: get_owl_ontology_manager() -> _M :abstractmethod: Gets the manager that manages this ontology. .. py:method:: get_ontology_id() -> OWLOntologyID :abstractmethod: Gets the OWLOntologyID belonging to this object. :returns: The OWLOntologyID. .. py:method:: is_anonymous() -> bool Check whether this ontology does contain an IRI or not.