{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "additionalProperties": false,
    "definitions": {
        "company": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "A company which is the subject of a statement",
            "properties": {
                "company_number": {
                    "type": "string"
                },
                "identifier": {
                    "description": "An official identifier paired with a code for the issuer of the identifier, e.g sec/12345",
                    "pattern": "^[^/]+/[^/]+$",
                    "type": "string"
                },
                "jurisdiction": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            },
            "required": [
                "name",
                "jurisdiction"
            ],
            "type": "object"
        },
        "subsidiary-relationship-data": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "properties": {
                "data_type": {
                    "enum": [
                        "subsidiary_relationship"
                    ]
                },
                "properties": {
                    "additionalProperties": false,
                    "properties": {
                        "direct": {
                            "description": "If the control is direct (if via an intermediary, this value should be false; if unknown, left blank)",
                            "type": "boolean"
                        },
                        "percentage_controlled": {
                            "description": "Percentage controlled, either directly or indirectly",
                            "type": "string"
                        },
                        "significant": {
                            "description": "Does the source define the control as somehow significant?",
                            "type": "boolean"
                        },
                        "subsidiary": {
                            "additionalProperties": false,
                            "description": "Company that is controlled",
                            "properties": {
                                "company_number": {
                                    "description": "Company number, if company and known",
                                    "type": "string"
                                },
                                "identifier": {
                                    "description": "Unique identifier of company",
                                    "type": "string"
                                },
                                "jurisdiction": {
                                    "description": "Jurisdiction of registration",
                                    "type": "string"
                                },
                                "name": {
                                    "description": "Name of company",
                                    "type": "string"
                                }
                            },
                            "required": [
                                "name"
                            ],
                            "type": "object"
                        }
                    },
                    "required": [
                        "subsidiary"
                    ],
                    "type": "object"
                }
            },
            "type": "object"
        }
    },
    "description": "A relationship of control between two companies",
    "properties": {
        "company": {
            "$ref": "#/definitions/company"
        },
        "data": {
            "additionalItems": false,
            "description": "This is an array of data objects, that is the objects which actually contain the data about the datum. Generally there will only be one element in this, although in for some types of data_types there may naturally be several releated to the same company, e.g. shareholders",
            "items": {
                "$ref": "#/definitions/subsidiary-relationship-data"
            },
            "type": "array"
        },
        "end_date": {
            "_format": "date",
            "type": "string"
        },
        "end_date_type": {
            "type": "string"
        },
        "retrieved_at": {
            "_format": "date",
            "type": "string"
        },
        "sample_date": {
            "_format": "date",
            "type": "string"
        },
        "source_jurisdiction": {
            "description": "Jurisdiction of the source of the data",
            "type": "string"
        },
        "start_date": {
            "_format": "date",
            "type": "string"
        },
        "start_date_type": {
            "type": "string"
        }
    },
    "required": [
        "company",
        "data",
        "sample_date"
    ],
    "type": "object"
}