{
  "$id": "https://www.hestia.earth/schema-data/json-schema/Source.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$comment": "Schema version 39.0.1",
  "title": "Source",
  "description": "The Source of these data.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "description": "My local unique ID",
      "examples": [
        "my-unique-id-1"
      ],
      "exportDefaultCSV": true,
      "pattern": "^[\\w\\u00C0-\\u017F\\-\\.\\s\\(\\),+]+$"
    },
    "@id": {
      "type": "string",
      "description": "Unique id assigned by HESTIA",
      "examples": [
        "@hestia-unique-id-1"
      ],
      "extend": true,
      "exportDefaultCSV": true
    },
    "type": {
      "type": "string",
      "description": "Type of the Node",
      "default": "Source",
      "enum": [
        "Source"
      ]
    },
    "@type": {
      "type": "string",
      "description": "Type of the Node",
      "default": "Source",
      "enum": [
        "Source"
      ],
      "extend": true
    },
    "name": {
      "type": "string",
      "description": "The name from bibliography.",
      "examples": [
        "Gigou (1990)"
      ],
      "extend": true,
      "internal": true,
      "searchable": true
    },
    "bibliography": {
      "$ref": "./Bibliography.json#",
      "description": "The bibliographic information describing the document or dataset.",
      "examples": [
        {
          "@type": "Bibliography",
          "name": "Gigou (1990)",
          "title": "Bilan des éléments minéraux sous une rotation blé-orge-colza en lysimètres",
          "authors": [
            {
              "@id": "avvs577",
              "@type": "Actor",
              "name": "J. Gigou"
            }
          ],
          "outlet": "L'Agronomie",
          "year": 1990,
          "volume": 41,
          "issue": "2",
          "pages": "149-153"
        }
      ],
      "searchable": true,
      "unique": true,
      "exportDefaultCSV": true
    },
    "metaAnalyses": {
      "type": "array",
      "items": {
        "$ref": "./Source-deep.json#"
      },
      "description": "If multiple Sources were consolidated by meta-analysis, a list of sources describing the meta-analysis document or dataset.",
      "examples": [
        [
          {
            "@id": "xgfr67d",
            "@type": "Source",
            "name": "Poore & Nemecek (2018)",
            "bibliography": {
              "@type": "Bibliography",
              "name": "Poore & Nemecek (2018)",
              "documentDOI": "10.1126/science.aaq0216",
              "scopus": "2-s2.0-85048197694",
              "mendeleyID": "9ecd6598-d3c7-36a3-965b-821be771b328",
              "title": "Reducing food's environmental impacts through producers and consumers",
              "authors": [
                {
                  "@id": "actor-1",
                  "@type": "Actor",
                  "name": "J. Poore, Univerity of Oxford"
                },
                {
                  "@id": "actor-2",
                  "@type": "Actor",
                  "name": "T. Nemecek, Agroscope"
                }
              ],
              "outlet": "Science",
              "year": 2018,
              "abstract": "Food's environmental impacts are created by millions of diverse producers. To identify solutions that are effective under this heterogeneity, we consolidated data covering five environmental indicators; 38,700 farms; and 1600 processors, packaging types, and retailers. Impact can vary 50-fold among producers of the same product, creating substantial mitigation opportunities. However, mitigation is complicated by trade-offs, multiple ways for producers to achieve low impacts, and interactions throughout the supply chain. Producers have limits on how far they can reduce impacts. Most strikingly, impacts of the lowest-impact animal products typically exceed those of vegetable substitutes, providing new evidence for the importance of dietary change. Cumulatively, our findings support an approach where producers monitor their own impacts, flexibly meet environmental targets by choosing from multiple practices, and communicate their impacts to consumers."
            }
          }
        ]
      ],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "uploadBy": {
      "$ref": "./Actor-deep.json#",
      "description": "The user who uploaded these data.",
      "examples": [
        {
          "@id": "actor-577",
          "@type": "Actor",
          "name": "J. Poore, University of Oxford"
        }
      ],
      "internal": true
    },
    "uploadNotes": {
      "type": "string",
      "description": "A free text field to describe the data upload, including any issues in the original data, assumptions made, or other important points.",
      "examples": []
    },
    "validationDate": {
      "type": "string",
      "description": "The date the data was checked by an independent data validator ISO 8601 format (YYYY-MM-DD).",
      "examples": [],
      "format": "date",
      "internal": true
    },
    "validationBy": {
      "type": "array",
      "items": {
        "$ref": "./Actor-deep.json#"
      },
      "description": "The people/organizations who/which validated these data.",
      "examples": [],
      "internal": true
    },
    "intendedApplication": {
      "type": "string",
      "description": "The intended application (see ISO 14044:2006).",
      "examples": []
    },
    "studyReasons": {
      "type": "string",
      "description": "The reasons for carrying out the study (see ISO 14044:2006).",
      "examples": []
    },
    "intendedAudience": {
      "type": "string",
      "description": "The intended audience i.e., to whom the results of the study are intended to be communicated (see ISO 14044:2006).",
      "examples": []
    },
    "comparativeAssertions": {
      "type": "boolean",
      "description": "Whether the results are intended to be used in comparative assertions (see ISO 14044:2006).",
      "examples": []
    },
    "sampleDesign": {
      "$ref": "./Term-deep.json#",
      "description": "The sample design, taken from the Glossary.",
      "examples": [],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "weightingMethod": {
      "type": "string",
      "description": "For sample designs involving weights, a description of the weights.",
      "examples": [],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "experimentDesign": {
      "$ref": "./Term-deep.json#",
      "description": "The design of the experiment, taken from the Glossary.",
      "examples": [],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "originalLicense": {
      "type": "string",
      "description": "The public copyright license that the original version of these data were licensed under. Required for public uploads only.    CC0 is a Creative Commons license\n    that relinquishes copyright and releases the material into the public domain.\n\n    CC-BY is a Creative Commons license\n    allowing reuse as long as credit is given to the author of the material.\n\n    CC-BY-SA is a Creative Commons license\n    allowing reuse as long as credit is given to the author of the material and adaptations\n    of the material are shared under the same license terms.\n\n    CC-BY-NC is a Creative Commons license\n    allowing reuse for non-commercial purposes as long as credit is given to the author of the material.\n\n    CC-BY-NC-SA is a Creative Commons license\n    allowing reuse for non-commercial purposes as long as credit is given to the author of the material\n    and adaptations of the material are shared under the same license terms.\n\n    CC-BY-NC-ND is a Creative Commons license\n    allowing reuse for non-commercial purposes as long as credit is given to the author of the material\n    but preventing derivatives or adaptations of the material being made.\n\n    CC-BY-ND is a Creative Commons license\n    allowing reuse as long as credit is given to the author of the material\n    but preventing derivatives or adaptations of the material being made.\n\n    GNU-FDL is a GNU Project license\n    allowing reuse as long as adaptations of the material are shared under the same license terms.\n\n    other public license means the material is licensed under a license not listed above.\n\n    no public license means the material is under copyright by the original author or\n    publisher with no rights granted for public use beyond the exceptions to copyright in national law.\n",
      "examples": [
        "CC-BY"
      ],
      "enum": [
        "CC0",
        "CC-BY",
        "CC-BY-SA",
        "CC-BY-NC",
        "CC-BY-NC-SA",
        "CC-BY-NC-ND",
        "CC-BY-ND",
        "GNU-FDL",
        "other public license",
        "no public license"
      ],
      "searchable": true,
      "exportDefaultCSV": true,
      "recommended": true
    },
    "dataPrivate": {
      "type": "boolean",
      "description": "If these data are private. Private means that HESTIA administrators can access these data and you can grant access to other platform users, but these data will not be made available to any other users of the platform or distributed to third parties. If we find the Source on the Mendeley catalogue, the data in the Source node are public and we set this field to false.",
      "examples": [],
      "default": false
    },
    "originalId": {
      "type": "string",
      "description": "The identifier for these data in the source database (e.g., if the data were converted from openLCA or ecoinvent, the id field from that database).",
      "examples": [],
      "internal": true
    },
    "schemaVersion": {
      "type": "string",
      "description": "The version of the schema when these data were created.",
      "examples": [],
      "internal": true,
      "searchable": true
    },
    "createdAt": {
      "type": "string",
      "description": "Date created on HESTIA in ISO 8601 format (YYYY-MM-DD).",
      "examples": [],
      "format": "date",
      "internal": true,
      "searchable": true
    },
    "updatedAt": {
      "type": "string",
      "description": "Last update date on HESTIA in ISO 8601 format (YYYY-MM-DD).",
      "examples": [
        "2020-02-14"
      ],
      "format": "date",
      "internal": true,
      "searchable": true
    }
  },
  "allOf": [
    {
      "if": {
        "required": [
          "sampleDesign"
        ]
      },
      "then": {
        "properties": {
          "sampleDesign": {
            "properties": {
              "termType": {
                "enum": [
                  "sampleDesign"
                ]
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "experimentDesign"
        ]
      },
      "then": {
        "properties": {
          "experimentDesign": {
            "properties": {
              "termType": {
                "enum": [
                  "experimentDesign"
                ]
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "dataPrivate"
        ],
        "properties": {
          "dataPrivate": {
            "const": false
          }
        }
      },
      "then": {
        "required": [
          "originalLicense"
        ]
      }
    }
  ],
  "oneOf": [
    {
      "required": [
        "@type",
        "@id"
      ]
    },
    {
      "required": [
        "type",
        "id"
      ]
    }
  ],
  "required": [
    "name",
    "bibliography",
    "uploadBy",
    "dataPrivate"
  ]
}