{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "sourceDataSet": {
      "type": "object",
      "properties": {
        "@xmlns:common": {
          "type": "string",
          "const": "http://lca.jrc.it/ILCD/Common"
        },
        "@xmlns": {
          "type": "string",
          "const": "http://lca.jrc.it/ILCD/Source"
        },
        "@xmlns:xsi": {
          "type": "string",
          "const": "http://www.w3.org/2001/XMLSchema-instance"
        },
        "@version": {
          "type": "string",
          "const": "1.1"
        },
        "@xsi:schemaLocation": {
          "type": "string",
          "const": "http://lca.jrc.it/ILCD/Source ../../schemas/ILCD_SourceDataSet.xsd"
        },
        "sourceInformation": {
          "type": "object",
          "properties": {
            "dataSetInformation": {
              "type": "object",
              "properties": {
                "common:UUID": {
                  "$ref": "tidas_data_types.json#/$defs/UUID",
                  "description": "Automatically generated Universally Unique Identifier of this data set. Together with the \"Data set version\", the UUID uniquely identifies each data set."
                },
                "common:shortName": {
                  "$ref": "tidas_data_types.json#/$defs/StringMultiLang",
                  "description": "Short name for the \"Source citation\", i.e. for the bibliographical reference or reference to internal data sources used."
                },
                "classificationInformation": {
                  "type": "object",
                  "description": "Hierarchical classification of the Source foreseen to be used to structure the Source content of the database. (Note: This entry is NOT required for the identification of a Source. It should nevertheless be avoided to use identical names for Source in the same class.",
                  "properties": {
                    "common:classification": {
                      "type": "object",
                      "properties": {
                        "common:class": {
                          "type": "object",
                          "properties": {
                            "@level": {
                              "$ref": "tidas_data_types.json#/$defs/LevelType",
                              "const": "0"
                            },
                            "@classId": {
                              "type": "string"
                            },
                            "#text": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "@level",
                            "@classId",
                            "#text"
                          ],
                          "dependencies": {
                            "@level": {
                              "$ref": "./tidas_sources_category.json#/$defs/Source"
                            }
                          }
                        },
                        "common:other": {
                          "$ref": "tidas_data_types.json#/$defs/CommonOther"
                        }
                      },
                      "required": [
                        "common:class"
                      ]
                    }
                  },
                  "required": [
                    "common:classification"
                  ]
                },
                "sourceCitation": {
                  "type": "string",
                  "description": "Bibliographical reference or reference to internal data source. Also used in order to reference to databases and tools, data set formats, conformity systems, pictures etc.."
                },
                "publicationType": {
                  "type": "string",
                  "description": "Bibliographic publication type of the source.",
                  "enum": [
                    "Undefined",
                    "Article in periodical",
                    "Chapter in anthology",
                    "Monograph",
                    "Direct measurement",
                    "Oral communication",
                    "Personal written communication",
                    "Questionnaire",
                    "Software or database",
                    "Other unpublished and grey literature"
                  ]
                },
                "sourceDescriptionOrComment": {
                  "$ref": "tidas_data_types.json#/$defs/FTMultiLang",
                  "description": "Free text for additional description of the source. In case of use of published data it may contain a brief summary of the publication and the kind of medium used (e.g. CD-ROM, hard copy)."
                },
                "referenceToDigitalFile": {
                  "description": "Link to a digital file of the source (www-address or intranet-path; relative or absolue path). (Info: Allows direct access to e.g. complete reports of further documentation, which may also be digitally attached to this data set and exchanged jointly with the XML file.)",
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "@uri": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "array",
                      "minItems": 1,
                      "items": {
                        "type": "object",
                        "properties": {
                          "@uri": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  ]
                },
                "referenceToContact": {
                  "$ref": "tidas_data_types.json#/$defs/GlobalReferenceType",
                  "description": "\"Contact data set\"s of working groups, organisations or database networks to which EITHER this person or entity OR this database, data set format, or compliance system belongs. [Note: This does not necessarily imply a legally binding relationship, but may also be a voluntary membership.]"
                },
                "referenceToLogo": {
                  "$ref": "tidas_data_types.json#/$defs/GlobalReferenceType",
                  "description": "\"Source data set\" of the logo of the organisation or source to be used in reports etc."
                },
                "common:other": {
                  "$ref": "tidas_data_types.json#/$defs/CommonOther"
                }
              },
              "required": [
                "common:UUID",
                "common:shortName",
                "classificationInformation"
              ]
            },
            "common:other": {
              "$ref": "tidas_data_types.json#/$defs/CommonOther"
            }
          },
          "required": [
            "dataSetInformation"
          ]
        },
        "administrativeInformation": {
          "type": "object",
          "description": "Information on data set management and administration.",
          "properties": {
            "dataEntryBy": {
              "type": "object",
              "properties": {
                "common:timeStamp": {
                  "$ref": "tidas_data_types.json#/$defs/dateTime",
                  "description": "Date and time stamp of data set generation, typically an automated entry ('last saved')."
                },
                "common:referenceToDataSetFormat": {
                  "$ref": "tidas_data_types.json#/$defs/GlobalReferenceType",
                  "description": "\"Source data set\" of the used version of the ILCD format. If additional data format fields have been integrated into the data set file, using the \"namespace\" option, the used format namespace(s) are to be given. This is the case if the data sets carries additional information as specified by other, particular LCA formats, e.g. of other database networks or LCA softwares."
                },
                "common:other": {
                  "$ref": "tidas_data_types.json#/$defs/CommonOther"
                }
              },
              "required": [
                "common:timeStamp",
                "common:referenceToDataSetFormat"
              ]
            },
            "publicationAndOwnership": {
              "type": "object",
              "description": "Information related to publication and version management of the data set including copyright and access restrictions.",
              "properties": {
                "common:dataSetVersion": {
                  "allOf": [
                    {
                      "$ref": "tidas_data_types.json#/$defs/Version"
                    }
                  ],
                  "description": "Version number of data set. First two digits refer to major updates, the second two digits to minor revisions and error corrections etc. The third three digits are intended for automatic and internal counting of versions during data set development. Together with the data set's UUID, the \"Data set version\" uniquely identifies each data set."
                },
                "common:referenceToPrecedingDataSetVersion": {
                  "$ref": "tidas_data_types.json#/$defs/GlobalReferenceType",
                  "description": "Last preceding data set, which was replaced by this version. In TIDAS, this reference includes the preceding data set URI, UUID, and version number."
                },
                "common:permanentDataSetURI": {
                  "type": "string",
                  "format": "uri",
                  "description": "URI (i.e. an internet address) of the original of this data set. [Note: This equally globally unique identifier supports users and software tools to identify and retrieve the original version of a data set via the internet or to check for available updates. The URI must not represent an existing WWW address, but it should be unique and point to the data access point, e.g. by combining the data owner's www path with the data set's UUID, e.g. http://www.mycompany.com/lca/processes/50f12420-8855-12db-b606-0900210c9a66.]"
                },
                "common:referenceToOwnershipOfDataSet": {
                  "$ref": "tidas_data_types.json#/$defs/GlobalReferenceType",
                  "description": "\"Contact data set\" of the person or entity who owns this data set. (Note: this is not necessarily the publisher of the data set.)"
                },
                "common:other": {
                  "$ref": "tidas_data_types.json#/$defs/CommonOther"
                }
              },
              "required": [
                "common:dataSetVersion",
                "common:referenceToOwnershipOfDataSet"
              ]
            },
            "common:other": {
              "$ref": "tidas_data_types.json#/$defs/CommonOther"
            }
          },
          "required": [
            "dataEntryBy",
            "publicationAndOwnership"
          ]
        },
        "common:other": {
          "$ref": "tidas_data_types.json#/$defs/CommonOther"
        }
      },
      "required": [
        "@xmlns:common",
        "@xmlns",
        "@xmlns:xsi",
        "@version",
        "@xsi:schemaLocation",
        "sourceInformation",
        "administrativeInformation"
      ]
    }
  },
  "required": [
    "sourceDataSet"
  ]
}
