{
  "$id": "https://www.hestia.earth/schema-data/json-schema/Property.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$comment": "Schema version 39.0.1",
  "title": "Property",
  "description": "Properties allow further information to be added to [Animals](/schema/Animal), [Products](/schema/Product), [Inputs](/schema/Input), [Emissions](/schema/Emission), and [Practices](/schema/Practices). Default Properties are also associated with [Terms](/schema/Term) (such as the average [nitrogen content](/term/nitrogenContent) of manure).\n",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "type": {
      "type": "string",
      "description": "Type of the Node",
      "default": "Property",
      "enum": [
        "Property"
      ]
    },
    "@type": {
      "type": "string",
      "description": "Type of the Node",
      "default": "Property",
      "enum": [
        "Property"
      ],
      "extend": true
    },
    "term": {
      "$ref": "./Term-deep.json#",
      "description": "A reference to the Term describing the Property.",
      "examples": [
        {
          "@id": "dryMatter",
          "@type": "Term",
          "name": "Dry matter",
          "termType": "property"
        },
        {
          "@id": "activeIngredient",
          "@type": "Term",
          "name": "Active Ingredient",
          "units": "%",
          "termType": "property"
        }
      ],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "description": {
      "type": "string",
      "description": "A description of the Property.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "key": {
      "$ref": "./Term-deep.json#",
      "description": "If the data associated with the Property are in key:value form, the key. E.g., in a list of pesticide active ingredients in a pesticide brand, the id of the key might be 'CAS-1071-83-6' and the value might be 25 percent.",
      "examples": [
        {
          "@id": "CAS-111-30-8",
          "@type": "Term",
          "name": "Pentanedial",
          "termType": "pesticideAI"
        }
      ],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "value": {
      "type": [
        "number",
        "boolean"
      ],
      "description": "The value of the Property.",
      "examples": [
        87,
        25
      ],
      "searchable": true,
      "exportDefaultCSV": true,
      "recommended": true
    },
    "share": {
      "type": "number",
      "minimum": 0,
      "maximum": 100,
      "description": "The percentage of the Product or Input value the Property refers to (e.g., if 70% of the steers sold are 450 days old and the remaining 30% are 900 days old, the term Beef cattle, steer should be recorded once, with two Age properties associated with it: the first one with value 450 and share 70, the second one with value 900 and share 30).",
      "default": 100,
      "examples": [],
      "exportDefaultCSV": true,
      "recommended": true
    },
    "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
    },
    "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",
        "replications",
        "other observations",
        "time",
        "spatial",
        "regions",
        "simulated",
        "modelled"
      ],
      "exportDefaultCSV": true
    },
    "observations": {
      "type": "number",
      "minimum": 1,
      "description": "The number of observations the descriptive statistics are calculated over.",
      "examples": [],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "date": {
      "type": "string",
      "description": "The date in which the Property was measured in ISO 8601 format (YYYY-MM-DD, YYYY-MM, YYYY, --MM-DD, --MM, or YYYY-MM-DDTHH:mm:ssZ).",
      "examples": [],
      "dateTimePattern": true,
      "exportDefaultCSV": true
    },
    "startDate": {
      "type": "string",
      "pattern": "^[0-9]{4}(-[0-9]{2})?(-[0-9]{2})?$",
      "description": "For Properties over periods different to Cycle, the start date of the Property (if different from the start date of the Cycle]) in [ISO 8601 format (YYYY-MM-DD).",
      "examples": [],
      "datePattern": true,
      "exportDefaultCSV": true
    },
    "endDate": {
      "type": "string",
      "pattern": "^[0-9]{4}(-[0-9]{2})?(-[0-9]{2})?$",
      "description": "For Properties over periods different to Cycle, the end date of the Property (if different from the end date of the Cycle]) in [ISO 8601 format (YYYY-MM-DD).",
      "examples": [],
      "datePattern": true
    },
    "methodModel": {
      "$ref": "./Term-deep.json#",
      "description": "A reference to the Term describing the method or model for acquiring or estimating these data.",
      "examples": [],
      "searchable": true,
      "exportDefaultCSV": true
    },
    "methodModelDescription": {
      "type": "string",
      "description": "A free text field, describing the method or model used for acquiring or estimating these data.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "methodClassification": {
      "type": "string",
      "description": "A classification of the method used to acquire or estimate the term and value. Overrides the defaultMethodClassification specified in the Cycle.    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. Not required but recommended if methodClassification is specified.",
      "examples": [],
      "exportDefaultCSV": true
    },
    "source": {
      "type": "string",
      "description": "Information about the source of these data.",
      "examples": [],
      "extend": true,
      "searchable": true,
      "exportDefaultCSV": true
    },
    "dataState": {
      "type": "string",
      "description": "An indicator of the data quality or whether the data are missing.",
      "examples": [],
      "enum": [
        "complete",
        "not required",
        "requires validation",
        "missing",
        "unassigned"
      ]
    },
    "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 and Cycles.",
      "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": [
                  "property"
                ]
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "methodModel"
        ]
      },
      "then": {
        "properties": {
          "methodModel": {
            "properties": {
              "termType": {
                "enum": [
                  "model",
                  "methodMeasurement"
                ]
              }
            }
          }
        }
      }
    },
    {
      "anyOf": [
        {
          "required": [
            "value"
          ]
        },
        {
          "required": [
            "min"
          ]
        },
        {
          "required": [
            "max"
          ]
        }
      ]
    }
  ],
  "oneOf": [
    {
      "required": [
        "@type"
      ]
    },
    {
      "required": [
        "type"
      ]
    }
  ],
  "required": [
    "term"
  ]
}