FOUNDATION 01 / DATA MODEL

Data Model — the definition of document nodes and values.

Data Model v0.2 is the foundation that defines the meaning and shape of domain-independent Matra documents. It specifies node tag/props/children, allowed value types, document equality, and exchange through MatraJSON. It is separate from Grammar v0.3 and package versions.

Specification v0.3, individual npm package versions, and compiler ABI are managed separately.

  • tag — node name
  • props — property data
  • children — ordered child values

01 / NODE

A node has tag, props, and children

A document has exactly one root node. Its tag is a string identifying the node; props is a map from string keys to values; children is an ordered list of nodes or values. Tag names have no built-in HTML semantics.

["p", {"class":"lead"}, ["Hello",0]]

02 / VALUE

JSON-compatible values

Values are strings, finite numbers, booleans, null, lists of values, and maps with string keys. They exclude undefined, functions, symbols, bigints, non-finite numbers, and cyclic structures. Child order and scalar types are preserved.

["group", {}, [
  ["item", {}, ["one"]],
  ["item", {}, ["two"]]
]]

03 / MATRAJSON

A three-element exchange form

A MatraJSON node is [tag, props, children]. A matching array directly under children is read as a node, but arrays nested inside property values are not recursively reinterpreted as nodes. Wrap ambiguous value arrays in a map or another array.

["div", {"data":[["chart",{},[]]]}, []]

04 / EQUALITY

Preserve values and order

Documents are equivalent when their tags, property keys and values, child values, and child order are recursively equal. Property serialization order is not significant. Source positions are parser metadata, excluded from equality and standard MatraJSON.

05 / MATRA'S PROPOSAL

Document Morphion

Morphion is an original concept proposed by Matra's language designer. It models a document node as a finite mapping from exponents to values: numeric exponent 0 identifies the tag, positive integer n identifies children[n - 1], and string key identifies props[key]. Here, exponents are structural addresses—not an established general term or mathematical power operations. See the primary source for the formal definition and conversion constraints.

Keep distinct

This page is an overview.

This page is a summary. Refer to the linked Matra specification for normative definitions, complete API contracts, and verification fixtures.

Primary source