brel.characteristics.i_characteristic
This module contains the interface for a characteristic. Characteristics are what makes up the context of a fact. They are a binding between an aspect and a value.
There are characteristics for the 5 core aspects.
ConceptCharacteristic
forAspect.CONCEPT
PeriodCharacteristic
forAspect.PERIOD
EntityCharacteristic
forAspect.ENTITY
UnitCharacteristic
forAspect.UNIT
LanguageCharacteristic
forAspect.LANGUAGE
There are also characteristics for custom aspects. Custom aspects can either be typed or explicit. A explicit aspect is an aspect where the characteristic value is one option from a list of options.
For example, consider the following facts:
- The Foo Company has a revenue of 1000 USD in 2020 in the region North America.
- The Foo Company has a revenue of 2000 USD in 2020 in the region Europe.
The region aspect is an explicit aspect since the options that the region aspect can take are limited to North America and Europe.
A typed aspect is an aspect where the characteristic value is a value of a certain type. Brel simplifies this by making the value a string and the type a QName.
For example, consider the following facts:
- The Bar Company has 8 employees that earn 1000 USD per month in 2020.
- The Bar Company has 2 employees that earn 2000 USD per month in 2020.
In this case value of the fact is the number of employees. The type aspect is the 'salary per month' aspect, is an integer.
ExplicitDimensionCharacteristic
for explicit dimensions.TypedDimensionCharacteristic
for typed dimensions.
=================
- author: Robin Schmidiger
- version: 0.1
- date: 2023-12-06
=================
ICharacteristic Objects
class ICharacteristic(ABC)
The Interface for a characteristic. A characteristic is a binding between an aspect and a value.
get_value
@abstractmethod
def get_value() -> Any
Returns:
Any
: the value of the characteristic.
get_aspect
@abstractmethod
def get_aspect() -> Aspect
Returns:
Aspect
: the aspect of the characteristic.