pyowl2.base.annotation_property

Implements a representation of an OWL annotation property that facilitates the attachment of metadata to ontology entities without affecting logical semantics.

Description

The software defines a structure for handling annotation properties within the Web Ontology Language, specifically designed to manage metadata such as labels and comments without influencing the logical reasoning of the ontology. By extending a base entity class, the implementation ensures that these properties are treated as distinct components separate from data and object properties that drive semantic interpretation. Central to the design is the encapsulation of an Internationalized Resource Identifier (IRI), which acts as the unique identifier for the property and is managed through controlled accessors to maintain data integrity. Additionally, a string representation mechanism is included to provide a clear, human-readable format for debugging and logging purposes by explicitly exposing the associated identifier.

Classes

OWLAnnotationProperty

Represents an annotation property within the Web Ontology Language (OWL), serving as a mechanism to associate metadata or annotations with other entities such as IRIs, anonymous individuals, or literals. Unlike object or data properties, annotation properties do not influence the logical semantics of the ontology but are instead used for documentation, labeling, and management of metadata. To utilize this class, instantiate it with a specific Internationalized Resource Identifier (IRI) which acts as the unique identifier for the property; this IRI can be accessed or modified via the corresponding property attribute.

Module Contents

UML Class Diagram for OWLAnnotationProperty

UML Class Diagram for OWLAnnotationProperty

class OWLAnnotationProperty(iri: rdflib.URIRef | pyowl2.base.iri.IRI)[source]

Bases: pyowl2.abstracts.entity.OWLEntity

Inheritance diagram of pyowl2.base.annotation_property.OWLAnnotationProperty

Represents an annotation property within the Web Ontology Language (OWL), serving as a mechanism to associate metadata or annotations with other entities such as IRIs, anonymous individuals, or literals. Unlike object or data properties, annotation properties do not influence the logical semantics of the ontology but are instead used for documentation, labeling, and management of metadata. To utilize this class, instantiate it with a specific Internationalized Resource Identifier (IRI) which acts as the unique identifier for the property; this IRI can be accessed or modified via the corresponding property attribute.

Parameters:

iri (Union[URIRef, IRI]) – The Internationalized Resource Identifier (IRI) that uniquely identifies this annotation property.

__str__() str[source]

Returns a human-readable string representation of the annotation property, formatted as “AnnotationProperty({iri})”. The method retrieves the internal Internationalized Resource Identifier (IRI) associated with the object to construct this string. This representation is primarily intended for debugging and logging purposes, providing a concise summary of the entity’s identity without exposing its full internal structure.

Returns:

A string representation of the annotation property in the format ‘AnnotationProperty(<iri>)’.

Return type:

str

_iri: rdflib.URIRef | pyowl2.base.iri.IRI
property iri: rdflib.URIRef | pyowl2.base.iri.IRI

Sets the Internationalized Resource Identifier (IRI) for the OWL annotation property. This method accepts a value that is either a URIRef or an IRI object and assigns it to the internal attribute, thereby updating the property’s identity. Modifying the IRI changes the fundamental identifier used to reference this property within the ontology.

Parameters:

value (Union[URIRef, IRI]) – The IRI or URI reference to assign to the object.