{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ver.cy/schemas/dimension/1.0/fact.schema.json",
  "title": "Vercy bitemporal fact assertion",
  "type": "object",
  "required": ["recordType", "schemaVersion", "factId", "subjectId", "path", "value", "validFrom", "validTo", "recordedAt", "supersedes", "status", "provenance", "authority", "masterSystem"],
  "additionalProperties": false,
  "properties": {
    "recordType": {"const": "fact"},
    "schemaVersion": {"const": "1.0.0"},
    "factId": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{2,255}$"},
    "subjectId": {"type": "string", "minLength": 3},
    "path": {"type": "string", "pattern": "^[A-Za-z0-9_][A-Za-z0-9_.:-]*$"},
    "value": {},
    "unit": {"type": ["string", "null"]},
    "validFrom": {"type": "string", "format": "date-time"},
    "validTo": {"type": ["string", "null"]},
    "recordedAt": {"type": "string", "format": "date-time"},
    "supersedes": {"type": "array", "uniqueItems": true, "items": {"type": "string"}},
    "status": {"type": "string", "enum": ["asserted", "contested", "retracted", "unknown"]},
    "provenance": {"type": "object", "required": ["source"], "properties": {"source": {"type": "string", "minLength": 1}}},
    "authority": {"type": "object", "required": ["source", "rank"], "additionalProperties": false, "properties": {"source": {"type": "string", "minLength": 1}, "rank": {"type": "integer", "minimum": 0}}},
    "masterSystem": {"type": ["string", "null"]},
    "confidence": {"type": "number", "minimum": 0, "maximum": 1},
    "accessClass": {"type": "string"}
  }
}
