graflo.architecture.evolution.aspects.state¶
The state aspect: how facts change over time, and what was measured (PROV-O, SOSA, QUDT).
Modules:
| Name | Description |
|---|---|
plan |
Planning the state aspect: validity intervals, observations, units, groundings. |
vocabulary |
The state aspect's types: how a fact changes over time, and what was measured. |
Attributes¶
__all__ = ['StatePlan', 'observation_type_name', 'observation_vertex', 'plan_state', 'state_type_name', 'state_vertex']
module-attribute
¶
Classes¶
StatePlan
¶
Bases: ConfigBaseModel
What the state aspect planned, in the two halves a composed lift needs apart.
Attributes:
| Name | Type | Description |
|---|---|---|
ops |
list[ManifestOp]
|
The additive ops, in application order: grounding first, then structure, then the scaffolding. |
scaffolded |
list[str]
|
Names of the |
retire |
list[ManifestOp]
|
The destructive half, to be applied last. |
Source code in graflo/architecture/evolution/aspects/state/plan.py
Functions:¶
observation_type_name(vertex)
¶
observation_vertex(subject, key_fields)
¶
The Observation type for one subject: a measurement at a time.
result_unit is a property rather than a contract-level declaration
because this type is abstract: one measuring temperature and one measuring
pressure are the same type here, so the unit has to travel with the row.
Source code in graflo/architecture/evolution/aspects/state/vocabulary.py
plan_state(manifest, spec, *, authored=None)
¶
The ops that lift manifest into one that tracks state and measurements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifest
|
GraphManifest
|
the manifest to lift, already |
required |
spec
|
LiftSpec
|
the semantic declarations the planner cannot infer. |
required |
authored
|
dict[str, Any] | None
|
the manifest as written, when available. Only an authored document distinguishes "this vertex declared no identity" from "this vertex declared every property as its identity", so without it the planner cannot detect the fallback and does not try. |
None
|
Returns:
| Type | Description |
|---|---|
StatePlan
|
The additive ops, the scaffolded type names, and the removals kept |
StatePlan
|
apart so they can run last. Ordering matters -- a property is moved |
StatePlan
|
onto its |
Raises:
| Type | Description |
|---|---|
LiftError
|
a declaration the planner needs is missing, or a name it would mint is already taken. |
Source code in graflo/architecture/evolution/aspects/state/plan.py
state_type_name(vertex)
¶
state_vertex(subject, key_fields, moved)
¶
The State type for one subject: its key, its mutable facts, a validity interval.
Keyed on the subject's own key plus valid_from: the same property of
the same entity holds many values over time, and those are different facts
rather than revisions of one. Closing valid_to instead of overwriting is
what makes the history queryable at all.