pyowl2.class_expression.object_some_values_from

Defines a Python class representing the OWL ObjectSomeValuesFrom existential restriction, which describes individuals connected to a specific class via an object property.

Description

The software implements a specific construct from the Web Ontology Language known as an existential restriction, defining a set of individuals that must participate in at least one relationship defined by a specific object property with an individual belonging to a particular class. By inheriting from the base class expression type, this implementation integrates into the broader ontology framework, allowing for the creation of complex class definitions based on the properties of related entities rather than intrinsic data. Internally, the structure maintains references to both the object property expression that defines the relationship type and the class expression that acts as the constraint or filler, exposing these components through managed properties to ensure encapsulation. A string representation method is provided to generate a human-readable format of the restriction, facilitating debugging and serialization by combining the string forms of the property and the class expression.

Classes

OWLObjectSomeValuesFrom

This class models an existential restriction within the Web Ontology Language (OWL), defining a set of individuals that must be connected to at least one member of a specific class through a particular object property. It serves as a complex class expression that constrains the existence of relationships, enabling the definition of classes based on the properties of their neighbors rather than their intrinsic attributes. To utilize this restriction, one must provide an object property expression, which defines the nature of the relationship, and a class expression, which specifies the type of the related individual. This construct is fundamental for creating nuanced ontological definitions, such as describing a "Parent" as an entity that has at least one child who is a "Person".

Module Contents

UML Class Diagram for OWLObjectSomeValuesFrom

UML Class Diagram for OWLObjectSomeValuesFrom

class OWLObjectSomeValuesFrom(
property: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression,
expression: pyowl2.abstracts.class_expression.OWLClassExpression,
)[source]

Bases: pyowl2.abstracts.class_expression.OWLClassExpression

Inheritance diagram of pyowl2.class_expression.object_some_values_from.OWLObjectSomeValuesFrom

This class models an existential restriction within the Web Ontology Language (OWL), defining a set of individuals that must be connected to at least one member of a specific class through a particular object property. It serves as a complex class expression that constrains the existence of relationships, enabling the definition of classes based on the properties of their neighbors rather than their intrinsic attributes. To utilize this restriction, one must provide an object property expression, which defines the nature of the relationship, and a class expression, which specifies the type of the related individual. This construct is fundamental for creating nuanced ontological definitions, such as describing a “Parent” as an entity that has at least one child who is a “Person”.

Parameters:
  • object_property_expression (OWLObjectPropertyExpression) – The object property expression defining the relationship between the subject individual and the class expression, which may be a simple property or a complex expression involving inverses.

  • class_expression (OWLClassExpression) – The class expression defining the type of individuals that the subject individual must be related to via the object property expression.

__str__() str[source]

Returns a string representation of the OWL existential restriction defined by this object. The representation follows the format “ObjectSomeValuesFrom({property} {class})”, where {property} corresponds to the object property expression and {class} corresponds to the class expression associated with the restriction. This method does not modify the object’s state and relies on the string representations of the internal property and class expressions to construct the output.

Returns:

A string representation of the object, formatted as ‘ObjectSomeValuesFrom(property_expression class_expression)’.

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

Assigns a new class expression to this OWLObjectSomeValuesFrom restriction, replacing the existing filler. The provided value, which must be an instance of OWLClassExpression, is stored internally and defines the range of the existential restriction. This operation modifies the object’s state in place and does not return a 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 existential restriction instance. This method serves as the setter for the object_property_expression attribute, updating the internal state to reflect the new property relationship defined by the provided OWLObjectPropertyExpression. It directly modifies the underlying private attribute, potentially altering the semantic meaning of the class expression within the ontology structure.

Parameters:

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