Datachains
Datachains
Overview
The DTPR Datachain schema defines the structure for organizing collections of DTPR elements into meaningful, ordered transparency disclosures. A datachain represents a complete disclosure for a specific technology deployment, organizing elements by categories and providing the context needed to render a comprehensive transparency interface.
Datachains come in different types (e.g., device, ai) and define both the template structure and specific instances with real-world data.
Schema structure
A datachain document has three main sections:
schema— Metadata about the schema specificationdatachain— The template definition (categories and configuration)instance— The specific instantiation with actual elements and values
Schema section
"schema": {
"name": "DTPR",
"version": "0.1",
"namespace": "https://dtpr.io/schemas/datachain/v0.1"
}
| Property | Type | Required | Description |
|---|---|---|---|
name | string | yes | Schema specification name ("DTPR") |
version | string | yes | DTPR schema version |
namespace | string | yes | URL identifying this schema version |
Datachain section
The template defining the category structure and configuration for a specific datachain type.
Basic properties
"type": "device",
"version": "2024-06-11T00:00:00Z",
"title": [{"locale": "en", "value": "Device datachain"}],
"description": [{"locale": "en", "value": "A datachain for describing data-collecting devices in public space."}]
| Property | Type | Required | Description |
|---|---|---|---|
type | string | yes | Datachain type (e.g., device, ai) |
version | string | yes | ISO 8601 timestamp of template creation |
title | locale array | yes | Localized display name |
description | locale array | yes | Localized explanation of this datachain type |
Categories
Categories define the organizational structure and display order for elements:
"categories": [
{
"id": "tech",
"order": 1,
"name": [{"locale": "en", "value": "Technology"}],
"prompt": [{"locale": "en", "value": "How does this technology work?"}],
"description": [{"locale": "en", "value": "The core technology components that collect or process data"}],
"context_types": [
{
"id": "pii",
"name": [{"locale": "en", "value": "Personal Information"}],
"description": [{"locale": "en", "value": "Technologies that collect personally identifiable information"}],
"color": "#FFCC00"
}
]
}
]
| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique category identifier |
order | integer | yes | Display order (0-based) |
name | locale array | yes | Localized display name |
prompt | locale array | yes | Localized question for this category |
description | locale array | yes | Localized explanation |
context_types | array | no | Available context types for elements in this category |
Context types
Context types provide visual and semantic indicators for elements within a category:
{
"id": "pii",
"name": [{"locale": "en", "value": "Personal Information"}],
"description": [{"locale": "en", "value": "Technologies that collect personally identifiable information"}],
"color": "#FFCC00"
}
| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique identifier within the category |
name | locale array | yes | Localized short name |
description | locale array | yes | Localized explanation |
color | string | yes | Hex color code for visual representation |
Instance section
The specific instantiation of the datachain template with real-world data.
Basic properties
"title": [{"locale": "en", "value": "Intersection 5th & Main"}],
"created_at": "2024-06-11T14:32:00Z"
| Property | Type | Required | Description |
|---|---|---|---|
title | locale array | yes | Localized name for this instance |
created_at | string | yes | ISO 8601 timestamp of instance creation |
Elements
Elements selected for this datachain instance:
"elements": [
{
"element_id": "identifiable_video",
"category_id": "tech",
"priority": 0,
"context_type_id": "pii",
"variables": [
{"id": "resolution", "value": "1080p"}
]
}
]
| Property | Type | Required | Description |
|---|---|---|---|
element_id | string | yes | References a DTPR element definition |
category_id | string | yes | Must match a category in the datachain |
priority | integer | yes | Display order within the category (0-based) |
context_type_id | string | no | References a context type from the element's category |
variables | array | no | Variable values for customizing the element |
Datachain types
Different datachain types have different category structures:
| Type | Description |
|---|---|
device | Physical devices that collect data |
ai | AI systems and algorithmic decision-making |
Each type defines its own set of relevant categories and context types appropriate to its domain.
Display logic
Ordering
- Categories are displayed in ascending
order - Elements within a category are displayed in ascending
priority
Context visualization
Elements with a context_type_id should be visually styled using the corresponding color and may display additional context information.
Variable interpolation
When displaying elements, variable values from the instance should replace {{variable_name}} placeholders in the element's description text. See Variables for details.
Rendering workflow
- Load the complete datachain document
- Sort categories by
order - Group elements by
category_id - Sort elements within categories by
priority - Resolve context types for colors and labels
- Interpolate variable values into element descriptions
- Render in the determined order
Validation
Implementations should validate:
- All required fields are present
- Category IDs in elements match defined categories
- Context type IDs exist in the appropriate category
- Variable IDs match those defined in referenced elements
- Locale codes follow standard formats
- Timestamps are valid ISO 8601
- Color codes are valid hex format
- Priority and order values are non-negative integers
Related
- Elements — Element schema reference
- Categories — Category schema reference
- Taxonomy concept — How elements, categories, and datachains relate