pyowl2.axioms.object_property_axiom.inverse_object_properties

Implements a data structure representing an OWL axiom that declares two object properties to be inverses of one another.

Description

The software models a specific type of Web Ontology Language (OWL) axiom used to define reciprocal relationships between two object properties. By storing references to two distinct object property expressions, it establishes a logical constraint where the existence of a relationship defined by the first property implies the existence of a relationship defined by the second property in the opposite direction. This structure allows reasoning systems to infer bidirectional connections between entities, such as linking a “hasParent” property with an “isChildOf” property. In addition to holding the core property expressions, the implementation supports the attachment of metadata annotations and provides a string representation formatted according to OWL functional syntax for serialization or debugging purposes.

Classes

OWLInverseObjectProperties

This class represents an axiom within an ontology that declares two object properties to be inverses of one another. It establishes a logical rule where if the first property relates an individual A to an individual B, the second property must necessarily relate B to A. To use this class, instantiate it with the two property expressions that form the inverse pair, optionally providing a list of annotations to attach metadata to the axiom. This structure is essential for defining reciprocal relationships, such as linking "hasParent" with "isChildOf", thereby allowing reasoning systems to infer bidirectional connections between entities.

Module Contents

UML Class Diagram for OWLInverseObjectProperties

UML Class Diagram for OWLInverseObjectProperties

class OWLInverseObjectProperties(
expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression,
inverse_expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression,
annotations: list[pyowl2.base.annotation.OWLAnnotation] | None = None,
)[source]

Bases: pyowl2.abstracts.object_property_axiom.OWLObjectPropertyAxiom

Inheritance diagram of pyowl2.axioms.object_property_axiom.inverse_object_properties.OWLInverseObjectProperties

This class represents an axiom within an ontology that declares two object properties to be inverses of one another. It establishes a logical rule where if the first property relates an individual A to an individual B, the second property must necessarily relate B to A. To use this class, instantiate it with the two property expressions that form the inverse pair, optionally providing a list of annotations to attach metadata to the axiom. This structure is essential for defining reciprocal relationships, such as linking “hasParent” with “isChildOf”, thereby allowing reasoning systems to infer bidirectional connections between entities.

Parameters:
  • object_property_expression (OWLObjectPropertyExpression) – The object property expression declared to be the inverse of the second property expression.

  • inverse_object_property_expression (OWLObjectPropertyExpression) – The object property expression that is declared to be the inverse of the first property expression.

__str__() str[source]

Returns a string representation of the inverse object properties axiom, formatted to display the annotations and the two related object property expressions. The output string starts with the identifier “InverseObjectProperties” and includes the list of annotations, the primary object property expression, and the inverse object property expression. If the axiom has associated annotations, they are rendered within the string; otherwise, an empty list is explicitly included to preserve the structural format.

Returns:

Returns a string representation of the inverse object properties axiom in functional syntax.

Return type:

str

_inverse_object_property_expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression
_object_property_expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression
property inverse_object_property_expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression

Sets the object property expression that constitutes the inverse relationship within this axiom. This method updates the internal attribute to the provided OWLObjectPropertyExpression, overwriting any previous value.

Parameters:

value (OWLObjectPropertyExpression) – The OWL object property expression to assign.

property object_property_expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression

Assigns the specified object property expression to this instance, effectively updating one side of the inverse relationship defined by the axiom. The provided value, which must be an instance of OWLObjectPropertyExpression, replaces the existing property expression stored internally. This method modifies the object’s state in place and does not return a value.

Parameters:

value (OWLObjectPropertyExpression) – The OWL object property expression to assign to the instance.