ADR 056: Cyclic references — full graph stored relationally
Date: 2026-07-15
Status: Accepted
Decision Makers: @derlinne, @luckey
Context
Bidirectional and cyclic relationships are normal in the domain and must be stored without special handling.
Decision
The full (potentially cyclic) reference graph is stored — both in the schema content and as relational edges in artifact_reference.
Rationale
- Bidirectional/cyclic relationships are normal in the domain (e.g. OGC SensorThings:
Thing ⇄ Datastream). artifact_referenceis a plain relational edge table, so cycles and self-references are stored without special handling.
Mechanism
- On save, the complete set of
$refedges for the newartifact_versionis written toartifact_reference(within the write transaction) and registered in the in-memory graph. - At startup the in-memory graph is rebuilt from the stored
artifact_referenceedges (ADR 054), so it remains complete and cyclic.
Consequences
Bundled/inlined views and the dependencies/dependents queries always see the full graph (restart-safe). Recursive SQL (CTEs) over artifact_reference can serve transitive-dependency queries directly if needed.