Datachains
Datachains
A datachain is a concrete instance of a DTPR schema. It describes one data-collecting technology — what it collects, why, who operates it, and what happens to the data downstream.
Structure
At the top level, a DatachainInstance carries a schema_version and an ordered list of elements:
{
"schema_version": "ai@2026-04-16-beta",
"elements": [
{ "element_id": "purpose.example", "category_id": "purpose" },
{ "element_id": "data.camera", "category_id": "data-collected" }
]
}
Each entry in elements[] is an element placement — a reference to an element definition from the schema, optionally carrying:
- a
labeloverride, variableswith filled values (the element's description gets interpolated using them),- a
citation.
The schema defines the vocabulary (elements, categories, variables); the datachain picks from it.
Validation
Datachains are validated against a pinned schema version. See:
POST /schemas/:version/validate— REST.validate_datachain— MCP.
Both validate both shape (Zod) and semantics (cardinality, required categories, placement rules). Shape errors surface as parse_error; semantic errors carry stable codes per rule.
Rendering
Once valid, a datachain can be rendered to HTML:
render_datachain(MCP Apps) — produces HTML consumed viaresources/read.@dtpr/ui/vue+DtprDatachain— render inside a Vue app.@dtpr/ui/htmlrenderDatachainDocument— SSR the same components to a standalone HTML document.