Models / Canonical Object

CanonicalAttributeMetadata

class teksi_hooks.models.canonical_object.CanonicalAttributeMetadata(source_id, identifier, localized=<factory>, field_datatype=None)[source]

Canonical metadata for a TEKSI attribute/field.

source_id:

txx_sys.dictionary_od_field.attribute_id

identifier:

txx_sys.dictionary_od_field.field_name

Parameters:
  • source_id (int)

  • identifier (str)

  • localized (LocalizedMetadata)

  • field_datatype (str | None)

Base class: CanonicalModelElementMetadata

Fields

source_id

Type: int

Numeric source identifier, i.e. from the corresponding sys dictionary table. The meaning is scoped by the concrete metadata level.

identifier

Type: str

Canonical string identifier for this model element. The meaning is scoped by the concrete metadata level.

localized

Type: LocalizedMetadata

Localized technical names for this model element.

field_datatype

Type: str | None

Source field datatype from canonical metadata. For TEKSI Wastewater dictionary metadata this corresponds to txx_sys.dictionary_od_field.field_datatype. Geometry attributes are identified with field_datatype=’geometry’.

CanonicalClassMetadata

class teksi_hooks.models.canonical_object.CanonicalClassMetadata(source_id, identifier, localized=<factory>)[source]

Canonical metadata for a TEKSI class/table.

source_id:

table.id

identifier:

txx_sys.dictionary_od_table.tablename

Parameters:

Base class: CanonicalModelElementMetadata

Fields

source_id

Type: int

Numeric source identifier, i.e. from the corresponding sys dictionary table. The meaning is scoped by the concrete metadata level.

identifier

Type: str

Canonical string identifier for this model element. The meaning is scoped by the concrete metadata level.

localized

Type: LocalizedMetadata

Localized technical names for this model element.

CanonicalIdentityMapping

class teksi_hooks.models.canonical_object.CanonicalIdentityMapping(source_attribute, canonical_attribute)[source]

Mapping from source object identity to canonical object identity.

Parameters:
  • source_attribute (str)

  • canonical_attribute (str)

Fields

source_attribute

Type: str

Source object identity.

canonical_attribute

Type: str

Canonical object identity.

CanonicalModelElementMetadata

class teksi_hooks.models.canonical_object.CanonicalModelElementMetadata(source_id, identifier, localized=<factory>)[source]

Base metadata for a canonical TEKSI Wastewater model element.

The concrete subclass determines the element level:

  • class

  • attribute

  • value-list value

Parameters:

Fields

source_id

Type: int

Numeric source identifier, i.e. from the corresponding sys dictionary table. The meaning is scoped by the concrete metadata level.

identifier

Type: str

Canonical string identifier for this model element. The meaning is scoped by the concrete metadata level.

localized

Type: LocalizedMetadata

Localized technical names for this model element.

CanonicalModelMetadata

class teksi_hooks.models.canonical_object.CanonicalModelMetadata(classes=<factory>, attributes=<factory>, values=<factory>)[source]

Aggregate canonical metadata for TEKSI classes, attributes and values.

This is intentionally a data-only model. Lookup behavior belongs to CanonicalModelCapability implementations.

Parameters:

Fields

classes

Type: dict[str, CanonicalClassMetadata]

Class metadata keyed by canonical class_id.

attributes

Type: dict[tuple[str, str], CanonicalAttributeMetadata]

Attribute metadata keyed by (class_id, attribute_id).

values

Type: dict[tuple[str, str, str], CanonicalValueMetadata]

Value metadata keyed by (class_id, attribute_id, value_id).

CanonicalObject

class teksi_hooks.models.canonical_object.CanonicalObject(identity: 'CanonicalObjectIdentity', values: 'Mapping[str, Any]'=<factory>, last_modification: 'datetime | None' = None)[source]
Parameters:

Fields

identity

Type: CanonicalObjectIdentity

Canonical object identity.

values

Type: Mapping[str, Any]

Canonical attribute values.

last_modification

Type: datetime | None

Last modification snapshot.

CanonicalObjectIdentity

class teksi_hooks.models.canonical_object.CanonicalObjectIdentity(class_id, attributes)[source]

Canonical identity of an object.

Parameters:
  • class_id (str)

  • attributes (Mapping[str, Any])

class_uid(namespace)[source]

Return the stable semantic UUID of the canonical class.

The namespace must be registered in TeksiModelNamespaces.

Parameters:

namespace (TeksiModelNamespaces)

Return type:

UUID

key()[source]

Return the a tuple of class ID and attribute mapping items.

Return type:

tuple

Fields

class_id

Type: str

Canonical class identifier.

attributes

Type: Mapping[str, Any]

Attributes uniquely identifying the object.

CanonicalValueMetadata

class teksi_hooks.models.canonical_object.CanonicalValueMetadata(source_id, identifier, localized=<factory>)[source]

Canonical metadata for a TEKSI value-list value.

source_id:

txx_sys.dictionary_od_values.value_id

identifier:

txx_sys.dictionary_od_values.value_name

Parameters:

Base class: CanonicalModelElementMetadata

Fields

source_id

Type: int

Numeric source identifier, i.e. from the corresponding sys dictionary table. The meaning is scoped by the concrete metadata level.

identifier

Type: str

Canonical string identifier for this model element. The meaning is scoped by the concrete metadata level.

localized

Type: LocalizedMetadata

Localized technical names for this model element.

LocalizedMetadata

class teksi_hooks.models.canonical_object.LocalizedMetadata(names=<factory>, display_names=<factory>)[source]

Generic localized metadata.

This model is intentionally reusable for classes, attributes and values.

Parameters:
  • names (dict[str, str])

  • display_names (dict[str, str])

name(language)[source]

Return the localized technical name for a language.

Parameters:

language (str)

Return type:

str | None

display_name(language)[source]

Return the localized display name for a language. Defaults to technical name if no display name is found.

Parameters:

language (str)

Return type:

str | None

Fields

names

Type: dict[str, str]

Localized technical names keyed by language code. Examples: {‘de’: ‘Absperr_Drosselorgan’}, {‘fr’: ‘…’}.

display_names

Type: dict[str, str]

Localized technical names keyed by language code. Examples: {‘de’: ‘Absperr_Drosselorgan’}, {‘fr’: ‘…’}.