Skip to content

3. Logical structure

Contents of DID 0.1

Independently of format and file split, a definition has this logical structure (JSON Schema: did.schema.json, $defs/Definition):

{
  "$schema": "https://etalii.net/adp/did/schema/0.1/did.schema.json#/$defs/Definition",
  "did": "0.1",
  "language": { "id": "org.example.statemachine", "version": "1.2.0" },
  "meta": {
    "createdAt": "2026-09-25T20:14:03Z",
    "modifiedAt": "2026-09-26T08:00:00Z",
    "generator": "Acme Diagrams 4.2"
  },
  "diagram": { "attributes": { "title": "Door controller" } },
  "elements": [
    { "id": "st_01J8Z3…", "type": "InitialState" },
    { "id": "st_01J8Z4…", "type": "State", "attributes": { "name": "Closed" } },
    { "id": "st_01J8Z5…", "type": "State", "attributes": { "name": "Open", "entryAction": "light.on()" } }
  ],
  "relations": [
    { "id": "tr_01J8Z6…", "type": "Transition", "source": "st_01J8Z4…", "target": "st_01J8Z5…",
      "attributes": { "trigger": "open" } }
  ],
  "views": [
    {
      "id": "v_main", "viewpoint": "main",
      "viewport": { "x": 0, "y": 0, "zoom": 1 },
      "nodes": {
        "st_01J8Z3…": { "x": 40,  "y": 60,  "w": 20,  "h": 20 },
        "st_01J8Z4…": { "x": 120, "y": 40,  "w": 120, "h": 60 },
        "st_01J8Z5…": { "x": 340, "y": 40,  "w": 120, "h": 60, "style": { "fill": "#EAF3DE" } }
      },
      "edges": {
        "tr_01J8Z6…": { "waypoints": [], "labels": { "trigger": { "dx": 0, "dy": -6 } } }
      }
    }
  ],
  "suppressions": [],
  "extensions": {}
}

Element record (elements[]):

Property Type Description
id string Required, unique within the definition.
type string Required, a concrete node type (qualified by import alias if imported).
attributes object Stored attribute values (omitting unset and, if omitDefaults, default values). Attribute values follow DISL 4.2 representations; references are ids.
parent id Containing element (omitted for top-level).
slot string Slot within the parent (DISL 4.8).
order int or string Position among siblings when children.ordered (fractional-index strings are RECOMMENDED for collaboration: "a0", "a0V").
ports {id, type, attributes}[] Port instances. type is the port name ("in").
x-* Extensions.

Nesting is expressed by parent, not by physical nesting, so moving an element between containers changes one line. Runtimes MAY offer a nested pretty-print as an alternative layout: "nested", but the flat form is canonical.

Relation record (relations[]): id, type, source, target (element or port ids), attributes, x-*. A port id is written "<elementId>#<portId>" when port ids are only unique per element.

View record (views[]): one per diagram (a definition can hold several diagrams of the same model, one per viewpoint or several of one viewpoint).

Property Type Description
id string View id.
viewpoint string Viewpoint name.
name string Diagram name shown in tabs.
viewport {x, y, zoom} Last viewport, if viewport is in view.store.
nodes map id → NodeView Placement of nodes in this view. Elements not listed are hidden in this view (unless the viewpoint auto-includes them, in which case layout places them).
edges map id → EdgeView Routing and label data.
viewOnly {id, type, attributes}[] View-only elements (notes, frames, images, free text) that belong to this view only.
guides {axis, value}[] User guides.
settings object Per-view settings (grid visible, snapping on/off, theme mode).

NodeView:

Property Description
x, y Position in domain values of the placement's system (numbers, timestamps, band references). Omitted for bound or computed coordinates — bound values live only in the model, never duplicated in the view.
w, h Size in domain units (durations as ISO 8601 on time axes). Omitted when bound, computed or equal to the default (with omitDefaults).
x2, y2 When the placement uses x2/y2 and they are free.
angle, radius Polar placements.
rotation Degrees.
z Integer z-order among siblings.
collapsed bool.
pinned bool (layout respect: "pinned").
params Shape parameter values adjusted by handles (DISL 6.8).
labels map label id → {dx, dy} offsets.
ports map port id → {side, position}.
compartments map id → {collapsed}.
style Style overrides, restricted to DISL's view.styleOverrides.
hidden bool — element placed but hidden.

EdgeView: waypoints (list of Points in domain values), sourceAnchor, targetAnchor ([fx, fy] fixed anchors), controlPoints (for bezier), labels (map id → {at, dx, dy}), routing (per-edge override if allowed), style, z, hidden.

language names the specification: id and version are REQUIRED and equal the specification's language.id and the language.version the definition was written with; definition (the URI of the .dis file) and integrity (its hash) are written when the specification's persistence.definition.embed is "reference" (DISL 11.8). The property keeps the name definition it had in the earlier format.

meta holds the metadata the specification lists in persistence.metadata (DISL 11.8). diagram.attributes holds the attributes of the diagram root element (DISL 4.1).

Suppressions of constraint problems are stored as suppressions: [{constraint, element, reason, by, at}].

Referenced from