{
  "$id": "https://www.hestia.earth/schema-data/json-schema/Term-deep.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$comment": "Schema version 39.0.1",
  "title": "Term",
  "description": "An item from the [Glossary of Terms](/glossary/) (controlled vocabulary). The Glossary of Terms ensures the most important data fields describing the agri-food system are named consistently. Terms can only be referred to by their <code>[@id](/schema/Term#@id)</code> or their <code>[name](/schema/Term#name)</code>. Changes to Terms and their fields can be requested via [GitLab](https://gitlab.com/hestia-earth/hestia-glossary/-/blob/develop/CONTRIBUTING.md).\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": "Term",
      "enum": [
        "Term"
      ]
    },
    "@type": {
      "type": "string",
      "description": "Type of the Node",
      "default": "Term",
      "enum": [
        "Term"
      ],
      "extend": true
    },
    "name": {
      "type": "string",
      "description": "The name of the Term.",
      "examples": [
        "Wheat, grain",
        "N2O, to air, inorganic fertiliser, direct",
        "France"
      ],
      "extend": true,
      "searchable": true,
      "unique": true
    },
    "synonyms": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of synonyms for the name of the Term.",
      "examples": [],
      "searchable": true
    },
    "definition": {
      "type": "string",
      "description": "A definition of the Term.",
      "examples": [
        "The grain, including outer husk.",
        "Nitrous oxide emissions to air from nitrification and denitrification of inorganic fertiliser."
      ]
    },
    "description": {
      "type": "string",
      "description": "A more detailed description of the Term, which can include information about the source of these data.",
      "examples": [],
      "searchable": true
    },
    "units": {
      "type": "string",
      "description": "The units that the value (quantity) must always be expressed in (e.g., kg).",
      "examples": [
        "kg",
        "kg N2O"
      ],
      "extend": true,
      "searchable": true
    },
    "unitsDescription": {
      "type": "string",
      "description": "A description of the units of the term in plain and simple language.",
      "examples": [],
      "searchable": true
    },
    "subClassOf": {
      "type": "array",
      "items": {
        "$ref": "./Term-deep.json#"
      },
      "description": "A list of references to the Terms that are one level above in a hierarchy (see the RDF Vocabulary for more details).",
      "examples": [
        [
          {
            "@id": "wheatPlants",
            "@type": "Term",
            "name": "Wheat plants",
            "termType": "crop"
          }
        ]
      ],
      "searchable": true,
      "uniqueArrayItem": [
        "@id"
      ]
    },
    "defaultProperties": {
      "type": "array",
      "items": {
        "$ref": "./Property.json#"
      },
      "description": "A list of default Properties of the Term (e.g., the dry matter of a crop).",
      "examples": [
        [
          {
            "@type": "Property",
            "term": {
              "@id": "dryMatter",
              "@type": "Term",
              "name": "Dry matter",
              "termType": "property"
            },
            "value": 87
          }
        ]
      ],
      "searchable": true,
      "uniqueArrayItem": [
        "term.@id",
        "key.@id"
      ]
    },
    "casNumber": {
      "type": "string",
      "pattern": "^[\\d\\-]+$",
      "description": "The unique numerical identifier assigned by the Chemical Abstracts Service (CAS) to every chemical substance described in the open scientific literature.",
      "examples": [],
      "unique": true
    },
    "ecoinventReferenceProductId": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "The id of the reference product of the activity in the ecoinvent database.",
      "examples": []
    },
    "fishstatName": {
      "type": "string",
      "description": "The name of the species in the FAO FISHSTAT database.",
      "examples": []
    },
    "hsCode": {
      "type": "string",
      "description": "The World Customs Organization Harmonized System 2017 code.",
      "examples": [
        "1214.90"
      ]
    },
    "iccCode": {
      "type": "integer",
      "description": "The Indicative Crop Classification code.",
      "examples": [
        11
      ],
      "minimum": 0
    },
    "iso31662Code": {
      "type": "string",
      "pattern": "^[A-Z]{2}-?([A-Za-z\\d]{1,3})?$",
      "description": "The ISO 3166-2 code for sub divisions within countries.",
      "examples": [
        "FR"
      ],
      "searchable": true
    },
    "gadmFullName": {
      "type": "string",
      "description": "The full name of the administrative region including all higher level region names in the GADM database.",
      "examples": [
        "France"
      ]
    },
    "gadmId": {
      "type": "string",
      "pattern": "^[A-Z]{3}[\\.]?([\\d_\\.]*)?$",
      "description": "The unique identifier assigned by GADM database.",
      "examples": [
        "FRA"
      ]
    },
    "gadmLevel": {
      "type": "integer",
      "description": "The level of the administrative region in the GADM database.",
      "examples": [],
      "minimum": 0,
      "maximum": 5,
      "searchable": true
    },
    "gadmName": {
      "type": "string",
      "description": "The name of the administrative region in the GADM database.",
      "examples": [
        "France"
      ],
      "searchable": true
    },
    "gadmCountry": {
      "type": "string",
      "description": "The name of the country in the GADM database.",
      "examples": [],
      "searchable": true
    },
    "gtin": {
      "type": "string",
      "pattern": "^[\\d]{8,14}$",
      "description": "The Global Trade Item Number (GTIN) is an identifier for trade items, developed by GS1.",
      "examples": []
    },
    "canonicalSmiles": {
      "type": "string",
      "pattern": "^[^J][A-Za-z0-9@+%\\.\\-\\[\\]\\(\\)\\\\\\/=#$]*$",
      "description": "The simplified molecular-input line-entry system (SMILES) is a specification in is a string of symbols which represents a chemical's three-dimensional structure. A large number of SMILES exist for any particular structure, and canonical SMILES generates a single generic SMILES amongst all possibilities.",
      "examples": []
    },
    "latitude": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "The latitude (-90 to 90, WGS84 datum). If a polygon, the centroid.",
      "examples": [
        46.55891593
      ],
      "searchable": true
    },
    "longitude": {
      "type": "number",
      "minimum": -180,
      "maximum": 180,
      "description": "The longitude (-180 to 180, WGS84 datum). If a polygon, the centroid.",
      "examples": [
        2.553552532
      ],
      "searchable": true
    },
    "area": {
      "type": "number",
      "minimum": 0,
      "description": "The area of the region in km2.",
      "examples": [],
      "extend": true
    },
    "openLCAId": {
      "type": "string",
      "description": "The identifier for the activity in the openLCA database.",
      "examples": [],
      "searchable": true,
      "unique": true
    },
    "scientificName": {
      "type": "string",
      "description": "The taxonomic name of an organism that consists of the genus and species.",
      "examples": [
        "Triticum aestivum"
      ],
      "searchable": true
    },
    "website": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "A website URL.",
      "examples": []
    },
    "agrovoc": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "A hyperlink to the FAO AGROVOC multilingual thesaurus entry.",
      "examples": []
    },
    "aquastatSpeciesFactSheet": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "A hyperlink to the AQUASTAT species fact sheet.",
      "examples": []
    },
    "cornellBiologicalControl": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "A hyperlink to the Cornell University biological control glossary page.",
      "examples": []
    },
    "ecolabelIndex": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "A hyperlink to the Ecolabel Index page.",
      "examples": []
    },
    "feedipedia": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "A hyperlink to the Feedipedia page.",
      "examples": [
        {
          "@id": "https://www.feedipedia.org/node/12754"
        }
      ]
    },
    "fishbase": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "A hyperlink to the Fishbase page.",
      "examples": []
    },
    "pubchem": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "A hyperlink to the PubChem page.",
      "examples": []
    },
    "wikipedia": {
      "type": "object",
      "required": [
        "@id"
      ],
      "properties": {
        "@id": {
          "type": "string"
        }
      },
      "description": "A hyperlink to the Wikipedia page.",
      "examples": [
        {
          "@id": "https://en.wikipedia.org/wiki/Wheat"
        }
      ]
    },
    "termType": {
      "type": "string",
      "description": "The type of term.",
      "examples": [
        "crop",
        "model",
        "region"
      ],
      "enum": [
        "animalBreed",
        "animalProduct",
        "animalManagement",
        "aquacultureManagement",
        "biochar",
        "biologicalControlAgent",
        "building",
        "characterisedIndicator",
        "crop",
        "aquaticCrop",
        "cropEstablishment",
        "cropResidue",
        "cropResidueManagement",
        "cropSupport",
        "electricity",
        "emission",
        "endpointIndicator",
        "excreta",
        "excretaManagement",
        "experimentDesign",
        "feedFoodAdditive",
        "fertiliserBrandName",
        "forage",
        "fuel",
        "inorganicFertiliser",
        "irrigation",
        "landCover",
        "landUseManagement",
        "liveAnimal",
        "liveAquaticSpecies",
        "machinery",
        "material",
        "measurement",
        "methodEmissionResourceUse",
        "methodMeasurement",
        "model",
        "operation",
        "organicFertiliser",
        "otherOrganicChemical",
        "otherInorganicChemical",
        "pastureManagement",
        "pesticideAI",
        "pesticideBrandName",
        "processedFood",
        "processingAid",
        "property",
        "region",
        "resourceUse",
        "sampleDesign",
        "seed",
        "soilAmendment",
        "soilTexture",
        "soilType",
        "standardsLabels",
        "substrate",
        "system",
        "tillage",
        "transport",
        "usdaSoilType",
        "veterinaryDrug",
        "waste",
        "wasteManagement",
        "water",
        "waterRegime"
      ],
      "extend": true,
      "searchable": 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": [],
      "format": "date",
      "internal": true,
      "searchable": true
    }
  },
  "allOf": [
    {
      "if": {
        "required": [
          "iccCode"
        ]
      },
      "then": {
        "properties": {
          "termType": {
            "enum": [
              "crop"
            ]
          }
        }
      }
    },
    {
      "if": {
        "anyOf": [
          {
            "required": [
              "aquastatSpeciesFactSheet"
            ]
          },
          {
            "required": [
              "fishbase"
            ]
          },
          {
            "required": [
              "fishstatName"
            ]
          }
        ]
      },
      "then": {
        "properties": {
          "termType": {
            "enum": [
              "liveAquaticSpecies",
              "aquaticCrop"
            ]
          }
        }
      }
    },
    {
      "if": {
        "anyOf": [
          {
            "required": [
              "iso31662Code"
            ]
          },
          {
            "required": [
              "gadmFullName"
            ]
          },
          {
            "required": [
              "gadmLevel"
            ]
          },
          {
            "required": [
              "gadmName"
            ]
          },
          {
            "required": [
              "gadmId"
            ]
          },
          {
            "required": [
              "latitude"
            ]
          },
          {
            "required": [
              "longitude"
            ]
          }
        ]
      },
      "then": {
        "properties": {
          "termType": {
            "enum": [
              "region"
            ]
          }
        }
      }
    }
  ],
  "oneOf": [
    {
      "required": [
        "@type",
        "@id"
      ]
    }
  ]
}