pyowl2.axioms.object_property_axiom.object_property_domain

Implements a representation for the Web Ontology Language axiom that restricts the domain of an object property to a specific class expression.

Description

The software models a specific type of Web Ontology Language (OWL) axiom used to define the domain of an object property, ensuring that any individual acting as the subject of a relationship belongs to a specified class. By inheriting from a base axiom class, it integrates standard annotation handling capabilities while introducing specific attributes to hold the object property expression and the class expression that defines the domain constraint. The design allows for the dynamic assignment and retrieval of both the property and the class expression, enabling the construction of complex ontological rules where the validity of property assertions depends on the type of the source individual. Furthermore, the implementation includes a string conversion mechanism that outputs the axiom in a functional syntax format, which is useful for serialization, debugging, or interoperability with other OWL tools.

Classes

OWLObjectPropertyDomain

This class models an axiom within the Web Ontology Language (OWL) that constrains the types of individuals which may serve as the subject of a specific object property relationship. By associating an object property expression with a class expression, it asserts that any individual linked to another via the specified property must belong to the defined class. Users can instantiate this class by providing the target property, the defining class expression, and an optional list of annotations to attach metadata to the axiom.

Module Contents

UML Class Diagram for OWLObjectPropertyDomain

UML Class Diagram for OWLObjectPropertyDomain

class OWLObjectPropertyDomain(
property: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression,
expression: pyowl2.abstracts.class_expression.OWLClassExpression,
annotations: list[pyowl2.base.annotation.OWLAnnotation] | None = None,
)[source]

Bases: pyowl2.abstracts.object_property_axiom.OWLObjectPropertyAxiom

Inheritance diagram of pyowl2.axioms.object_property_axiom.object_property_domain.OWLObjectPropertyDomain

This class models an axiom within the Web Ontology Language (OWL) that constrains the types of individuals which may serve as the subject of a specific object property relationship. By associating an object property expression with a class expression, it asserts that any individual linked to another via the specified property must belong to the defined class. Users can instantiate this class by providing the target property, the defining class expression, and an optional list of annotations to attach metadata to the axiom.

Parameters:
  • object_property_expression (OWLObjectPropertyExpression) – The object property expression for which the domain is being defined.

  • class_expression (OWLClassExpression) – The class expression defining the domain of the object property, specifying the class of individuals that can be the subject of the property relationship.

__str__() str[source]

Returns a string representation of the object property domain axiom in a functional syntax format. The output string begins with “ObjectPropertyDomain” followed by the axiom annotations, the object property expression, and the class expression, all enclosed in parentheses. If the object has associated annotations, they are included in the string; otherwise, an empty list representation is substituted in their place. This method does not modify the state of the object.

Returns:

A string representation of the axiom in functional syntax, including annotations if available.

Return type:

str

_class_expression: pyowl2.abstracts.class_expression.OWLClassExpression
_object_property_expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression
property class_expression: pyowl2.abstracts.class_expression.OWLClassExpression

Updates the domain class expression associated with this OWL object property domain axiom. It assigns the provided OWLClassExpression instance to the internal state, defining the specific class to which the property applies. This operation modifies the object’s internal state by overwriting the existing class expression with the new value.

Parameters:

value (OWLClassExpression) – The OWL class expression to assign.

property object_property_expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression

Assigns the specified object property expression to this domain axiom, replacing any previously stored value. This method updates the internal state of the instance by setting the _object_property_expression attribute to the provided OWLObjectPropertyExpression instance. The operation directly mutates the object and does not return a value.

Parameters:

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