{
    "$id": "http://ihsn.org/schemas/nada/series-schema.json",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
        "series": {
            "type": "object",
            "properties": {
                "fid": {
                    "type": "string",
                    "title": "File or database ID",
                    "description": "File to which the series belongs"
                },
                "vid": {
                    "type": "string",
                    "title": "Series unique ID",
                    "description": "Unique series ID e.g. V1, V2"
                },
                "name": {
                    "type": "string",
                    "title": "Series name"
                },
                "labl": {
                    "type": "string",
                    "title": "Series label"
                },
                "aliases": {
                    "type": "array",
                    "title": "Series other names",
                    "items": {
                        "type": "object",
                        "properties": {
                            "alias": {
                                "title": "Alias",
                                "type": "string"
                            }
                        }
                    }
                },
                "measurement_unit": {
                    "type": "integer",
                    "title": "Series unit of measure"
                },
                "periodicity": {
                    "type": "integer",
                    "title": "Periodicity of data"
                },
                "base_period": {
                    "type": "integer",
                    "title": "Base period"
                },
                "definition_short": {
                    "type": "string",
                    "title": "Definition short"
                },
                "definition_long": {
                    "type": "string",
                    "title": "Definition long"
                },
                "definition_references": {
                    "type": "array",
                    "title": "Definition references",
                    "description": "URL to standard definition of the indicator (international or national standard)",
                    "items": {
                        "type": "object",
                        "properties": {
                            "source": {
                                "title": "Source",
                                "type": "string"
                            },
                            "uri": {
                                "title": "URI",
                                "description": "URI",
                                "type": "string"
                            },
                            "note": {
                                "title": "Note",
                                "description": "Note",
                                "type": "string"
                            }
                        },
                        "required": [
                            "uri"
                        ]
                    }
                },
                "related_concepts": {
                    "type": "array",
                    "title": "Related concepts",
                    "description": "Related concepts",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "title": "Name",
                                "type": "string"
                            },
                            "definition": {
                                "title": "Definition",
                                "description": "Definition",
                                "type": "string"
                            }
                        },
                        "required": [
                            "topic"
                        ]
                    }
                },
                "methodology": {
                    "type": "string",
                    "title": "Methodology"
                },
                "imputation": {
                    "type": "string",
                    "title": "Imputations"
                },
                "quality_checks": {
                    "type": "string",
                    "title": "Quality control methods"
                },
                "quality_note": {
                    "type": "string",
                    "title": "Note on data quality"
                },
                "series_break": {
                    "type": "string",
                    "title": "Breaks in series"
                },
                "statistical_concept": {
                    "type": "string",
                    "title": "Statistical concept"
                },
                "limitation": {
                    "type": "string",
                    "title": "Limitations  and exceptions"
                },
                "topics": {
                    "type": "array",
                    "title": "Topics",
                    "description": "Topics covered by the indicator",
                    "items": {
                        "type": "object",
                        "properties": {
                            "topic": {
                                "title": "Topic",
                                "type": "string"
                            },
                            "vocabulary": {
                                "title": "Vocabulary",
                                "description": "Name of the controlled vocabulary, if the topic is from a taxonomy.",
                                "type": "string"
                            },
                            "uri": {
                                "title": "Vocabulary URI",
                                "description": "Link to the controlled vocabulary web page, if the topic is from a taxonomy.",
                                "type": "string"
                            }
                        },
                        "required": [
                            "topic"
                        ]
                    }
                },
                "relevance": {
                    "type": "string",
                    "title": "Relavance"
                },
                "series_dates": {
                    "type": "array",
                    "title": "Series dates",
                    "items": {
                        "type": "object",
                        "properties": {
                            "start": {
                                "type": "string",
                                "title": "Start"
                            },
                            "end": {
                                "type": "string",
                                "title": "End"
                            }
                        }
                    }
                },
                "geographic_units": {
                    "title": "Geographic locations",
                    "description": "List of geographic units (regions, countries, states, provinces, etc.) for which data are available in the database.",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "title": "Location name",
                                "description": "Name of the geographic unit e.g. 'World', 'Africa', 'Afghanistan'",
                                "type": "string"
                            },
                            "code": {
                                "title": "Location code",
                                "description": "Code of the geographic unit (for countries, preferred = ISO3 code)",
                                "type": "string"
                            },
                            "type": {
                                "title": "Type",
                                "description": "Type of geographic unit e.g. country, state, region, province etc",
                                "type": "string"
                            }
                        },
                        "required": [
                            "name"
                        ]
                    }
                },
                "aggregation_method": {
                    "type": "string",
                    "title": "Aggregation method"
                },
                "ser_access_license": {
                    "type": "object",
                    "title": "Access licence",
                    "properties": {
                        "type": {
                            "type": "string",
                            "title": "License type"
                        },
                        "uri": {
                            "type": "string",
                            "title": "URI"
                        }
                    }
                },
                "confidentiality": {
                    "type": "string",
                    "title": "Confidentiality statement",
                    "description": "Confidentiality statement"
                },
                "confidentiality_status": {
                    "type": "string",
                    "title": "Confidentiality status"
                },
                "confidentiality_note": {
                    "type": "string",
                    "title": "Confidentiality note"
                },
                "series_links": {
                    "type": "array",
                    "title": "Series links",
                    "description": "Links to API calls, websites, etc.",
                    "items": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "title": "Link type",
                                "description": "Link types - API, website, etc."
                            },
                            "description": {
                                "type": "string",
                                "title": "Description"
                            },
                            "url": {
                                "type": "string",
                                "title": "Link URL"
                            }
                        }
                    }
                },
                "source": {
                    "type": "string",
                    "title": "Original source"
                },
                "source_note": {
                    "type": "string",
                    "title": "Notes form original source"
                },
                "keywords": {
                    "type": "array",
                    "description": "Keywords",
                    "_ddi_xpath": "stdyDscr/stdyInfo/subject/keywords",
                    "items": {
                        "type": "object",
                        "properties": {
                            "keyword": {
                                "title": "Keyword",
                                "type": "string"
                            },
                            "uri": {
                                "title": "uri",
                                "type": "string"
                            }
                        }
                    }
                },
                "notes": {
                    "type": "string",
                    "title": "Notes"
                },
                "related_indicators": {
                    "type": "array",
                    "title": "Related indicators",
                    "description": "Related indicators",
                    "items": {
                        "type": "object",
                        "properties": {
                            "idno": {
                                "title": "Indicator ID",
                                "type": "string"
                            },
                            "title": {
                                "title": "Indicator title",
                                "type": "string"
                            },
                            "uri": {
                                "title": "URI",
                                "type": "string"
                            }
                        }
                    },
                    "required": [
                        "idno"
                    ]
                },
                "compliance": {
                    "type": "object",
                    "title": "Compliance with international resolution",
                    "description": "Compliance with international resolution",
                    "properties": {
                        "value": {
                            "type": "string",
                            "title": "Resolution"
                        },
                        "uri": {
                            "type": "string",
                            "title": "URI"
                        },
                        "org": {
                            "type": "string",
                            "title": "Organization name"
                        }
                    }
                },
                "series_groups": {
                    "type": "object",
                    "title": "Series groups",
                    "description": "Series included in groups",
                    "properties": {
                        "name": {
                            "type": "string",
                            "title": "Name"
                        },
                        "uri": {
                            "type": "string",
                            "title": "URI"
                        },
                        "version": {
                            "type": "string",
                            "title": "Version"
                        }
                    }
                }
            },
            "required": ["fid", "vid", "name", "labl"]
        }
    },

    "type": "object",
    "$ref": "#/definitions/series"
}