pyowl2.axioms.assertion.negative_object_property_assertion

Defines a Python class representing a Web Ontology Language axiom that explicitly negates a relationship between two individuals.

Description

The implementation centers on the OWLNegativeObjectPropertyAssertion class, which models the logical construct of stating that a specific object property does not hold between a source individual and a target individual. By inheriting from a base assertion class, it integrates into a broader ontology framework while encapsulating the specific components required to define a negative relationship, namely the property expression and the two involved individuals. Access to these components is managed through properties that allow for both retrieval and modification, ensuring the internal state remains consistent with the logical constraints of the ontology. Additionally, the class supports the attachment of optional annotations to provide metadata, and it overrides the string conversion method to generate a functional syntax representation that clearly displays the negated relationship and any associated metadata.

Classes

OWLNegativeObjectPropertyAssertion

This class represents an axiom in the Web Ontology Language (OWL) that explicitly negates a relationship between two specific individuals. It is used to assert that a given object property expression does not link a source individual to a target individual, allowing for the precise definition of what is false within an ontology. Users can instantiate this class by providing the property to be negated, the subject and object individuals, and an optional list of annotations to attach metadata to the assertion.

Module Contents

UML Class Diagram for OWLNegativeObjectPropertyAssertion

UML Class Diagram for OWLNegativeObjectPropertyAssertion

class OWLNegativeObjectPropertyAssertion(
expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression,
source: pyowl2.abstracts.individual.OWLIndividual,
target: pyowl2.abstracts.individual.OWLIndividual,
annotations: list[pyowl2.base.annotation.OWLAnnotation] | None = None,
)[source]

Bases: pyowl2.abstracts.assertion.OWLAssertion

Inheritance diagram of pyowl2.axioms.assertion.negative_object_property_assertion.OWLNegativeObjectPropertyAssertion

This class represents an axiom in the Web Ontology Language (OWL) that explicitly negates a relationship between two specific individuals. It is used to assert that a given object property expression does not link a source individual to a target individual, allowing for the precise definition of what is false within an ontology. Users can instantiate this class by providing the property to be negated, the subject and object individuals, and an optional list of annotations to attach metadata to the assertion.

Parameters:
  • object_property_expression (OWLObjectPropertyExpression) – The object property expression that is asserted not to hold between the source and target individuals.

  • source_individual (OWLIndividual) – The individual from which the relationship is asserted not to originate.

  • target_individual (OWLIndividual) – The individual to which the relationship is asserted not to point.

__str__() str[source]

Returns a string representation of the negative object property assertion using a functional syntax format. The output includes the axiom type, the list of annotations (represented as an empty list if none are present), the object property expression, the source individual, and the target individual. This ensures a consistent textual format that explicitly indicates the presence or absence of annotations.

Returns:

A string representation of the negative object property assertion in functional syntax, displaying the annotations, object property expression, source individual, and target individual.

Return type:

str

_object_property_expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression
_source_individual: pyowl2.abstracts.individual.OWLIndividual
_target_individual: pyowl2.abstracts.individual.OWLIndividual
property object_property_expression: pyowl2.abstracts.object_property_expression.OWLObjectPropertyExpression

Assigns the specified object property expression to this negative object property assertion, replacing any existing value. This method updates the internal state of the instance to reflect the new relationship that is being negated. The provided value must be an instance of OWLObjectPropertyExpression to maintain semantic validity within the OWL structure.

Parameters:

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

property source_individual: pyowl2.abstracts.individual.OWLIndividual

Updates the subject of the negative object property assertion to the provided OWLIndividual. This setter modifies the internal state by overwriting the current source individual with the new value.

Parameters:

value (OWLIndividual)

property target_individual: pyowl2.abstracts.individual.OWLIndividual

Updates the target individual associated with this negative object property assertion. This method assigns the provided OWLIndividual instance to the internal state, overwriting any previously stored value. It defines the specific individual that is asserted not to participate in the object property relationship with the source individual.

Parameters:

value (OWLIndividual) – The OWLIndividual to be set as the target individual.