{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://e2er.com/catalog/schema/vocabulary.schema.json",
  "title": "E2ER controlled vocabulary",
  "description": "One facet's allowed terms. Terms marked origin=rise are taken from RISE VOCABULARY.md; origin=e2er-proposed are proposed in the E2ER description format, draft 0.1, and need acceptance through a proposal to change the standard.",
  "type": "object",
  "required": [
    "facet",
    "label",
    "cardinality",
    "terms"
  ],
  "additionalProperties": false,
  "properties": {
    "facet": {
      "type": "string",
      "pattern": "^[a-z]+$"
    },
    "label": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "cardinality": {
      "enum": [
        "one",
        "many"
      ]
    },
    "origin": {
      "enum": [
        "rise",
        "e2er-proposed",
        "e2er"
      ]
    },
    "source": {
      "type": "string"
    },
    "terms": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "label"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]*$"
          },
          "label": {
            "type": "string"
          },
          "definition": {
            "type": "string"
          },
          "origin": {
            "enum": [
              "rise",
              "e2er-proposed",
              "e2er"
            ]
          },
          "broader": {
            "type": "string"
          }
        }
      }
    },
    "aliases": {
      "description": "Terms found in source catalogues that map onto a vocabulary term. Applying an alias gives provenance 'mapped'.",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  }
}