{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Site",
    "type": "object",
    "properties": {
        "type": {
            "type": "string",
            "enum": [
                "site"
            ]
        },
        "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/simple_string"
        },
        "geonames_name": {
            "$ref": "#/definitions/complex_string"
        },
        "geonames_id": {
            "$ref": "#/definitions/simple_integer"
        },
        "admin_level_1_geonames_name": {
            "$ref": "#/definitions/complex_string"
        },
        "admin_level_1_geonames_id": {
            "$ref": "#/definitions/simple_integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "type",
        "division_id",
        "gid",
        "row",
        "id",
        "name"
    ],
    "definitions": {
        "simple_integer": {
            "type": "object",
            "properties": {
                "value": {
                    "type": "integer"
                }
            },
            "additionalProperties": false,
            "required": [
                "value"
            ]
        },
        "simple_string": {
            "type": "object",
            "properties": {
                "value": {
                    "type": "string"
                }
            },
            "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"
            }
        }
    }
}