Concepts
Elements & categories
The two-level vocabulary DTPR uses to describe data-collecting technologies.
Elements & categories
An element is a single fact. A category groups related elements and carries the visual treatment shared across them.
Categories
A category is the top-level grouping — "Purpose", "Data collected", "Data handling". Every category declares:
- an
id(stable, used ascategory_idon every element and placement), - localized
nameanddescription, - a bundled
shapeprimitive, - an optional
contextwithvalues[]— used to produce colored icon variants.
{
"id": "purpose",
"name": [{ "locale": "en", "value": "Purpose" }],
"shape": "hexagon",
"context": {
"values": [
{ "id": "commercial", "color": "#0052CC", "label": [...] },
{ "id": "civic", "color": "#FFDD00", "label": [...] }
]
}
}
Access via list_categories or GET /schemas/:version/categories.
Elements
An element is a single fact within a category:
- an
id(stable, often<category>.<name>), - a
category_idpointing at a category, - a
symbol_idpointing at the symbol SVG, - localized
titleanddescription, - optional
variables[]— values a datachain author fills in per placement, - a materialized
icon_variants[]array listing every valid variant for composed-icon URLs.
{
"id": "purpose.example",
"category_id": "purpose",
"symbol_id": "example-symbol",
"title": [{ "locale": "en", "value": "Example purpose" }],
"description": [{ "locale": "en", "value": "Short description with {{partner}} variable." }],
"variables": [ { "id": "partner", "label": [...], "type": "text", "required": false } ],
"icon_variants": ["default", "dark", "commercial"]
}
Access via list_elements, get_element, or GET /schemas/:version/elements.
Relationship
Category
├── shape ───► used by every element in the category
├── context.values[] ───► produces colored icon variants per element
└── Elements[] (many-to-one)
├── symbol_id ───► symbol SVG
├── variables[] ───► filled per placement in a datachain instance
└── icon_variants[] ───► materialized (default + dark + context ids)