{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Person",
    "type": "object",
    "properties": {
        "type": {
            "type": "string",
            "enum": [
                "person"
            ]
        },
        "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}$"
        },
        "name": {
            "$ref": "#/definitions/complex_string"
        },
        "other_names": {
            "type": "object",
            "properties": {
                "value": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "sources": {
                    "$ref": "#/definitions/sources"
                },
                "confidence": {
                    "$ref": "#/definitions/confidence"
                }
            },
            "additionalProperties": false,
            "required": [
                "value"
            ]
        },
        "memberships": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "organization_id": {
                        "$ref": "#/definitions/complex_string"
                    },
                    "role": {
                        "$ref": "#/definitions/complex_string"
                    },
                    "title": {
                        "$ref": "#/definitions/complex_string"
                    },
                    "rank": {
                        "$ref": "#/definitions/complex_string"
                    },
                    "date_first_cited": {
                        "$ref": "#/definitions/complex_date_with_actual"
                    },
                    "start_date_description": {
                        "$ref": "#/definitions/complex_string"
                    },
                    "date_last_cited": {
                        "$ref": "#/definitions/complex_date_with_actual"
                    },
                    "end_date_description": {
                        "$ref": "#/definitions/complex_string"
                    },
                    "site_id": {
                        "$ref": "#/definitions/complex_string"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "organization_id"
                ]
            }
        },
        "notes": {
            "type": "object",
            "properties": {
                "value": {
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "required": [
                "value"
            ]
        }
    },
    "additionalProperties": false,
    "required": [
        "type",
        "division_id",
        "gid",
        "row",
        "id",
        "name"
    ],
    "definitions": {
        "complex_date": {
            "type": "object",
            "properties": {
                "value": {
                    "type": "string",
                    "pattern": "^[0-9]{4}(-[0-9]{2}){0,2}$"
                },
                "sources": {
                    "$ref": "#/definitions/sources"
                },
                "confidence": {
                    "$ref": "#/definitions/confidence"
                }
            },
            "additionalProperties": false,
            "required": [
                "value"
            ]
        },
        "complex_date_with_actual": {
            "type": "object",
            "properties": {
                "value": {
                    "type": "string",
                    "pattern": "^[0-9]{4}(-[0-9]{2}){0,2}$"
                },
                "sources": {
                    "$ref": "#/definitions/sources"
                },
                "confidence": {
                    "$ref": "#/definitions/confidence"
                },
                "actual": {
                    "type": "boolean"
                }
            },
            "additionalProperties": false,
            "required": [
                "value"
            ]
        },
        "complex_string": {
            "type": "object",
            "properties": {
                "value": {
                    "type": "string"
                },
                "sources": {
                    "$ref": "#/definitions/sources"
                },
                "confidence": {
                    "$ref": "#/definitions/confidence"
                }
            },
            "additionalProperties": false,
            "required": [
                "value"
            ]
        },
        "confidence": {
            "type": "string",
            "enum": [
                "Low",
                "Medium",
                "High"
            ]
        },
        "sources": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    }
}