pyowl2.axioms.annotations.sub_annotation_property_of
Implements a data structure representing the OWL SubAnnotationPropertyOf axiom, which establishes a hierarchical relationship where one annotation property is a sub-property of another.
Description
By storing references to both the specific sub-property and the broader super-property, the logic enables semantic inference, ensuring that annotations applied using the sub-property are implicitly understood to apply to the super-property as well. The design leverages inheritance to manage optional metadata about the axiom itself, allowing users to attach additional context or source information. Access to the core properties is provided through mutable attributes, and the structure includes a string representation method that outputs the relationship in standard functional syntax for interoperability.
Classes
This class represents an axiom within the Web Ontology Language (OWL) that defines a hierarchical relationship between two annotation properties, asserting that one is a subproperty of the other. By establishing this relationship, it enables semantic inference where any annotation applied using the subproperty is implicitly understood to also apply to the superproperty. To use this class, instantiate it with the specific sub-property and super-property instances, optionally including a list of annotations to provide metadata about the axiom itself, such as its source or context. The properties of the axiom can be accessed and modified directly via the provided attributes, allowing for dynamic updates to the ontology structure. |
Module Contents
UML Class Diagram for OWLSubAnnotationPropertyOf
- class OWLSubAnnotationPropertyOf(
- sub_property: pyowl2.base.annotation_property.OWLAnnotationProperty,
- super_property: pyowl2.base.annotation_property.OWLAnnotationProperty,
- annotations: list[pyowl2.base.annotation.OWLAnnotation] | None = None,
Bases:
pyowl2.abstracts.annotation_axiom.OWLAnnotationAxiom
This class represents an axiom within the Web Ontology Language (OWL) that defines a hierarchical relationship between two annotation properties, asserting that one is a subproperty of the other. By establishing this relationship, it enables semantic inference where any annotation applied using the subproperty is implicitly understood to also apply to the superproperty. To use this class, instantiate it with the specific sub-property and super-property instances, optionally including a list of annotations to provide metadata about the axiom itself, such as its source or context. The properties of the axiom can be accessed and modified directly via the provided attributes, allowing for dynamic updates to the ontology structure.
- Parameters:
sub_annotation_property (OWLAnnotationProperty) – The annotation property asserted to be a subproperty of the super annotation property.
super_annotation_property (OWLAnnotationProperty) – The annotation property asserted to be the superproperty in the subproperty relationship, representing the parent property that the sub-property implies.
- __str__() str[source]
Returns a string representation of the sub-annotation property axiom in a functional syntax format. The string begins with “SubAnnotationPropertyOf” followed by the axiom annotations; if no annotations are present, an empty list is explicitly displayed. The representation concludes with the sub-annotation property and the super-annotation property identifiers.
- Returns:
A string representation of the axiom, formatted as SubAnnotationPropertyOf([annotations] sub_property super_property).
- Return type:
str
- _sub_annotation_property: pyowl2.base.annotation_property.OWLAnnotationProperty
- _super_annotation_property: pyowl2.base.annotation_property.OWLAnnotationProperty
- property sub_annotation_property: pyowl2.base.annotation_property.OWLAnnotationProperty
Sets the specific annotation property that serves as the sub-property within this OWLSubAnnotationPropertyOf axiom. This method accepts an OWLAnnotationProperty instance and updates the internal state, replacing any previously stored value for this property.
- Parameters:
value (OWLAnnotationProperty) – The OWL annotation property to be set as the sub-annotation property.
- property super_annotation_property: pyowl2.base.annotation_property.OWLAnnotationProperty
Sets the super annotation property that defines the parent of the relationship represented by this OWLSubAnnotationPropertyOf axiom. It accepts an OWLAnnotationProperty instance and assigns it to the internal _super_annotation_property attribute, overwriting any existing value. This operation directly modifies the object’s state to reflect the new hierarchy.
- Parameters:
value (OWLAnnotationProperty) – The annotation property to set as the super property.