{
  "$id": "https://www.hestia.earth/schema-data/json-schema/ImpactAssessment-deep.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$comment": "Schema version 39.0.1",
  "title": "ImpactAssessment",
  "description": "The emissions, resource uses, and environmental impacts created during the production of one unit of a [Product](/schema/ImpactAssessment#product) from a [Cycle](/schema/Cycle). The functional unit is defined by the units of the Product. If there are more than one Product in the Cycle, allocation is used to apportion these impacts across the Products.\n",
  "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": "ImpactAssessment",
      "enum": [
        "ImpactAssessment"
      ]
    },
    "@type": {
      "type": "string",
      "description": "Type of the Node",
      "default": "ImpactAssessment",
      "enum": [
        "ImpactAssessment"
      ],
      "extend": true
    },
    "name": {
      "type": "string",
      "description": "The name of the Impact Assessment.",
      "examples": [
        "Impact Assessment for 'Wheat, grain' under treatment '50N' in 1989 in France"
      ],
      "searchable": true
    },
    "version": {
      "type": "string",
      "description": "The version of the Impact Assessment.",
      "examples": []
    },
    "versionDetails": {
      "type": "string",
      "description": "A text description of the version of the Impact Assessment.",
      "examples": []
    },
    "cycle": {
      "$ref": "./Cycle-deep.json#",
      "description": "A reference to the node describing the production Cycle.",
      "examples": [],
      "searchable": true,
      "exportDefaultCSV": true,
      "recommended": true
    },
    "product": {
      "$ref": "./Product.json#",
      "description": "The Product produced during the production Cycle, which is the target of this Impact Assessment.",
      "examples": [
        {
          "@type": "Product",
          "term": {
            "@id": "wheatGrain",
            "@type": "Term",
            "name": "Wheat, grain",
            "termType": "crop"
          },
          "value": [
            100
          ]
        }
      ],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "functionalUnitQuantity": {
      "type": "number",
      "description": "The quantity of the product that this Impact Assessment is expressed per. The units are determined by the Term of the product (e.g., 1kg for Wheat, grain, or 1 head for a Pig).",
      "examples": [
        1
      ],
      "const": 1,
      "exportDefaultCSV": true
    },
    "allocationMethod": {
      "type": "string",
      "description": "The method used to allocate environmental impacts between Products.",
      "examples": [
        "economic"
      ],
      "enum": [
        "economic",
        "mass",
        "energy",
        "biophysical",
        "none",
        "none required",
        "system expansion"
      ],
      "exportDefaultCSV": true
    },
    "endDate": {
      "type": "string",
      "description": "The end date or year of production in ISO 8601 format (YYYY-MM-DD, YYYY-MM, or YYYY).",
      "examples": [
        "1989-12-31"
      ],
      "datePattern": true,
      "searchable": true,
      "exportDefaultCSV": true
    },
    "startDate": {
      "type": "string",
      "description": "The start date of production in ISO 8601 format (YYYY-MM-DD, YYYY-MM, or YYYY).",
      "examples": [],
      "datePattern": true,
      "exportDefaultCSV": true
    },
    "site": {
      "$ref": "./Site-deep.json#",
      "description": "A reference to the node describing the Site where production occurred.",
      "examples": [],
      "searchable": true,
      "exportDefaultCSV": true,
      "recommended": true
    },
    "country": {
      "$ref": "./Term-deep.json#",
      "description": "The country from the Glossary, following GADM naming conventions.",
      "examples": [
        {
          "@id": "GADM-FRA",
          "@type": "Term",
          "name": "France",
          "termType": "region"
        }
      ],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "region": {
      "$ref": "./Term-deep.json#",
      "description": "The lowest level GADM region available following the naming convention used in the Glossary.",
      "examples": [
        {
          "@id": "GADM-FRA.6.9.3_1",
          "@type": "Term",
          "name": "Forbach (Districts), Moselle (Department), Grand Est (Region), France",
          "termType": "region"
        }
      ],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "organisation": {
      "$ref": "./Organisation-deep.json#",
      "description": "A reference to the node describing the Organisation that produced the Product.",
      "examples": [],
      "searchable": true
    },
    "source": {
      "$ref": "./Source-deep.json#",
      "description": "The Source for the data in the Impact Assessment. Not required (but recommended) for public uploads (i.e., where dataPrivate is false).",
      "examples": [
        {
          "@id": "source",
          "@type": "Source",
          "name": "Gigou (1990)"
        }
      ],
      "searchable": true,
      "exportDefaultCSV": true,
      "recommended": true
    },
    "emissionsResourceUse": {
      "type": "array",
      "items": {
        "$ref": "./Indicator.json#"
      },
      "description": "A list of emissions and resource uses.",
      "examples": [
        [
          {
            "@type": "Indicator",
            "term": {
              "@id": "no3ToGroundwaterSoilFlux",
              "@type": "Term",
              "name": "NO3, to groundwater, soil flux",
              "units": "kg NO3",
              "termType": "emission"
            },
            "value": 0.01709,
            "methodModel": {
              "@id": "percolationLysimeter",
              "@type": "Term",
              "name": "Percolation lysimeter",
              "termType": "methodEmissionResourceUse"
            },
            "methodTier": "tier 2"
          }
        ]
      ],
      "searchable": true,
      "exportDefaultCSV": true,
      "uniqueArrayItem": [
        "term.@id",
        "key.@id",
        "inputs.@id",
        "animals.@id",
        "country.@id",
        "operation.@id",
        "methodModel.@id",
        "transformation.@id",
        "landCover.@id",
        "previousLandCover.@id"
      ]
    },
    "impacts": {
      "type": "array",
      "items": {
        "$ref": "./Indicator.json#"
      },
      "description": "The mid-point environmental impact Indicators. These are calculated from emissions and resourceUse by applying characterisation factors to generate a characterised impact indicator.",
      "examples": [
        [
          {
            "@type": "Indicator",
            "term": {
              "@id": "gwp100",
              "@type": "Term",
              "name": "GWP100",
              "units": "kg CO2eq",
              "termType": "characterisedIndicator"
            },
            "methodModel": {
              "@id": "ipcc2007",
              "@type": "Term",
              "name": "IPCC (2007)",
              "units": "kg CO2eq",
              "termType": "model"
            },
            "value": 0.1947728
          }
        ]
      ],
      "searchable": true,
      "exportDefaultCSV": true,
      "uniqueArrayItem": [
        "term.@id",
        "key.@id",
        "inputs.@id",
        "methodModel.@id"
      ]
    },
    "endpoints": {
      "type": "array",
      "items": {
        "$ref": "./Indicator.json#"
      },
      "description": "The end-point environmental impact Indicators. These are calculated from the mid-point impacts by applying characterisation factors to generate an end-point impact indicator.",
      "examples": [],
      "searchable": true,
      "exportDefaultCSV": true,
      "uniqueArrayItem": [
        "term.@id",
        "inputs.@id",
        "methodModel.@id"
      ]
    },
    "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.",
      "examples": [],
      "default": false
    },
    "organic": {
      "type": "boolean",
      "description": "If the Cycle has an organic label. Used by the aggregation engine only.",
      "examples": [],
      "internal": true,
      "default": false
    },
    "irrigated": {
      "type": "boolean",
      "description": "If the Cycle was irrigated. Used by the aggregation engine only.",
      "examples": [],
      "internal": true,
      "default": false
    },
    "autoGenerated": {
      "type": "boolean",
      "description": "If this node was autogenerated during upload.",
      "examples": [],
      "internal": true,
      "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
    },
    "added": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of fields that have been added to the original dataset.",
      "examples": [],
      "internal": true
    },
    "addedVersion": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of versions of the model used to add these fields.",
      "examples": [],
      "internal": true
    },
    "updated": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of fields that have been updated on the original dataset.",
      "examples": [],
      "internal": true
    },
    "updatedVersion": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of versions of the model used to update these fields.",
      "examples": [],
      "internal": true
    },
    "aggregated": {
      "type": "boolean",
      "description": "If this Impact Assessment has been 'aggregated' using data from multiple Impact Assessments.",
      "examples": [],
      "internal": true,
      "searchable": true
    },
    "aggregatedDataValidated": {
      "type": "boolean",
      "description": "If this aggregated Impact Assessment has been validated by the HESTIA team.",
      "examples": [],
      "internal": true,
      "searchable": true
    },
    "aggregatedVersion": {
      "type": "string",
      "description": "A version of the aggregation engine corresponding to this Impact Assessment.",
      "examples": [],
      "internal": true
    },
    "aggregatedQualityScore": {
      "type": "integer",
      "description": "A data quality score for aggregated data, set equal to the quality score of the linked Cycle.",
      "examples": [],
      "minimum": 0,
      "internal": true,
      "searchable": true
    },
    "aggregatedQualityScoreMax": {
      "type": "integer",
      "description": "The maximum value for the aggregated quality score, set equal tothe max quality score of the linked Cycle.",
      "examples": [],
      "minimum": 3,
      "internal": true,
      "searchable": true
    },
    "aggregatedImpactAssessments": {
      "type": "array",
      "items": {
        "$ref": "./ImpactAssessment-deep.json#"
      },
      "description": "Impact Assessments used to aggregated this Impact Assessment.",
      "examples": [],
      "internal": true
    },
    "aggregatedSources": {
      "type": "array",
      "items": {
        "$ref": "./Source-deep.json#"
      },
      "description": "Sources used to aggregated this Impact Assessment.",
      "examples": [],
      "internal": 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": [],
      "format": "date",
      "internal": true,
      "searchable": true
    }
  },
  "allOf": [
    {
      "if": {
        "required": [
          "dataPrivate"
        ],
        "properties": {
          "dataPrivate": {
            "const": false
          }
        }
      },
      "then": {
        "required": [
          "source"
        ]
      }
    },
    {
      "if": {
        "required": [
          "country"
        ]
      },
      "then": {
        "properties": {
          "country": {
            "properties": {
              "termType": {
                "enum": [
                  "region"
                ]
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "region"
        ]
      },
      "then": {
        "properties": {
          "region": {
            "properties": {
              "termType": {
                "enum": [
                  "region"
                ]
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "emissionsResourceUse"
        ]
      },
      "then": {
        "properties": {
          "emissionsResourceUse": {
            "items": {
              "properties": {
                "term": {
                  "properties": {
                    "termType": {
                      "enum": [
                        "emission",
                        "resourceUse"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "impacts"
        ]
      },
      "then": {
        "properties": {
          "impacts": {
            "items": {
              "properties": {
                "term": {
                  "properties": {
                    "termType": {
                      "enum": [
                        "characterisedIndicator"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "endpoints"
        ]
      },
      "then": {
        "properties": {
          "endpoints": {
            "items": {
              "properties": {
                "term": {
                  "properties": {
                    "termType": {
                      "enum": [
                        "endpointIndicator"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "impacts"
        ]
      },
      "then": {
        "properties": {
          "impacts": {
            "items": {
              "required": [
                "methodModel"
              ]
            }
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "endpoints"
        ]
      },
      "then": {
        "properties": {
          "impacts": {
            "items": {
              "required": [
                "methodModel"
              ]
            }
          }
        }
      }
    }
  ],
  "oneOf": [
    {
      "required": [
        "@type",
        "@id"
      ]
    },
    {
      "required": [
        "type",
        "id"
      ]
    }
  ]
}