{
  "$defs": {
    "ArtifactRef": {
      "additionalProperties": false,
      "description": "A file the model needs (an FMU, a NetLogo model), stored by its digest.",
      "properties": {
        "digest": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "title": "Digest",
          "type": "string"
        },
        "filename": {
          "description": "Name to give the file when an engine needs it",
          "minLength": 1,
          "title": "Filename",
          "type": "string"
        }
      },
      "required": [
        "digest",
        "filename"
      ],
      "title": "ArtifactRef",
      "type": "object"
    },
    "MeasuredColumn": {
      "additionalProperties": false,
      "properties": {
        "description": {
          "default": "",
          "title": "Description",
          "type": "string"
        },
        "name": {
          "description": "A column of the file, named as the model's output it measures",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "uncertainty": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Standard uncertainty of one reading, in the column's unit",
          "title": "Uncertainty"
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Unit"
        }
      },
      "required": [
        "name"
      ],
      "title": "MeasuredColumn",
      "type": "object"
    },
    "MeasurementSource": {
      "additionalProperties": false,
      "description": "Where the numbers come from. `synthetic` numbers were made, not measured,\nand say how.",
      "properties": {
        "description": {
          "default": "",
          "title": "Description",
          "type": "string"
        },
        "instrument": {
          "default": "",
          "title": "Instrument",
          "type": "string"
        },
        "kind": {
          "enum": [
            "sensor",
            "manual",
            "synthetic"
          ],
          "title": "Kind",
          "type": "string"
        },
        "location": {
          "default": "",
          "title": "Location",
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "title": "MeasurementSource",
      "type": "object"
    }
  },
  "$id": "mokili.measurement/1",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Observations of a real system, from a CSV file stored by digest. A\nmeasurement is never a result: nothing in it was simulated or inferred.",
  "properties": {
    "artifact": {
      "$ref": "#/$defs/ArtifactRef",
      "description": "The CSV file: a header row, then one row per reading"
    },
    "assumptions": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Assumptions",
      "type": "array"
    },
    "collected_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Collected At"
    },
    "columns": {
      "items": {
        "$ref": "#/$defs/MeasuredColumn"
      },
      "minItems": 1,
      "title": "Columns",
      "type": "array"
    },
    "description": {
      "default": "",
      "title": "Description",
      "type": "string"
    },
    "name": {
      "minLength": 1,
      "title": "Name",
      "type": "string"
    },
    "schema": {
      "const": "mokili.measurement/1",
      "title": "Schema",
      "type": "string"
    },
    "source": {
      "$ref": "#/$defs/MeasurementSource"
    },
    "time_column": {
      "default": "t",
      "minLength": 1,
      "title": "Time Column",
      "type": "string"
    },
    "time_unit": {
      "default": "s",
      "minLength": 1,
      "title": "Time Unit",
      "type": "string"
    }
  },
  "required": [
    "schema",
    "name",
    "source",
    "artifact",
    "columns"
  ],
  "title": "Measurement",
  "type": "object"
}
