pyowl2.class_expression.object_intersection_of

Represents the logical intersection of multiple OWL class expressions, ensuring a canonical representation through sorting.

Description

Designed to model the set of individuals that belong to every specified operand, this implementation enforces a strict requirement that the input list contains at least two class expressions. To guarantee that the order of input does not affect the internal state or logical equality, the constituent expressions are automatically sorted during initialization and modification. This canonical sorting mechanism ensures that two intersections defined with the same operands in different orders are treated identically. The resulting structure provides a string representation in functional syntax, wrapping the sorted operands within a standard ObjectIntersectionOf format for readability and debugging.

Classes

OWLObjectIntersectionOf

This class expression models the logical intersection of multiple class expressions, defining a set of individuals that belong to all specified operands. It is constructed using a list of OWLClassExpression instances, which must contain at least two elements to form a valid intersection. Upon initialization or modification, the constituent expressions are automatically sorted to ensure a canonical representation, meaning the order of input does not affect the internal state or equality.

Module Contents

UML Class Diagram for OWLObjectIntersectionOf

UML Class Diagram for OWLObjectIntersectionOf

class OWLObjectIntersectionOf(expressions: list[pyowl2.abstracts.class_expression.OWLClassExpression])[source]

Bases: pyowl2.abstracts.class_expression.OWLClassExpression

Inheritance diagram of pyowl2.class_expression.object_intersection_of.OWLObjectIntersectionOf

This class expression models the logical intersection of multiple class expressions, defining a set of individuals that belong to all specified operands. It is constructed using a list of OWLClassExpression instances, which must contain at least two elements to form a valid intersection. Upon initialization or modification, the constituent expressions are automatically sorted to ensure a canonical representation, meaning the order of input does not affect the internal state or equality.

Parameters:

classes_expressions (list[OWLClassExpression]) – A sorted list of class expressions representing the operands of the intersection, guaranteed to contain at least two elements.

__str__() str[source]

Returns a string representation of the object intersection using a functional syntax format. The method converts each constituent class expression to a string, joins them with spaces, and wraps the result in ‘ObjectIntersectionOf(…)’. This provides a readable textual representation suitable for debugging or display purposes.

Returns:

A string representation of the object intersection, formatted as ‘ObjectIntersectionOf(…)’ with the constituent class expressions joined by spaces.

Return type:

str

_classes_expressions: list[pyowl2.abstracts.class_expression.OWLClassExpression]
property classes_expressions: list[pyowl2.abstracts.class_expression.OWLClassExpression]

Sets the list of class expressions that define this intersection. The provided list is sorted before being assigned to the internal state to ensure a canonical representation, meaning the original order of the input list is not preserved. This operation modifies the object in place and requires that the elements in the list support comparison operations to be sorted successfully.

Parameters:

value (list[OWLClassExpression]) – The list of OWL class expressions to assign. The list will be sorted before being stored.