Skip to main content

Module compose

Module compose 

Source
Expand description

Composition: the projection from the raw set of per-graph fragments into a single composed graph. This is the only module that knows about more than one graph, and the only place the reserved @ and _ sigils appear.

Composition merges by path coincidence:

  • Nodes are keyed by path. Each contributing graph’s bare metadata nests under its @<graph> namespace; the reserved _graphs key lists every contributing namespace.
  • Edges are deduped by (source, target). Per-graph edge metadata, when present, nests under @<graph>; _graphs lists contributors.
  • Resolution is namespace presence: a path that appears only as an edge target — with no @fs block — is an unresolved/external reference and gets no node entry.

v0.8’s graphs are all colocated, so no contribution edges are auto-emitted here; that mechanism arrives with the first separated graph.

Functions§

compose
Merge a raw set of per-graph fragments into one composed graph.