pyowl2.axioms.data_property_axiom.functional_data_property

Defines a class representing an OWL axiom that enforces a functional constraint on data properties, ensuring an individual has at most one value for a specific attribute.

Description

The implementation models a specific type of Web Ontology Language (OWL) axiom used to declare that a data property is functional, meaning any given individual can be associated with at most one distinct data value through that property. By extending the base axiom class, it integrates into the broader ontology structure while enforcing a uniqueness constraint where multiple values assigned to the same individual are inferred to be identical. The design allows for the attachment of optional metadata annotations and stores the target data property expression, providing mechanisms to access and modify this core component. Additionally, the logic includes a string representation method that outputs the axiom in standard functional syntax, facilitating debugging, logging, or serialization tasks.

Classes

OWLFunctionalDataProperty

This class models an axiom used to define a data property as functional, meaning that any individual in the ontology can be associated with at most one distinct data value through that specific property. It enforces a uniqueness constraint where, if an individual is linked to multiple values, those values are inferred to be identical. Users can instantiate this object by providing the target data property expression and, optionally, a list of annotations to attach metadata to the axiom itself. This construct is essential for representing attributes that must have a single value, such as a unique identifier or a specific measurement, within an OWL ontology.

Module Contents

UML Class Diagram for OWLFunctionalDataProperty

UML Class Diagram for OWLFunctionalDataProperty

class OWLFunctionalDataProperty(
property: pyowl2.abstracts.data_property_expression.OWLDataPropertyExpression,
annotations: list[pyowl2.base.annotation.OWLAnnotation] | None = None,
)[source]

Bases: pyowl2.abstracts.data_property_axiom.OWLDataPropertyAxiom

Inheritance diagram of pyowl2.axioms.data_property_axiom.functional_data_property.OWLFunctionalDataProperty

This class models an axiom used to define a data property as functional, meaning that any individual in the ontology can be associated with at most one distinct data value through that specific property. It enforces a uniqueness constraint where, if an individual is linked to multiple values, those values are inferred to be identical. Users can instantiate this object by providing the target data property expression and, optionally, a list of annotations to attach metadata to the axiom itself. This construct is essential for representing attributes that must have a single value, such as a unique identifier or a specific measurement, within an OWL ontology.

Parameters:

data_property_expression (OWLDataPropertyExpression) – The data property expression that is declared to be functional.

__str__() str[source]

Returns a string representation of the functional data property axiom in a functional syntax format. The output string includes the keyword ‘FunctionalDataProperty’ followed by the axiom annotations and the data property expression. If the object contains no annotations, the representation explicitly includes an empty list placeholder. This method does not modify the object’s state and is intended for display or logging purposes.

Returns:

The functional syntax string representation of the axiom, including annotations and the data property expression.

Return type:

str

_data_property_expression: pyowl2.abstracts.data_property_expression.OWLDataPropertyExpression
property data_property_expression: pyowl2.abstracts.data_property_expression.OWLDataPropertyExpression

Assigns the specified data property expression to this functional data property instance. This method updates the internal state by replacing the existing property expression with the provided value, effectively defining which data property is constrained by the functional characteristic.

Parameters:

value (OWLDataPropertyExpression) – The data property expression to assign.