pyowl2.abstracts.data_range
An abstract base class representing sets of literal values within an ontology that enforces comparison and hashing based on string representations.
Description
Serving as a foundational component for defining value spaces in an ontology, this class establishes a contract for representing specific datatypes or logical combinations of literal values. It enforces a strict behavioral model where object identity, ordering, and hash values are derived exclusively from the string serialization of the instance rather than internal state or memory location. By delegating rich comparison operators and hashing mechanisms to the string representation, the implementation ensures that two distinct instances are treated as identical if their textual forms match. This design allows concrete subclasses to focus solely on defining the specific structure of the data range while inheriting a consistent and predictable mechanism for storage in collections and logical evaluation.
Classes
This abstract base class represents a set of literal values within an ontology, typically corresponding to specific datatypes or logical combinations of datatypes. It serves as the foundational type for defining the value space of data properties, specifying what kinds of literal inputs—such as integers, strings, or restricted value sets—are permissible. Equality, ordering, and hashing for instances are determined exclusively by their string representations, meaning two objects are considered equal if their string forms match. Because this is an abstract class, it is intended to be subclassed by concrete implementations that define specific data ranges rather than instantiated directly. |
Module Contents
UML Class Diagram for OWLDataRange
- class OWLDataRange[source]
Bases:
pyowl2.abstracts.object.OWLObject,abc.ABC
This abstract base class represents a set of literal values within an ontology, typically corresponding to specific datatypes or logical combinations of datatypes. It serves as the foundational type for defining the value space of data properties, specifying what kinds of literal inputs—such as integers, strings, or restricted value sets—are permissible. Equality, ordering, and hashing for instances are determined exclusively by their string representations, meaning two objects are considered equal if their string forms match. Because this is an abstract class, it is intended to be subclassed by concrete implementations that define specific data ranges rather than instantiated directly.
- __slots__ = ()