{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Event",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "event"
      ]
    },
    "division_id": {
      "type": "string",
      "pattern": "^ocd-division/country:[a-z]{2}$"
    },
    "gid": {
      "type": "integer"
    },
    "row": {
      "type": "integer"
    },
    "id": {
      "type": "string",
      "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$"
    },
    "start_date": {
      "$ref": "#/definitions/simple_date"
    },
    "end_date": {
      "$ref": "#/definitions/simple_date"
    },
    "location": {
      "$ref": "#/definitions/simple_string"
    },
    "geonames_name": {
      "$ref": "#/definitions/simple_string"
    },
    "geonames_id": {
      "$ref": "#/definitions/simple_integer"
    },
    "admin_level_1_geonames_name": {
      "$ref": "#/definitions/simple_string"
    },
    "admin_level_1_geonames_id": {
      "$ref": "#/definitions/simple_integer"
    },
    "classification": {
      "type": "object",
      "properties": {
        "value": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "Arbitrary Detention",
              "Assault",
              "Attacking Hospital",
              "Beating",
              "Death in Custody",
              "Death in Detention",
              "Denial of Medical Attention",
              "Disappearance",
              "Excessive Force",
              "Illegal Detention",
              "Inhuman Detention",
              "Killing",
              "Rape",
              "Restricting freedom of speech and press",
              "Restricting of freedom of association",
              "Torture",
              "Use of Child Soldiers",
              "Violations against personal integrity",
              "Violations against the right to liberty",
              "Violations of rights of detained or imprisoned persons",
              "Violations of the right to adequate housing",
              "Violations of the right to life"
            ]
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "value"
      ]
    },
    "description": {
      "$ref": "#/definitions/simple_string"
    },
    "perpetrator_name": {
      "$ref": "#/definitions/simple_string"
    },
    "perpetrator_organization_id": {
      "$ref": "#/definitions/simple_string"
    },
    "perpetrator_organization_classification": {
      "$ref": "#/definitions/simple_string_array"
    },
    "sources": {
      "$ref": "#/definitions/simple_string_array"
    }
  },
  "additionalProperties": false,
  "required": [
    "type",
    "division_id",
    "gid",
    "row",
    "id",
    "start_date",
    "classification",
    "description"
  ],
  "definitions": {
    "simple_date": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "pattern": "^[0-9]{4}(-[0-9]{2}){0,2}$"
        }
      },
      "additionalProperties": false,
      "required": [
        "value"
      ]
    },
    "simple_integer": {
      "type": "object",
      "properties": {
        "value": {
          "type": "integer"
        }
      },
      "additionalProperties": false,
      "required": [
        "value"
      ]
    },
    "simple_string": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "value"
      ]
    },
    "simple_string_array": {
      "type": "object",
      "properties": {
        "value": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "value"
      ]
    }
  }
}