{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.rtemis.org/datafingerprint/v1/schema.json",
  "title": "rtemis DataFingerprint",
  "description": "Identity of one dataset: a content hash plus the structural facts that make a mismatch diagnosable rather than merely detectable.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://schema.rtemis.org/datafingerprint/v1/schema.json",
      "description": "JSON Schema URI for this config instance."
    },
    "method": {
      "type": "string",
      "enum": ["file", "object", "table"],
      "description": "What was hashed: the source file's bytes, the serialized R object, or the canonical Arrow table.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "algorithm": {
      "type": "string",
      "enum": ["sha256", "sha512", "sha384", "sha224", "sha3-256", "sha3-512", "blake2b", "blake2s", "sha1", "md5"],
      "description": "Hash algorithm, recorded so a hash is verifiable rather than merely comparable.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "encoding": {
      "type": "string",
      "description": "The exact byte recipe hashed. Two digests are comparable only if they share one.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "hash": {
      "type": "string",
      "description": "Hash digest, as hex.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "n_rows": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of rows (cases).",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "n_cols": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of columns.",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "column_names": {
      "type": ["array", "null"],
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "description": "Column names, in order.",
      "x-rtemis": {
        "type": "string",
        "container": "array"
      }
    },
    "source": {
      "type": ["string", "null"],
      "description": "Path the data was read from. NULL for in-memory input.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "language": {
      "type": "string",
      "description": "The language that computed the hash.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "data_structure": {
      "type": "string",
      "description": "The form the data was held in when hashed.",
      "x-rtemis": {
        "type": "string"
      }
    }
  }
}
