Collection
Purpose
A Collection groups related data.
Collections provide a logical organization for data without changing the meaning of the data they contain.
The Canonical Data Model defines the structure of a Collection but does not define the available Collection types.
---
Structure
A Collection consists of:
type- Identifies the kind of Collection.content- Contains the data associated with that Collection.
The interpretation of content is determined by type.
---
Characteristics
- Collections are typed.
- Collections are independent.
- Collections may contain any valid data.
- Collections are immutable.
Examples of capability:
{
"collection": {
"id": "community",
"type": "allowed"
}
}
Meaning:
This object may participate in community collections.
Examples of an instance:
{
"collection": {
"id": "community:seattle-makers",
"type": "community",
"content": {
"role": "member"
}
}
}
Meaning:
This object participates in the Seattle Makers community.
Or:
{
"collection": {
"id": "favorites",
"type": "user",
"content": {
"owner": "person:alice"
}
}
}
id identifies the collection definition or instance.
type classifies the collection.
content contains collection-specific data.
The semantics—whether it's declaring an allowed collection type or describing a specific collection—are determined by the statement in which the structure appears, not by collection.json itself.