| { |
| "$schema": "https://json-schema.org/draft/2020-12/schema", |
| "$id": "https://huggingface.co/datasets/egobowwow/universal-annotations/resolve/v1.0.0/schemas/universal-annotation-packet.schema.json", |
| "title": "Universal Annotation Packet", |
| "description": "Dataset-independent atomic claims with evidence, scope, epistemic status, provenance, language surfaces, and explicit availability.", |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["schema_version", "packet_id", "ontology", "source", "evidence", "nodes", "claims", "expressions", "availability"], |
| "properties": { |
| "schema_version": {"const": "1.0.0"}, |
| "packet_id": {"type": "string", "pattern": "^uap:sha256:[0-9a-f]{64}$"}, |
| "ontology": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["ontology_id", "revision_digest"], |
| "properties": { |
| "ontology_id": {"type": "string", "minLength": 1}, |
| "revision_digest": {"$ref": "#/$defs/digest"} |
| } |
| }, |
| "source": {"$ref": "#/$defs/source"}, |
| "evidence": {"type": "array", "items": {"$ref": "#/$defs/evidence"}}, |
| "nodes": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/node"}}, |
| "claims": {"type": "array", "items": {"$ref": "#/$defs/claim"}}, |
| "expressions": {"type": "array", "items": {"$ref": "#/$defs/expression"}}, |
| "availability": {"type": "array", "items": {"$ref": "#/$defs/availability"}} |
| }, |
| "$defs": { |
| "id": {"type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_.:-]*$", "maxLength": 192}, |
| "digest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}, |
| "nullableDigest": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/digest"}]}, |
| "source": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["dataset_id", "schema_id", "record_id", "revision_digest", "native_record_digest", "license_expression"], |
| "properties": { |
| "dataset_id": {"$ref": "#/$defs/id"}, |
| "schema_id": {"$ref": "#/$defs/id"}, |
| "record_id": {"type": "string", "minLength": 1}, |
| "revision_digest": {"$ref": "#/$defs/digest"}, |
| "native_record_digest": {"$ref": "#/$defs/digest"}, |
| "license_expression": {"type": ["string", "null"]} |
| } |
| }, |
| "selector": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["clock_id", "start_ns", "end_ns"], |
| "properties": { |
| "clock_id": {"$ref": "#/$defs/id"}, |
| "start_ns": {"type": "integer", "minimum": 0}, |
| "end_ns": {"type": "integer", "minimum": 1} |
| } |
| }, |
| "evidence": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["evidence_id", "evidence_kind", "artifact_digest", "selector", "source_field_path"], |
| "properties": { |
| "evidence_id": {"$ref": "#/$defs/id"}, |
| "evidence_kind": {"enum": ["video", "image", "audio", "text", "sensor", "geometry", "human_judgment", "model_output", "derived_record"]}, |
| "artifact_digest": {"$ref": "#/$defs/nullableDigest"}, |
| "selector": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/selector"}]}, |
| "source_field_path": {"type": ["string", "null"]} |
| } |
| }, |
| "node": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["node_id", "node_kind", "concept_id", "attributes"], |
| "properties": { |
| "node_id": {"$ref": "#/$defs/id"}, |
| "node_kind": {"enum": ["event", "agent", "effector", "object", "location", "state", "task", "sensor", "frame"]}, |
| "concept_id": {"$ref": "#/$defs/id"}, |
| "attributes": {"type": "object"} |
| } |
| }, |
| "claimObject": { |
| "oneOf": [ |
| { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["kind", "node_id"], |
| "properties": {"kind": {"const": "node_ref"}, "node_id": {"$ref": "#/$defs/id"}} |
| }, |
| { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["kind", "concept_id"], |
| "properties": {"kind": {"const": "concept"}, "concept_id": {"$ref": "#/$defs/id"}} |
| }, |
| { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["kind", "value", "unit_id"], |
| "properties": { |
| "kind": {"const": "value"}, |
| "value": {}, |
| "unit_id": {"type": ["string", "null"]} |
| } |
| } |
| ] |
| }, |
| "scope": { |
| "type": ["object", "null"], |
| "additionalProperties": false, |
| "properties": { |
| "clock_id": {"type": ["string", "null"]}, |
| "start_ns": {"type": ["integer", "null"], "minimum": 0}, |
| "end_ns": {"type": ["integer", "null"], "minimum": 1}, |
| "coordinate_frame_id": {"type": ["string", "null"]} |
| } |
| }, |
| "epistemic": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["status", "confidence", "uncertainty", "visibility"], |
| "properties": { |
| "status": {"enum": ["observed", "measured", "human_annotated", "model_predicted", "derived", "reported"]}, |
| "confidence": {"type": ["number", "null"], "minimum": 0, "maximum": 1}, |
| "uncertainty": {"type": ["object", "null"]}, |
| "visibility": {"enum": ["visible", "partially_occluded", "fully_occluded", "out_of_view", "not_visual", "unknown"]} |
| } |
| }, |
| "provenance": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["producer_kind", "producer_digest", "method_id", "review_status", "review_receipt_digest"], |
| "properties": { |
| "producer_kind": {"enum": ["sensor", "human", "model", "algorithm", "mixed"]}, |
| "producer_digest": {"$ref": "#/$defs/digest"}, |
| "method_id": {"$ref": "#/$defs/id"}, |
| "review_status": {"enum": ["unreviewed", "single_review", "double_review", "adjudicated", "sensor_qa_pass"]}, |
| "review_receipt_digest": {"$ref": "#/$defs/nullableDigest"} |
| } |
| }, |
| "claim": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["claim_id", "subject_id", "predicate_id", "object", "scope", "evidence_ids", "epistemic", "provenance"], |
| "properties": { |
| "claim_id": {"$ref": "#/$defs/id"}, |
| "subject_id": {"$ref": "#/$defs/id"}, |
| "predicate_id": {"$ref": "#/$defs/id"}, |
| "object": {"$ref": "#/$defs/claimObject"}, |
| "scope": {"$ref": "#/$defs/scope"}, |
| "evidence_ids": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/id"}}, |
| "epistemic": {"$ref": "#/$defs/epistemic"}, |
| "provenance": {"$ref": "#/$defs/provenance"} |
| } |
| }, |
| "expression": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["expression_id", "locale", "text", "speech_act", "claim_ids", "method", "review_status", "review_receipt_digest"], |
| "properties": { |
| "expression_id": {"$ref": "#/$defs/id"}, |
| "locale": {"type": "string", "minLength": 2}, |
| "text": {"type": "string", "minLength": 1}, |
| "speech_act": {"enum": ["observation", "directive", "question", "answer", "warning", "feedback", "unknown"]}, |
| "claim_ids": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/id"}}, |
| "method": {"enum": ["source", "human_translation", "algorithmic_projection", "model_candidate"]}, |
| "review_status": {"enum": ["source_verified", "pending", "single_review", "bilingual_adjudicated"]}, |
| "review_receipt_digest": {"$ref": "#/$defs/nullableDigest"} |
| } |
| }, |
| "availability": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["dimension_id", "status", "reason"], |
| "properties": { |
| "dimension_id": {"$ref": "#/$defs/id"}, |
| "status": {"enum": ["present", "not_collected", "not_applicable", "unknown"]}, |
| "reason": {"type": "string", "minLength": 1} |
| } |
| } |
| } |
| } |
|
|