content-explorer/contracts/snapshot.schema.json

111 lines
3.8 KiB
JSON
Raw Normal View History

2026-10-12 18:28:16 +02:00
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://content-explorer.local/schemas/snapshot-0.1.json",
"title": "Content Explorer snapshot v0.1",
2026-10-12 18:28:16 +02:00
"type": "object",
"additionalProperties": false,
"required": ["schemaVersion", "dataspace", "kinds", "entities", "relations", "sources", "claims"],
2026-10-12 18:28:16 +02:00
"properties": {
"schemaVersion": {"const": "0.1"},
2026-10-12 18:28:16 +02:00
"dataspace": {
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "description"],
2026-10-12 18:28:16 +02:00
"properties": {
"id": {"type": "string", "pattern": "^[a-z0-9-]+$"},
"title": {"type": "string", "minLength": 1},
"description": {"type": "string", "minLength": 1}
2026-10-12 18:28:16 +02:00
}
},
"kinds": {
"type": "array",
"minItems": 1,
2026-10-12 18:28:16 +02:00
"items": {
"type": "object",
"additionalProperties": false,
"required": ["id", "label", "plural"],
2026-10-12 18:28:16 +02:00
"properties": {
"id": {"type": "string", "pattern": "^[a-z0-9-]+$"},
"label": {"type": "string"},
"plural": {"type": "string"}
2026-10-12 18:28:16 +02:00
}
}
},
"entities": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["id", "kindId", "title", "tldr", "summary", "sourceRefs"],
2026-10-12 18:28:16 +02:00
"properties": {
"id": {"type": "string", "pattern": "^urn:ce:[a-z0-9-]+:[a-z0-9-]+:[a-z0-9-]+$"},
"kindId": {"type": "string"},
"title": {"type": "string"},
"tldr": {"type": "string"},
"summary": {"type": "string"},
"aliases": {"type": "array", "items": {"type": "string"}},
"tags": {"type": "array", "items": {"type": "string"}},
"properties": {"type": "object"},
"sourceRefs": {"type": "array", "items": {"type": "string"}},
"claimRefs": {"type": "array", "items": {"type": "string"}},
"asOf": {"type": "string", "format": "date"},
"state": {
"enum": ["present", "missing", "unknown", "redacted", "stale", "contradicted", "not-applicable"]
2026-10-12 18:28:16 +02:00
}
}
}
},
"relations": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["id", "predicate", "from", "to", "sourceRefs"],
2026-10-12 18:28:16 +02:00
"properties": {
"id": {"type": "string"},
"predicate": {"type": "string", "pattern": "^[a-z0-9-]+$"},
"from": {"type": "string"},
"to": {"type": "string"},
"sourceRefs": {"type": "array", "items": {"type": "string"}, "minItems": 1},
"asOf": {"type": "string", "format": "date"}
2026-10-12 18:28:16 +02:00
}
}
},
"sources": {
"type": "array",
"minItems": 1,
2026-10-12 18:28:16 +02:00
"items": {
"type": "object",
"additionalProperties": false,
"required": ["id", "uri", "title", "license"],
2026-10-12 18:28:16 +02:00
"properties": {
"id": {"type": "string"},
"uri": {"type": "string"},
"title": {"type": "string"},
"license": {"type": "string"},
"attribution": {"type": "string"},
"retrievedAt": {"type": "string", "format": "date"}
}
}
},
"claims": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["id", "subjectId", "key", "status", "evidenceRefs"],
"properties": {
"id": {"type": "string"},
"subjectId": {"type": "string"},
"key": {"type": "string"},
"value": {},
"status": {"enum": ["asserted", "unknown", "contested", "withheld"]},
"preferred": {"type": "boolean"},
"evidenceRefs": {"type": "array", "items": {"type": "string"}, "minItems": 1},
"observedAt": {"type": "string", "format": "date"}
2026-10-12 18:28:16 +02:00
}
}
}
}
2026-10-12 18:28:16 +02:00
}