{
  "$id": "https://www.hestia.earth/schema-data/json-schema/Management.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$comment": "Schema version 39.0.1",
  "title": "Management",
  "description": "The historical and current management of a [Site](/schema/Site). Used to represent land use and land cover history, crop rotations, aquaculture rotations, and historical and future production practices. Each Management blank node must be unique, and the fields which determine uniqueness are defined in the <code>[management](/schema/Site#management)</code> field of the Site.\n",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "type": {
      "type": "string",
      "description": "Type of the Node",
      "default": "Management",
      "enum": [
        "Management"
      ]
    },
    "@type": {
      "type": "string",
      "description": "Type of the Node",
      "default": "Management",
      "enum": [
        "Management"
      ],
      "extend": true
    },
    "term": {
      "$ref": "./Term-deep.json#",
      "description": "A reference to the Term describing the Site Management.",
      "examples": [
        {
          "@id": "fullTillage",
          "@type": "Term",
          "name": "Full tillage",
          "units": "% area",
          "termType": "tillage"
        },
        {
          "@id": "animalManureUsed",
          "@type": "Term",
          "name": "Animal manure used",
          "units": "boolean",
          "termType": "landUseManagement"
        },
        {
          "@id": "forest",
          "@type": "Term",
          "name": "Forest",
          "termType": "landCover"
        }
      ],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "description": {
      "type": "string",
      "description": "A description of the Management.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "value": {
      "type": [
        "number",
        "boolean"
      ],
      "description": "The value associated with the Management Term.",
      "examples": [
        42,
        true,
        5.9
      ],
      "exportDefaultCSV": true,
      "recommended": true
    },
    "distribution": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "description": "An array of up to 1000 random samples from the posterior distribution of value</code. This should describe the entire distribution of the dataset and not the distribution of the mean.",
      "examples": [],
      "exportDefaultCSV": true,
      "maxItems": 1000
    },
    "sd": {
      "type": "number",
      "minimum": 0,
      "description": "The standard deviation of value.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "min": {
      "type": "number",
      "description": "The minimum of value.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "max": {
      "type": "number",
      "description": "The maximum of value.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "percentile10th": {
      "type": "number",
      "description": "The 10th percentile of value.",
      "examples": [],
      "exportDefaultCSV": false,
      "internal": true
    },
    "percentile90th": {
      "type": "number",
      "description": "The 90th percentile of value.",
      "examples": [],
      "exportDefaultCSV": false,
      "internal": true
    },
    "statsDefinition": {
      "type": "string",
      "description": "What the descriptive statistics (sd, min, max, and value) are calculated across, or whether they are simulated or the output of a model. spatial refers to descriptive statistics calculated across spatial units (e.g., pixels) within a region or country. time refers to descriptive statistics calculated across units of time (e.g., hours).",
      "examples": [],
      "enum": [
        "sites",
        "cycles",
        "impactAssessments",
        "replications",
        "animals",
        "other observations",
        "time",
        "spatial",
        "regions",
        "simulated",
        "modelled"
      ],
      "exportDefaultCSV": true
    },
    "observations": {
      "type": "integer",
      "description": "The number of observations the descriptive statistics are calculated over.",
      "examples": [],
      "minimum": 1,
      "searchable": true,
      "exportDefaultCSV": true
    },
    "startDate": {
      "type": "string",
      "pattern": "^[0-9]{4}(-[0-9]{2})?(-[0-9]{2})?$",
      "description": "The start date of this Site Management in ISO 8601 format (YYYY-MM-DD, YYYY-MM, or YYYY).",
      "examples": [
        "1990",
        "2015",
        "1990-01-01"
      ],
      "datePattern": true,
      "exportDefaultCSV": true
    },
    "endDate": {
      "type": "string",
      "pattern": "^[0-9]{4}(-[0-9]{2})?(-[0-9]{2})?$",
      "description": "The end date of this Site Management in ISO 8601 format (YYYY-MM-DD, YYYY-MM, or YYYY).",
      "examples": [
        "2005",
        "2022",
        "1990-12-31"
      ],
      "datePattern": true,
      "exportDefaultCSV": true
    },
    "methodClassification": {
      "type": "string",
      "description": "A classification of the method used to acquire or estimate the term and percentArea. Overrides the defaultMethodClassification specified in the Site.    physical measurement means the amount is quantified using weighing,\n    volume measurement, metering, chemical methods, or other physical approaches.\n\n    verified survey data means the data are initially collected through\n    surveys; all or a subset of the data are verified using physical methods; and\n    erroneous survey data are discarded or corrected.\n\n    non-verified survey data means the data are collected through\n    surveys that have not been subjected to verification.\n\n    modelled means a previously calibrated model is used to estimate\n    this data point from other data points describing this Cycle.\n\n    estimated with assumptions means a documented assumption is used\n    to estimate this data point from other data points describing this Cycle.\n\n    consistent external sources means the data are taken from external\n    datasets referring to different producers/enterprises:\n\n        Using the same technology (defined as the same\n        System or the same key Practices\n        as those specified in the Cycle);\n\n        At the same date (defined as occurring within the\n        startDate and endDate of the Cycle);\n        and\n\n        In the same region or country.\n\n    Modelling or assumptions may have also been used to transform these data.\n\n    inconsistent external sources means the data are taken from external\n    datasets referring to different producers/enterprises:\n\n        Using a different technology (defined as a different\n        System or using different key\n        Practices to those specified in the Cycle);\n\n        At a different date (defined as occurring within the\n        startDate and endDate of the Cycle);\n        or\n\n        In a different region or country.\n\n    Modelling or assumptions may have also been used to transform these data.\n\n    expert opinion means the data have been estimated by experts in\n    the field.\n\n    unsourced assumption means the data do not have a clear source\n    and/or are based on assumptions only.\n",
      "examples": [],
      "enum": [
        "physical measurement",
        "verified survey data",
        "non-verified survey data",
        "modelled",
        "estimated with assumptions",
        "consistent external sources",
        "inconsistent external sources",
        "expert opinion",
        "unsourced assumption"
      ],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "methodClassificationDescription": {
      "type": "string",
      "description": "A justification of the methodClassification used. If the data were estimated with assumptions this field should also describe the assumptions. This is a required field if methodClassification is specified.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "model": {
      "$ref": "./Term-deep.json#",
      "description": "A reference to the Term describing the model used to estimate these data.",
      "examples": [],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "modelDescription": {
      "type": "string",
      "description": "A free text field, describing the model used to estimate these data.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "source": {
      "$ref": "./Source-deep.json#",
      "description": "A reference to the Source of these data, if different from the defaultSource of the Cycle or Site.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "otherSources": {
      "type": "array",
      "items": {
        "$ref": "./Source-deep.json#"
      },
      "description": "A list of references to any other sources of these data.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "properties": {
      "type": "array",
      "items": {
        "$ref": "./Property.json#"
      },
      "description": "A list of Properties which can be assigned to the Management Term.",
      "examples": [],
      "exportDefaultCSV": true,
      "uniqueArrayItem": [
        "term.@id",
        "key.@id",
        "date",
        "startDate",
        "endDate"
      ]
    },
    "schemaVersion": {
      "type": "string",
      "description": "The version of the schema when these data were created.",
      "examples": [],
      "internal": 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": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of fields that have been 'aggregated' using data from multiple Sites.",
      "examples": [],
      "internal": true
    },
    "aggregatedVersion": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of versions of the aggregation engine corresponding to each aggregated field.",
      "examples": [],
      "internal": true
    }
  },
  "allOf": [
    {
      "if": {
        "required": [
          "term"
        ]
      },
      "then": {
        "properties": {
          "term": {
            "properties": {
              "termType": {
                "enum": [
                  "cropResidueManagement",
                  "landCover",
                  "landUseManagement",
                  "pastureManagement",
                  "standardsLabels",
                  "system",
                  "tillage",
                  "waterRegime"
                ]
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "term"
        ],
        "properties": {
          "term": {
            "required": [
              "termType"
            ],
            "properties": {
              "termType": {
                "enum": [
                  "landCover"
                ]
              }
            }
          }
        }
      },
      "then": {
        "required": [
          "startDate"
        ]
      }
    },
    {
      "if": {
        "required": [
          "methodClassification"
        ]
      },
      "then": {
        "required": [
          "methodClassificationDescription"
        ]
      }
    }
  ],
  "oneOf": [
    {
      "required": [
        "@type"
      ]
    },
    {
      "required": [
        "type"
      ]
    }
  ],
  "required": [
    "term",
    "endDate"
  ]
}