{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://thewarrecord.com/api/v1/schema/claim.json",
 "title": "claim",
 "type": "object",
 "required": [
  "id",
  "type",
  "conflict",
  "claimant",
  "statement",
  "proposition",
  "checkable",
  "verdict",
  "next_check",
  "revision",
  "history",
  "record_state",
  "schema_version"
 ],
 "properties": {
  "record_state": {
   "enum": [
    "active",
    "merged",
    "withdrawn"
   ]
  },
  "merged_into": {
   "type": "string"
  },
  "withdrawn_reason": {
   "type": "string"
  },
  "schema_version": {
   "const": 1
  },
  "created_at": {
   "type": "string",
   "format": "date-time"
  },
  "last_changed": {
   "type": "string",
   "format": "date-time"
  },
  "id": {
   "type": "string",
   "pattern": "^cl-\\d{8}-[0-9a-hjkmnp-tv-z]{4}$"
  },
  "type": {
   "const": "claim"
  },
  "conflict": {
   "type": "string",
   "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)*$"
  },
  "claimant": {
   "type": "string",
   "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)*$"
  },
  "statement": {
   "type": "string",
   "pattern": "^st-\\d{8}-[0-9a-hjkmnp-tv-z]{4}$"
  },
  "proposition": {
   "type": "string"
  },
  "checkable": {
   "type": "boolean",
   "description": "false = opinion or intent: logged, counted, never scored."
  },
  "verdict": {
   "enum": [
    "open",
    "supported",
    "partly_supported",
    "contradicted",
    "unresolvable"
   ]
  },
  "withdrawn": {
   "type": "boolean",
   "description": "The claimant's act, not our verdict."
  },
  "next_check": {
   "type": "string",
   "format": "date"
  },
  "citations": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "source",
     "url",
     "origin",
     "role",
     "published_at",
     "accessed_at"
    ],
    "properties": {
     "source": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)*$"
     },
     "url": {
      "type": "string",
      "format": "uri"
     },
     "archive_url": {
      "type": "string",
      "format": "uri"
     },
     "origin": {
      "type": "string",
      "minLength": 3,
      "description": "The first-hand material this citation relies on. Independence is counted on distinct origins, not outlets."
     },
     "role": {
      "enum": [
       "evidence",
       "corroboration",
       "contradiction",
       "claim_origin",
       "count",
       "visual",
       "sensor"
      ]
     },
     "supports": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "published_at": {
      "type": "string",
      "format": "date-time"
     },
     "accessed_at": {
      "type": "string",
      "format": "date-time"
     },
     "language": {
      "type": "string"
     },
     "excerpt": {
      "type": "string",
      "maxLength": 200
     }
    },
    "additionalProperties": false
   },
   "description": "The evidence a verdict rests on, by the same standard as events; the verdict's history entry gives the indexes. The claimant's own word is in the statement, never here."
  },
  "revision": {
   "type": "integer",
   "minimum": 1
  },
  "history": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "at",
     "batch",
     "field",
     "from",
     "to",
     "reason"
    ],
    "properties": {
     "at": {
      "type": "string",
      "format": "date-time"
     },
     "batch": {
      "type": "string",
      "minLength": 3
     },
     "field": {
      "type": "string"
     },
     "from": {},
     "to": {},
     "rule": {
      "type": "string"
     },
     "reason": {
      "type": "string",
      "minLength": 3
     },
     "citations": {
      "type": "array",
      "items": {
       "type": "integer",
       "minimum": 0
      }
     }
    },
    "additionalProperties": false
   }
  }
 },
 "additionalProperties": false
}
