Tree-Backed Regular Table
Archmage recognizes a tree-structured data file as a tree-backed regular table whenever its structure satisfies the following criteria:
- The root is a tree map (automatically inferred, or explicitly declared).
- Each map key is an integer (even if represented as a string) or a
string. - Each map value is a tree object.
# Tree-Backed Regular Table1: name: Arthur power: 1002: name: Merlin power: 80{ "1": { "name": "Arthur", "power": 100 }, "2": { "name": "Merlin", "power": 80 }}Like standard regular tables, a tree-backed regular table:
- Can be the target of a
ref, or the source of abackref/backref-n. - Can have
anchor,origin,backref, andbackref-nfields. - Can serve as a partition of a virtual table.
The Config ID
Section titled “The Config ID”In a tree-backed regular table, each key in the root map serves as a config ID, and its corresponding value serves as a config entry.
When root map keys are integers, they must be > 0.
Declaring an Anchor
Section titled “Declaring an Anchor”1: name: Arthur Pendragon anchor: arthur anchor__meta__: type: anchor2: name: Merlin Ambrosius anchor: merlin{ "1": { "name": "Arthur Pendragon", "anchor": "arthur", "anchor__meta__": { "type": "anchor" } }, "2": { "name": "Merlin Ambrosius", "anchor": "merlin" }}Declaring a Passive Field
Section titled “Declaring a Passive Field”Passive types require no manual input. Their data nodes must be either omitted or set to null.
1: name: Arthur signatureWeapon__meta__: type: backref@item skills: null # can be omitted skills__meta__: type: backref-n@skill origin__meta__: type: origin2: name: Merlin{ "1": { "name": "Arthur", "signatureWeapon__meta__": { "type": "backref@item" }, "skills": null, "skills__meta__": { "type": "backref-n@skill" }, "origin__meta__": { "type": "origin" } }, "2": { "name": "Merlin" }}