{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "ICU Concept Map 1.0",
  "type": "object",
  "required": [
    "schema_version",
    "revision",
    "basis_statement",
    "groups",
    "nodes",
    "relationships",
    "editorial_policy"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0.0"
    },
    "revision": {
      "type": "string"
    },
    "basis_statement": {
      "type": "string",
      "minLength": 20
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "type",
          "label",
          "count",
          "basis",
          "label_status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 3
          },
          "type": {
            "enum": [
              "theme",
              "format",
              "source"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "count": {
            "type": "integer",
            "minimum": 1
          },
          "basis": {
            "type": "string",
            "minLength": 10
          },
          "label_status": {
            "enum": [
              "explicit",
              "explicit_broad"
            ]
          },
          "uncertainty_note": {
            "type": "string"
          }
        }
      }
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "title",
          "path",
          "group_ids",
          "theme_group_ids",
          "format_group_ids",
          "source_group_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 3
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "path": {
            "type": "string",
            "pattern": "^/concepts/"
          },
          "group_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "theme_group_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "format_group_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_group_id": {
            "type": "string"
          }
        }
      }
    },
    "relationships": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "from",
          "to",
          "type",
          "label",
          "status",
          "basis"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 3
          },
          "from": {
            "type": "string",
            "minLength": 1
          },
          "to": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "enum": [
              "member_of_theme",
              "member_of_format",
              "member_of_source_collection",
              "variant_of",
              "contrasts_with"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "const": "canonical"
          },
          "basis": {
            "type": "string",
            "minLength": 10
          }
        }
      }
    },
    "editorial_policy": {
      "type": "object"
    }
  }
}
