{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://consentocracy.com/schemas/consentocracy-grounding.schema.json",
  "title": "Consentocracy Quantum Invariants Grounding Map Schema",
  "type": "object",
  "required": [
    "id",
    "version",
    "source_manifest",
    "source_spine",
    "source_versions",
    "relationship",
    "mapping"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "source_manifest": {
      "type": "string",
      "format": "uri"
    },
    "source_manifest_version": {
      "type": "string"
    },
    "source_spine": {
      "type": "string",
      "format": "uri"
    },
    "source_versions": {
      "type": "object"
    },
    "relationship": {
      "type": "string"
    },
    "mapping": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "consentocracy_id",
          "label",
          "qi_ids",
          "rationale"
        ],
        "properties": {
          "consentocracy_id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "qi_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[PC][0-9]+$"
            }
          },
          "rationale": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
