{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opendapi.org/spec/0-0-1/categories.json",
  "$defs": {
    "category": {
      "type": "object",
      "description": "Information pertaining to a single data category.",
      "properties": {
        "urn": {
          "type": "string",
          "pattern": "^[\\w.-]+$",
          "order": 1,
          "description": "The org-wide unique identifier for the data category, defined using a period-delimited taxonomical structure (meaning that if we have an urn A.B.C, its parent is A.B, and its parent must exist).",
          "examples": [
            "contact.email.address",
            "identification.ssn",
            "system.uuid"
          ]
        },
        "label": {
          "type": "string",
          "order": 2,
          "description": "A UI-friendly label for the data category.",
          "examples": [
            "Email Address",
            "Social Security Number",
            "UUID"
          ]
        },
        "description": {
          "type": "string",
          "order": 3,
          "description": "A human-readable description of the data category.",
          "examples": [
            "An email address that can be used to contact a subject.",
            "A social security number that can be used to identify a subject.",
            "An unique identifier that can be used to identify a subject."
          ]
        },
        "includes": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "Business-specific example of an entity that falls under this category.",
            "examples": ["identifier.ssn", "identifier.email", "identifier.phone"]
          },
          "description": "Ordered list of examples of entities that fall under this category.",
          "order": 4
        },
        "excludes": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "Business-specific example of an entity that does not fall under this category.",
            "examples": ["identifier.ssn", "identifier.email", "identifier.phone"]
          },
          "description": "Ordered list of examples of entities that do not fall under this category.",
          "order": 5
        }
      },
      "required": ["urn", "label", "description"]
    }
  },
  "type": "object",
  "properties": {
    "schema": {
      "type": "string",
      "format": "uri",
      "order": 1,
      "default": "https://opendapi.org/spec/0-0-1/categories.json",
      "description": "The URI schema version for this data",
      "examples": ["https://opendapi.org/spec/0-0-1/categories.json"]
    },
    "categories": {
      "type": "array",
      "order": 2,
      "items": { "$ref": "#/$defs/category" },
      "description": "List data categories that are relevant to the organization."
    }
  },
  "required": ["schema", "categories"],
  "description": "Definitions of the data categories that are used in the organization.",
  "title": "Data Category Definitions"
}
