{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "A Licence is a permission for an entity to do something that would otherwise not be permitted. Note that such permissions are recorded in multiple different ways and to different granularity. In addition categories cross over, for example a pawnborker may be regulated as a retail establishment by a city, but also as a financial institution by a national or regional financial regulator. Sometimes the licence is a simple statement \u2013 the government of Rwanda has given a banking licence to a certain bank -- other times it is fine-grained and highly complex (e.g. an extractives licence or the UK FCA licencing scheme). This schema tries to make it easy to submit the former, while not losing granularity of the latter. The object has the name of Rich Licence to distinguish it from Simple Licence, which it is expected to ultimately replace.",
    "properties": {
        "licence_holder": {
            "$ref": "#/definitions/entity"
        },
        "licence_issuer": {
            "oneOf": [
                {
                    "type": [
                        "string",
                        "null"
                    ],
                    "minLength": 2
                },
                {
                    "$ref": "#/definitions/organisation"
                }
            ]
        },
        "licenced_location": {
            "$ref": "#/definitions/address"
        },
        "licence_number": {
            "type": "string"
        },
        "start_date": {
            "description": "The issue date of the licence",
            "type": "string",
            "format": "date"
        },
        "end_date": {
            "description": "The expiry date of the licence",
            "type": "string",
            "format": "date"
        },
        "source_url": {
            "description": "Place where this fact can be verified",
            "type": "string",
            "minLength": 1
        },
        "confidence": {
            "description": "Confidence in accuracy of data",
            "type": "string",
            "enum": [
                "HIGH",
                "MEDIUM",
                "LOW"
            ]
        },
        "renewal_date": {
            "type": "string",
            "format": "date"
        },
        "sample_date": {
            "description": "Date on which we know this to be true (usually date this information was retrieved from the source)",
            "type": "string",
            "format": "date"
        },
        "retrieved_at": {
            "description": "The time or date at which the source URL was requested",
            "type": "string",
            "format": "date"
        },
        "licence_url": {
            "type": "string",
            "description": "A public URL for the licence"
        },
        "jurisdiction_of_licence": {
            "type": "string",
            "description": "The area in which this licence is valid"
        },
        "status": {
            "type": "string",
            "description": "The status of the licence. If the licence is made up of a number of permissions, each of which has a status, store the status in the permissions field instead/as well"
        },
        "category": {
            "description": "Category of licence",
            "type": "array",
            "items": {
                "type": "string",
                "enum": [
                    "Financial",
                    "Business",
                    "Extractive"
                ]
            }
        },
        "permissions": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/permission"
            }
        },
        "other_attributes": {
            "description": "Use for other licence attributes for which we don't yet have curated schema attributes",
            "type": "object"
        }
    },
    "additionalProperties": false,
    "required": [
        "source_url",
        "sample_date",
        "licence_holder",
        "permissions",
        "licence_issuer",
        "jurisdiction_of_licence"
    ],
    "definitions": {
        "entity": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "object",
            "required": [
                "entity_type",
                "entity_properties"
            ],
            "oneOf": [
                {
                    "properties": {
                        "entity_type": {
                            "enum": [
                                "company"
                            ]
                        },
                        "entity_properties": {
                            "$ref": "#/definitions/company-for-nesting"
                        }
                    }
                },
                {
                    "properties": {
                        "entity_type": {
                            "enum": [
                                "person"
                            ]
                        },
                        "entity_properties": {
                            "$ref": "#/definitions/person"
                        }
                    }
                },
                {
                    "properties": {
                        "entity_type": {
                            "enum": [
                                "organisation"
                            ]
                        },
                        "entity_properties": {
                            "$ref": "#/definitions/organisation"
                        }
                    }
                },
                {
                    "properties": {
                        "entity_type": {
                            "enum": [
                                "unknown"
                            ]
                        },
                        "entity_properties": {
                            "$ref": "#/definitions/unknown-entity-type"
                        }
                    }
                }
            ]
        },
        "company-for-nesting": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "A company in OpenCorporates",
            "type": "object",
            "properties": {
                "company_number": {
                    "type": "string",
                    "description": "unique identifier given by the corporate register with which it is incorporated",
                    "minLength": 1
                },
                "name": {
                    "type": "string",
                    "description": "Legal name of the company",
                    "minLength": 1
                },
                "jurisdiction": {
                    "type": "string",
                    "description": "A free text field for the jurisdiction where the company is registered \u2013 this can be either the ISO 3166-2 code, the underscored version, or the standard name for the jurisdiction, e.g. France"
                },
                "jurisdiction_code": {
                    "type": "string",
                    "description": "Code representing the jurisdiction/company register which is the canonical record of the company\u2019s existence. Uses underscored ISO 3166-2 to represent it, e.g. es for Spain, us_de for Delaware",
                    "minLength": 2,
                    "maxLength": 5
                },
                "incorporation_date": {
                    "type": "string",
                    "format": "date"
                },
                "dissolution_date": {
                    "type": "string",
                    "format": "date"
                },
                "retrieved_at": {
                    "type": "string",
                    "format": "date"
                },
                "current_status": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "company_type": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "registry_url": {
                    "type": "string"
                },
                "website": {
                    "oneOf": [
                        {
                            "type": "string",
                            "minLength": 5
                        },
                        {
                            "type": [
                                "array",
                                "null"
                            ],
                            "items": {
                                "type": "string",
                                "minLength": 5
                            }
                        }
                    ]
                },
                "telephone_number": {
                    "type": "string",
                    "minLength": 4
                },
                "fax_number": {
                    "type": "string",
                    "minLength": 4
                },
                "registered_address": {
                    "$ref": "#/definitions/address"
                },
                "headquarters_address": {
                    "$ref": "#/definitions/address"
                },
                "mailing_address": {
                    "$ref": "#/definitions/address"
                },
                "addresses": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/address-with-type"
                    }
                },
                "officers": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/officer"
                    }
                },
                "share_parcels": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/share-parcel"
                    }
                },
                "total_shares": {
                    "$ref": "#/definitions/total-shares"
                },
                "filings": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/filing"
                    }
                },
                "identifiers": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/identifier"
                    }
                },
                "industry_codes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/industry-code"
                    }
                },
                "previous_names": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/previous-name"
                    }
                },
                "alternative_names": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/alternative-name"
                    }
                },
                "branch": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "description": "A flag to denote whether a company is a branch entity. This should only be set if the company is a type of branch (otherwise should be null). In general the only option here is 'F' for a 'Foreign' branch, i.e. an out-of-jurisdiction entity that has registered as having a presence in the jurisdiction. In the US this is sometimes called a Foreign Corporation",
                    "enum": [
                        "F",
                        "L",
                        null
                    ]
                },
                "all_attributes": {
                    "type": "object",
                    "description": "Other arbitrary attributes for a given company",
                    "properties": {
                        "jurisdiction_of_origin": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "description": "The jurisdiction of the 'home' company if this is a branch",
                            "minLength": 1
                        },
                        "home_company_number": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "description": "If the entity is a 'branch', this is the company_number of the 'home' company in the home company's jurisdiction",
                            "minLength": 1
                        },
                        "home_legal_name": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "description": "The legal name of the 'home' company in its jurisdiction if this is a branch, and the name is different from the legal name of the branch",
                            "minLength": 1
                        },
                        "registered_agent_address": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "description": "The address of the 'Agent', a public address to which legal papers can be served",
                            "minLength": 1
                        },
                        "registered_agent_name": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "description": "The 'Agent' of the company \u2013 a person or entity that is empowered to accept service for the company",
                            "minLength": 1
                        },
                        "number_of_employees": {
                            "anyOf": [
                                {
                                    "type": "string",
                                    "minLength": 1
                                },
                                {
                                    "type": "number",
                                    "minimum": 0
                                }
                            ],
                            "description": "The number of employees"
                        },
                        "merged_into": {
                            "type": "object",
                            "description": "Information on the merger of this company into a 'survivor' company",
                            "properties": {
                                "surviving_company": {
                                    "type": [
                                        "object"
                                    ],
                                    "description": "the surviving_company that this has been merged into",
                                    "properties": {
                                        "name": {
                                            "type": "string",
                                            "description": "The legal name of the surviving company",
                                            "minLength": 1
                                        },
                                        "company_number": {
                                            "type": "string",
                                            "description": "The company_number of the surviving company, if known",
                                            "minLength": 1
                                        },
                                        "jurisdiction": {
                                            "type": "string",
                                            "description": "The jurisdiction of incorporation of the surviving company",
                                            "minLength": 2
                                        }
                                    },
                                    "anyOf": [
                                        {
                                            "required": [
                                                "name"
                                            ]
                                        },
                                        {
                                            "required": [
                                                "company_number"
                                            ]
                                        }
                                    ]
                                },
                                "effective_date": {
                                    "description": "The date of the merger",
                                    "type": "string",
                                    "format": "date"
                                }
                            },
                            "additionalProperties": false,
                            "required": [
                                "surviving_company"
                            ]
                        }
                    }
                }
            },
            "additionalProperties": false,
            "anyOf": [
                {
                    "required": [
                        "name"
                    ]
                },
                {
                    "required": [
                        "company_number"
                    ]
                }
            ]
        },
        "address": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "oneOf": [
                {
                    "type": [
                        "string",
                        "null"
                    ],
                    "minLength": 2
                },
                {
                    "name": "Address",
                    "description": "An address object",
                    "type": "object",
                    "properties": {
                        "street_address": {
                            "type": "string"
                        },
                        "locality": {
                            "type": "string"
                        },
                        "region": {
                            "type": "string"
                        },
                        "postal_code": {
                            "type": "string"
                        },
                        "country": {
                            "type": "string"
                        },
                        "country_code": {
                            "description": "ISO 3166-2 code for country",
                            "type": "string"
                        }
                    },
                    "anyOf": [
                        {
                            "required": [
                                "street_address"
                            ]
                        },
                        {
                            "required": [
                                "postal_code"
                            ]
                        },
                        {
                            "required": [
                                "locality",
                                "country"
                            ]
                        }
                    ]
                }
            ]
        },
        "address-with-type": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "An address with a type",
            "type": "object",
            "properties": {
                "address": {
                    "$ref": "#/definitions/address"
                },
                "type": {
                    "enum": [
                        "registered",
                        "headquarters",
                        "mailing",
                        "trading",
                        "unknown"
                    ]
                }
            },
            "additionalProperties": false,
            "required": [
                "address",
                "type"
            ]
        },
        "officer": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "An officer (director, senior executive) of a company",
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "minLength": 1,
                    "not": {
                        "pattern": "^[\\.\\,\\*\\\\\\-\\s\\{\\}\\(\\)]+$"
                    }
                },
                "start_date": {
                    "anyOf": [
                        {
                            "type": "string",
                            "format": "date"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "end_date": {
                    "anyOf": [
                        {
                            "type": "string",
                            "format": "date"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "position": {
                    "type": "string"
                },
                "uid": {
                    "type": "string",
                    "description": "a unique identifier given to the officership"
                },
                "other_attributes": {
                    "type": "object",
                    "properties": {
                        "date_of_birth": {
                            "type": "string",
                            "format": "date"
                        },
                        "nationality": {
                            "type": "string"
                        },
                        "person_uid": {
                            "type": "string",
                            "description": "a unique identifier given to the individual (as opposed to the officership)"
                        },
                        "address": {
                            "$ref": "#/definitions/address"
                        },
                        "type": {
                            "type": "string",
                            "enum": [
                                "Person",
                                "Company"
                            ],
                            "description": "The type of entity that is the officer (either 'Person' or 'Company')"
                        }
                    }
                }
            },
            "required": [
                "name"
            ]
        },
        "share-parcel": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "object",
            "description": "A parcel of shares in a company",
            "properties": {
                "number_of_shares": {
                    "description": "Number of shares, if known",
                    "type": "integer"
                },
                "percentage_of_shares": {
                    "description": "Percentage of shares, if known",
                    "type": "number",
                    "maximum": 100,
                    "minimum": 0
                },
                "percentage_of_shares_min": {
                    "description": "Minimum percentage of shares (if for example a band of percentage is given)",
                    "type": [
                        "number",
                        "null"
                    ],
                    "maximum": 100,
                    "minimum": 0
                },
                "percentage_of_shares_max": {
                    "description": "Maximum percentage of shares (if for example a band of percentage is given)",
                    "type": [
                        "number",
                        "null"
                    ],
                    "maximum": 100,
                    "minimum": 0
                },
                "voting_percentage": {
                    "description": "Percentage of votes, if known",
                    "type": "number",
                    "maximum": 100,
                    "minimum": 0
                },
                "voting_percentage_min": {
                    "description": "Minimum percentage of votes (if for example a band of votes is given)",
                    "type": [
                        "number",
                        "null"
                    ],
                    "maximum": 100,
                    "minimum": 0
                },
                "voting_percentage_max": {
                    "description": "Maximum percentage of votes (if for example a band of votes is given)",
                    "type": [
                        "number",
                        "null"
                    ],
                    "maximum": 100,
                    "minimum": 0
                },
                "share_class": {
                    "description": "Share class or classes, if known",
                    "type": "string"
                },
                "start_date": {
                    "type": "string",
                    "format": "date"
                },
                "end_date": {
                    "type": "string",
                    "format": "date"
                },
                "sample_date": {
                    "type": "string",
                    "format": "date"
                },
                "shareholders": {
                    "description": "Legal persons who own this share parcel",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "type": "object",
                        "name": "shareholder",
                        "required": [
                            "name"
                        ],
                        "properties": {
                            "name": {
                                "description": "Name of natural person or company",
                                "type": "string",
                                "minLength": 1
                            },
                            "jurisdiction": {
                                "description": "Jurisdiction of registration, if company",
                                "type": "string"
                            },
                            "company_number": {
                                "description": "Company number, if company and known",
                                "type": "string"
                            },
                            "identifier": {
                                "description": "Unique identifier of person",
                                "type": "string"
                            },
                            "type": {
                                "description": "Type of person if known (company or natural person)",
                                "enum": [
                                    "Company",
                                    "Person"
                                ]
                            },
                            "address": {
                                "description": "Address given for shareholder",
                                "$ref": "#/definitions/address"
                            },
                            "address_country": {
                                "description": "Country part of owner's address (for example if address not given)",
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "total-shares": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "The total number of shares a company has issued",
            "type": "object",
            "properties": {
                "number": {
                    "type": "integer"
                },
                "share_class": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "required": [
                "number"
            ]
        },
        "filing": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "A statutory filing",
            "type": "object",
            "properties": {
                "title": {
                    "type": "string"
                },
                "date": {
                    "type": "string",
                    "format": "date"
                },
                "description": {
                    "type": "string"
                },
                "uid": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                },
                "filing_type_code": {
                    "type": "string"
                },
                "filing_type_name": {
                    "type": "string"
                },
                "other_attributes": {
                    "type": "object"
                }
            },
            "required": [
                "date"
            ],
            "anyOf": [
                {
                    "required": [
                        "title"
                    ]
                },
                {
                    "required": [
                        "description"
                    ]
                },
                {
                    "required": [
                        "filing_type_name"
                    ]
                }
            ]
        },
        "identifier": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "An identifier for an entity (possibly other things, e.g. securities in the future). Examples are tax IDs, non-profit IDs, SEC CIK numbers, Federal Reserve RSSD id. The main requirements for an identifier is that they should be well-defined, and issued by a government or have statutory standing",
            "type": "object",
            "properties": {
                "uid": {
                    "type": "string",
                    "description": "The unique identifier given by the identifier system \u2013 it should be unique in the context of the identifier_system",
                    "minLength": 1
                },
                "identifier_system_code": {
                    "type": "string",
                    "description": "An identifier representing the identifier scheme. Some examples of this are us_fein (US Federal tax number), us_sec_cik (US Securities and Exchange Commission CIK), uk_ew_cc (Charity Commission of England & Wales), lei (Global Legal Entity Identifier System)"
                }
            },
            "required": [
                "uid",
                "identifier_system_code"
            ]
        },
        "industry-code": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "An industry code from a standard code list (e.g. NAICS 2007 or NACE 2). This schema is a sub-schema of Classification.",
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "code_scheme_id": {
                    "type": "string",
                    "description": "An identifier representing industry code scheme. At the moment these are eu_nace_2, uk_sic_2003, uk_sic_2007, us_naics_2002, us_naics_2007, be_nace_2008, dk_db_2007, nz_bic_2006, no_sic_2007, anz_sic_2006, nz_bic_2006, in_nic_2004_mca, ca_qc_cae, lu_nace_2. For other code schemes, or details of these, contact info@opencorporates.com"
                },
                "start_date": {
                    "type": "string",
                    "format": "date"
                },
                "end_date": {
                    "type": "string",
                    "format": "date"
                }
            },
            "required": [
                "code",
                "code_scheme_id"
            ]
        },
        "previous-name": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "name": "PreviousName",
            "description": "A previous name of a company",
            "type": "object",
            "properties": {
                "company_name": {
                    "type": "string",
                    "minLength": 1
                },
                "con_date": {
                    "type": "string",
                    "format": "date",
                    "description": "The end (conversion) date of the name"
                },
                "start_date": {
                    "type": "string",
                    "format": "date"
                }
            },
            "required": [
                "company_name"
            ]
        },
        "alternative-name": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "An alternative name of a company, e.g. abbreviation, trading (including dba or doing business as), legal. As well as trading names etc, it can be used for storing alternative language representations of the legal name, in which case the language should be represented as two-letter ISO-639 code",
            "type": "object",
            "properties": {
                "company_name": {
                    "type": "string",
                    "minLength": 1
                },
                "start_date": {
                    "type": "string",
                    "format": "date"
                },
                "end_date": {
                    "type": "string",
                    "format": "date"
                },
                "language": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "trading",
                        "abbreviation",
                        "legal",
                        "unknown",
                        "alias"
                    ]
                }
            },
            "required": [
                "company_name",
                "type"
            ]
        },
        "person": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "A person, for example, referenced in some other context, e.g. director of a company, shareholder, licence-holder, lobbyist. This should be used only if the person is the subject of the datum",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "name": {
                    "$ref": "#/definitions/person-name"
                },
                "jurisdiction": {
                    "type": "string",
                    "description": "Name of the jurisdiction in which the entity is based"
                },
                "company": {
                    "description": "Company the person is representing. NB If the licence holder is a company, and the individual is a just a contact, then use the company-schema for the entity. This is where the individual themselves are the subject entity (e.g. licence holder, disqualified director)",
                    "$ref": "#/definitions/company-for-nesting"
                },
                "relationship_with_company": {
                    "enum": [
                        "employee",
                        "director",
                        "shareholder",
                        null
                    ]
                },
                "website": {
                    "oneOf": [
                        {
                            "type": "string",
                            "minLength": 5
                        },
                        {
                            "type": [
                                "array",
                                "null"
                            ],
                            "items": {
                                "type": "string",
                                "minLength": 5
                            }
                        }
                    ]
                },
                "uid": {
                    "description": "Unique id of the person. Note: the unique id is not expected to be globally unique, but only unique with reference to the source from which it is derived. No check is made for uniqueness",
                    "type": "string",
                    "minLength": 1
                },
                "telephone_number": {
                    "type": "string",
                    "minLength": 4
                },
                "fax_number": {
                    "type": "string",
                    "minLength": 4
                },
                "registered_address": {
                    "description": "address for service (or address given in the context of legal requirement)",
                    "$ref": "#/definitions/address"
                },
                "headquarters_address": {
                    "$ref": "#/definitions/address"
                },
                "mailing_address": {
                    "$ref": "#/definitions/address"
                },
                "addresses": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/address-with-type"
                    }
                },
                "industry_codes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/industry-code"
                    }
                },
                "alternative_names": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/alternative-name"
                    }
                },
                "date_of_birth": {
                    "anyOf": [
                        {
                            "type": "string",
                            "format": "date"
                        },
                        {
                            "$ref": "#/definitions/date"
                        }
                    ]
                },
                "nationality": {
                    "description": "The person's nationality",
                    "type": "string",
                    "format": "non-blank"
                },
                "country_of_residence": {
                    "description": "The normal country of residence for the person",
                    "type": "string",
                    "format": "non-blank"
                },
                "identifiers": {
                    "type": [
                        "array",
                        "null"
                    ],
                    "items": {
                        "$ref": "#/definitions/identifier"
                    }
                },
                "other_attributes": {
                    "description": "Use for other attributes for which we don't yet have curated schema attributes",
                    "type": "object"
                }
            },
            "required": [
                "name"
            ]
        },
        "person-name": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "oneOf": [
                {
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "non-blank"
                },
                {
                    "description": "The name of a person as an object",
                    "type": "object",
                    "properties": {
                        "given_name": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "non-blank",
                            "description": "The given name(s) (often first name) of a person, as opposed to their family name. Following FOAF practice, this is preferred to first_name"
                        },
                        "family_name": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "non-blank",
                            "description": "The family name (often last name) of a person, as opposed to their family name. Following FOAF practice, this is preferred to last_name"
                        },
                        "first_name": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "non-blank"
                        },
                        "middle_name": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "non-blank"
                        },
                        "last_name": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "non-blank"
                        },
                        "title": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "non-blank",
                            "description": "Title such as Mr, Ms, Dr etc"
                        },
                        "suffixes": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "non-blank",
                            "description": "Any suffixes, including degrees, honours (OBE), ordinals (John Smith Jr, Bill Jones II) etc"
                        }
                    }
                }
            ]
        },
        "date": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "A parsed date object. This allows us to represent not just normal dates, but also partial dates too",
            "type": "object",
            "properties": {
                "year": {
                    "type": "number",
                    "description": "year part as YYYY"
                },
                "month": {
                    "type": "number",
                    "description": "month part of date in numbers e.g. 11 for November, 4 for April"
                },
                "day": {
                    "type": [
                        "number",
                        "null"
                    ],
                    "description": "day part of date in numbers"
                }
            },
            "additionalProperties": false,
            "anyOf": [
                {
                    "required": [
                        "year",
                        "month"
                    ]
                },
                {
                    "required": [
                        "month",
                        "day"
                    ]
                }
            ]
        },
        "organisation": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "An entity which is a distinct organisation, but is not a company nor an individual. Examples include governments and governmental entities (e.g. Multilateral Development Banks, Government Departments, municipalities, etc), and also membership organisations",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name of the entity",
                    "minLength": 1
                },
                "jurisdiction": {
                    "type": "string",
                    "description": "Name of the jurisdiction in which the entity is incorporated/domiciled (use global for global entities, e.g. UN)"
                },
                "legal_form": {
                    "type": "string",
                    "description": "legal form of organisation, e.g. municipality, government department, trust, etc"
                },
                "website": {
                    "oneOf": [
                        {
                            "type": "string",
                            "minLength": 5
                        },
                        {
                            "type": [
                                "array",
                                "null"
                            ],
                            "items": {
                                "type": "string",
                                "minLength": 5
                            }
                        }
                    ]
                },
                "telephone_number": {
                    "type": "string",
                    "minLength": 4
                },
                "fax_number": {
                    "type": "string",
                    "minLength": 4
                },
                "identifiers": {
                    "type": [
                        "array",
                        "null"
                    ],
                    "items": {
                        "$ref": "#/definitions/identifier"
                    }
                },
                "registered_address": {
                    "$ref": "#/definitions/address"
                },
                "headquarters_address": {
                    "$ref": "#/definitions/address"
                },
                "mailing_address": {
                    "$ref": "#/definitions/address"
                },
                "addresses": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/address-with-type"
                    }
                },
                "industry_codes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/industry-code"
                    }
                },
                "previous_names": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/previous-name"
                    }
                },
                "alternative_names": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/alternative-name"
                    }
                },
                "other_attributes": {
                    "description": "Use for other attributes for which we don't yet have curated schema attributes",
                    "type": "object"
                }
            },
            "required": [
                "name"
            ]
        },
        "unknown-entity-type": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "An entity of unknown type - potentially a company, a person, government entity, or some unincorporated organisation",
            "additionalProperties": false,
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name of the entity",
                    "minLength": 1
                },
                "jurisdiction": {
                    "type": "string",
                    "description": "Name of the jurisdiction in which the entity is incorporated/domiciled"
                },
                "uid": {
                    "description": "Unique id for the entity if it has one",
                    "type": "string"
                },
                "website": {
                    "oneOf": [
                        {
                            "type": "string",
                            "minLength": 5
                        },
                        {
                            "type": [
                                "array",
                                "null"
                            ],
                            "items": {
                                "type": "string",
                                "minLength": 5
                            }
                        }
                    ]
                },
                "telephone_number": {
                    "type": "string",
                    "minLength": 4
                },
                "fax_number": {
                    "type": "string",
                    "minLength": 4
                },
                "registered_address": {
                    "$ref": "#/definitions/address"
                },
                "headquarters_address": {
                    "$ref": "#/definitions/address"
                },
                "mailing_address": {
                    "$ref": "#/definitions/address"
                },
                "addresses": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/address-with-type"
                    }
                },
                "identifiers": {
                    "type": [
                        "array",
                        "null"
                    ],
                    "items": {
                        "$ref": "#/definitions/identifier"
                    }
                },
                "industry_codes": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/industry-code"
                    }
                },
                "previous_names": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/previous-name"
                    }
                },
                "alternative_names": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/alternative-name"
                    }
                },
                "other_attributes": {
                    "description": "Use for other attributes for which we don't yet have curated schema attributes",
                    "type": "object"
                }
            },
            "required": [
                "name"
            ]
        },
        "permission": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "oneOf": [
                {
                    "type": [
                        "string",
                        "null"
                    ],
                    "minLength": 2
                },
                {
                    "name": "Permission",
                    "description": "A permission issued by a government or regulatory body to an entity to do something. This may be fine grained,e.g. to sell liquor, to accept customer deposits, or broader, e.g to operate as a bank, a restaurant. It may also be permission to do something physical, such as explore for oil in a given area, or mine for iron ore",
                    "type": "object",
                    "properties": {
                        "activity_name": {
                            "type": "string"
                        },
                        "activity_id": {
                            "type": "string"
                        },
                        "permission_type": {
                            "enum": [
                                "operating",
                                "exploration",
                                "exploitation"
                            ],
                            "description": "types of permission, such as 'operating', 'exploration', 'exploitation'"
                        },
                        "restrictions": {
                            "type": "array",
                            "description": "conditions or restrictions on the permissions",
                            "items": {
                                "type": "string"
                            }
                        },
                        "other_attributes": {
                            "type": "object"
                        }
                    },
                    "required": [
                        "activity_name"
                    ]
                }
            ]
        }
    }
}