{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "An accounts statement is a set of financials from a given accounts filing. This may be have been derived from something as extensive as an XBRL filing, or just some headline financials. The actual accounts lines are made up of arrays of accounts elements. Some, like profit or turnover are explicitly declared here, but other arbitrary ones may be added in other_attributes, and should follow the same format",
    "properties": {
        "filing_subject": {
            "$ref": "#/definitions/entity"
        },
        "uid": {
            "description": "Unique id/reference for the filing if it has one",
            "type": "string"
        },
        "filing_date": {
            "type": "string",
            "description": "Date on which the filing was made \u2013 note this is not necessarily the same date as the date on which it was published or the reporting/applicable data on the information contained within it",
            "format": "date"
        },
        "accounts_date": {
            "type": "string",
            "format": "date"
        },
        "accounts_type": {
            "description": "The type of accounts \u2013 either annual, or quarterly, or null if not known",
            "enum": [
                "annual",
                "quarterly",
                null
            ]
        },
        "profit": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/accounts-element"
            }
        },
        "revenue": {
            "type": [
                "array",
                "null"
            ],
            "items": {
                "$ref": "#/definitions/accounts-element"
            }
        },
        "current_assets": {
            "type": [
                "array",
                "null"
            ],
            "items": {
                "$ref": "#/definitions/accounts-element"
            }
        },
        "total_assets": {
            "type": [
                "array",
                "null"
            ],
            "items": {
                "$ref": "#/definitions/accounts-element"
            }
        },
        "fixed_assets": {
            "type": [
                "array",
                "null"
            ],
            "items": {
                "$ref": "#/definitions/accounts-element"
            }
        },
        "current_liabilities": {
            "type": [
                "array",
                "null"
            ],
            "items": {
                "$ref": "#/definitions/accounts-element"
            }
        },
        "total_liabilities": {
            "type": [
                "array",
                "null"
            ],
            "items": {
                "$ref": "#/definitions/accounts-element"
            }
        },
        "cash_at_bank": {
            "type": [
                "array",
                "null"
            ],
            "items": {
                "$ref": "#/definitions/accounts-element"
            }
        },
        "documents": {
            "type": [
                "array",
                "null"
            ],
            "items": {
                "$ref": "#/definitions/filing-document"
            }
        },
        "filing_type_name": {
            "description": "The filing type in words, if given (e.g. 'Annual Return')",
            "type": "string"
        },
        "filing_type_code": {
            "description": "The code for filing type, if given (e.g. 'AR01')",
            "type": "string"
        },
        "title": {
            "description": "The title of the filing, if given",
            "type": "string"
        },
        "description": {
            "description": "The description or precis of the filing, if given",
            "type": "string"
        },
        "url": {
            "description": "Persistent URL for the filing, if there is one",
            "type": "string"
        },
        "source_url": {
            "description": "Source of the accounts, e.g. the URL of the XBRL statement, or the download dump",
            "type": "string",
            "minLength": 11
        },
        "confidence": {
            "description": "Confidence in accuracy of data",
            "type": "string",
            "enum": [
                "HIGH",
                "MEDIUM",
                "LOW"
            ]
        },
        "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": {
            "type": "string",
            "format": "date"
        },
        "currency": {
            "type": "string",
            "description": "Standard ISO 4217 3-letter code for currency, e.g. USD, GBP, EUR"
        },
        "language": {
            "description": "Should be represented as two-letter ISO-639 code",
            "type": "string",
            "minLength": 2,
            "maxLength": 2
        },
        "source_location": {
            "type": "string",
            "description": "If the accounts filing has been put on sources.opencorporates.com the path to the filing"
        },
        "other_attributes": {
            "description": "Use for other attributes for which we don't yet have curated schema attributes",
            "type": "object"
        }
    },
    "additionalProperties": false,
    "required": [
        "filing_subject",
        "source_url",
        "sample_date",
        "confidence",
        "filing_date",
        "accounts_type"
    ],
    "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"
            ]
        },
        "accounts-element": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "A representation of one particular element of an accounts statement (e.g. profit or assets). This should consist of at least a value and end_date",
            "type": "object",
            "properties": {
                "value": {
                    "type": "string",
                    "minLength": 1
                },
                "date": {
                    "description": "If this element is an instant element, i.e. relates to a specific point in time (such as balance sheet item), then give the date this relates to, otherwise use start/end dates for element that occured over a period (e.g. Profit/Loss)",
                    "type": "string",
                    "format": "date"
                },
                "start_date": {
                    "type": "string",
                    "format": "date"
                },
                "end_date": {
                    "type": "string",
                    "format": "date"
                },
                "currency": {
                    "description": "ISO 4217 code for the currency",
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                }
            },
            "required": [
                "value"
            ],
            "anyOf": [
                {
                    "required": [
                        "date"
                    ]
                },
                {
                    "required": [
                        "end_date"
                    ]
                }
            ]
        },
        "filing-document": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "A document of some sort (PDF, TIFF, HTML) associated with a filing",
            "type": "object",
            "properties": {
                "uid": {
                    "description": "Unique id/reference for the filing if it has one",
                    "type": "string"
                },
                "file_format": {
                    "description": "Format of the document, if known",
                    "enum": [
                        "xml",
                        "pdf",
                        "html",
                        "doc",
                        null
                    ]
                },
                "original_source_url": {
                    "description": "Persistent URL for the document, if there is one",
                    "type": "string"
                },
                "source_url": {
                    "description": "Source url of the web page for the filing or if there is not persistent URL the page from which it can be found (e.g. search page)",
                    "type": "string",
                    "minLength": 11
                },
                "source_location": {
                    "type": "string",
                    "description": "If the accounts filing has been put on sources.opencorporates.com the path to the filing"
                },
                "language": {
                    "description": "Should be represented as two-letter ISO-639 code",
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                },
                "classification": {
                    "description": "type of document (at the moment only XBRL is the only option here)",
                    "type": "string",
                    "enum": [
                        "xbrl",
                        null
                    ]
                },
                "pages": {
                    "description": "Number of pages, if known",
                    "type": "integer"
                }
            },
            "additionalProperties": false,
            "anyOf": [
                {
                    "required": [
                        "source_location"
                    ]
                },
                {
                    "required": [
                        "source_url"
                    ]
                }
            ]
        }
    }
}