{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ruml.org/1.0.0/schemas/ruml-ext.schema.json",
  "title": "RUML-EXT — RUML Capability Extension Sidecar",
  "description": "JSON-based sidecar format carrying capability extension data for a RUML file without modifying it. Bound to the exact base file version via `$base` (id + hash).",
  "x-ruml-format": "RUML-EXT",
  "x-ruml-spec-version": "1.0",
  "type": "object",
  "properties": {
    "$format": {
      "type": "string",
      "const": "RUML-EXT",
      "description": "Format discriminator identifying this as a RUML-EXT sidecar"
    },
    "$specVersion": {
      "type": "string",
      "description": "RUML spec version this sidecar conforms to",
      "enum": ["1.0"]
    },
    "$base": {
      "description": "Reference to the base RUML file (id + hash)",
      "$ref": "#/$defs/BaseReference"
    },
    "capabilities": {
      "description": "The capabilities whose data this EXT file carries, in order; root-level artifact data travels in each entry's `payload` (§4.2), never as separate root fields (CAP-23)",
      "$ref": "#/$defs/Capabilities"
    },
    "nodes": {
      "description": "Extension data for base nodes, indexed by node UUID",
      "$ref": "#/$defs/ExtensionNodes"
    }
  },
  "required": ["$format", "$specVersion", "$base", "capabilities", "nodes"],
  "additionalProperties": false,
  "allOf": [
    {
      "title": "CAP-23 — prohibited root fields",
      "description": "`metadata` and `rulemap` belong exclusively to the base RUML file and MUST NOT appear in an EXT root. Listed explicitly (although the root is closed) so the violation is reported by name.",
      "properties": {
        "metadata": false,
        "rulemap": false
      }
    },
    {
      "title": "§4.5 — node keys are declared capabilities",
      "description": "Node extension keys MUST be capability ids from this file's root `capabilities`. Only the degenerate case is expressible here: with no declared capabilities, no node may carry any extension data. The general membership check is a parser obligation.",
      "if": {
        "properties": {
          "capabilities": {
            "maxItems": 0
          }
        }
      },
      "then": {
        "properties": {
          "nodes": {
            "additionalProperties": {
              "maxProperties": 0
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "Uuid": {
      "type": "string",
      "format": "uuid",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
    },
    "BaseReference": {
      "type": "object",
      "description": "Reference to the base RUML file this sidecar extends (§4.5). `id` is the base file's `metadata.id`; `hash` pins the exact version of the base file the extension data was written against. A parser MUST match both against the base file before merging (CAP-24).",
      "properties": {
        "id": {
          "description": "The `metadata.id` of the base RUML file",
          "$ref": "#/$defs/Uuid"
        },
        "hash": {
          "description": "Integrity hash of the base RUML file at the time this EXT file was created (`<algorithm>:<hex>`)",
          "type": "string",
          "pattern": "^(?:sha3-256|sha256|blake3):[0-9a-f]{64}$"
        }
      },
      "required": ["id", "hash"],
      "additionalProperties": false
    },
    "ExtensionNodes": {
      "type": "object",
      "description": "Extension data indexed by the UUID (`id` field) of the base node — not by lexId, because lexIds are not position-unique for modular nodes (§4.5). Every UUID MUST resolve to a node of the base RUML file (CAP-26); that lookup is a parser obligation.",
      "propertyNames": {
        "$ref": "#/$defs/Uuid"
      },
      "additionalProperties": {
        "$ref": "#/$defs/NodeExtension"
      }
    },
    "NodeExtension": {
      "type": "object",
      "description": "Node-level capability payloads for one base node, keyed by capability id (§4.5). Every key MUST be a capability declared in the root `capabilities` array of this EXT file, and the same capability MUST NOT also be carried inline by the base node (CAP-27); both are parser obligations. Official ids route to the same node-level payload shapes as inline node capabilities (§4.3).",
      "propertyNames": {
        "$ref": "#/$defs/CapabilityId"
      },
      "properties": {
        "ruml:query": {
          "$ref": "#/$defs/CapabilityQuery"
        },
        "ruml:actions": {
          "$ref": "#/$defs/Actions"
        },
        "ruml:context": {
          "$ref": "#/$defs/ContextRefs"
        },
        "ruml:ai-query": {
          "$ref": "#/$defs/CapabilityAiQueryNode"
        },
        "ruml:text-reference": {
          "$ref": "#/$defs/TextRefs"
        },
        "ruml:tree-reference": {
          "$ref": "#/$defs/TreeRefs"
        },
        "ruml:tree-include": {
          "$ref": "#/$defs/TreeInclude"
        },
        "ruml:protocol": {
          "description": "ruml:protocol has no node-level data (§4.13) and MUST NOT appear on a node",
          "not": {}
        }
      },
      "additionalProperties": {
        "type": "object",
        "description": "Payload of a `ruml:draft/…`, third-party, or unrouted official capability; everything here belongs to the capability"
      }
    },
    "Timestamp": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "DatapointDateTime": {
      "type": "string",
      "description": "Date and time of day for a datapoint: YYYY-MM-DDTHH:MM, optionally with seconds, a fraction of a second and an offset (§4.7.1, §4.7.3)",
      "pattern": "^[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])[Tt](?:[01][0-9]|2[0-3]):[0-5][0-9](?::(?:[0-5][0-9]|60)(?:\\.[0-9]+)?)?(?:[Zz]|[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)?$"
    },
    "DatapointTime": {
      "type": "string",
      "description": "Time of day without a date: HH:MM, optionally with seconds, a fraction of a second and an offset (§4.7.1, §4.7.3)",
      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9](?::(?:[0-5][0-9]|60)(?:\\.[0-9]+)?)?(?:[Zz]|[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)?$"
    },
    "Capabilities": {
      "type": "array",
      "description": "Declared capabilities, in order (§4.2); the order is significant",
      "items": {
        "$ref": "#/$defs/CapabilityEntry"
      },
      "allOf": [
        {
          "$ref": "#/$defs/UniqueOfficialCapabilityIds"
        }
      ]
    },
    "CapabilityId": {
      "anyOf": [
        {
          "$ref": "#/$defs/OfficialCapabilityId"
        },
        {
          "$ref": "#/$defs/DraftCapabilityId"
        },
        {
          "$ref": "#/$defs/ReverseDomainCapabilityId"
        }
      ]
    },
    "OfficialCapabilityId": {
      "type": "string",
      "enum": [
        "ruml:datapoints",
        "ruml:text-reference",
        "ruml:tree-reference",
        "ruml:tree-include",
        "ruml:context",
        "ruml:query",
        "ruml:ai-query",
        "ruml:actions",
        "ruml:protocol"
      ],
      "description": "Official RUML capability id in the reserved `ruml:` namespace."
    },
    "DraftCapabilityId": {
      "type": "string",
      "maxLength": 128,
      "pattern": "^ruml:draft(?:\\/[a-z0-9_-]+)+$",
      "description": "Local draft capability id (e.g. `ruml:draft/my-capability`). Used for in-progress capabilities."
    },
    "ReverseDomainCapabilityId": {
      "type": "string",
      "maxLength": 128,
      "pattern": "^[a-z0-9_-]+(?:\\.[a-z0-9_-]+)+(?:\\/[a-z0-9_-]+)+$",
      "description": "Third-party capability id in reverse-domain form (e.g. `com.example/my-capability`)."
    },
    "DatapointId": {
      "type": "string",
      "pattern": "^[a-z_][a-z0-9_]*$"
    },
    "Datapoint": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Human-readable name of the datapoint"
        },
        "type": {
          "type": "string",
          "enum": [
            "string",
            "number",
            "boolean",
            "date",
            "datetime",
            "time",
            "integer",
            "currency",
            "percentage",
            "duration",
            "email",
            "phone",
            "location",
            "identifier",
            "iban",
            "count",
            "url",
            "address",
            "enum",
            "object"
          ],
          "description": "Data type of the datapoint"
        },
        "description": {
          "description": "Description of what the datapoint represents",
          "type": "string"
        },
        "unit": {
          "description": "Unit of the value; required for type 'currency', otherwise only applicable to types 'number' and 'percentage'",
          "type": "string"
        },
        "sensitive": {
          "default": false,
          "description": "Whether the datapoint holds sensitive/personal data",
          "type": "boolean"
        },
        "format": {
          "description": "Format refining the type (e.g. taxId for identifier)",
          "type": "string"
        },
        "options": {
          "description": "Allowed options; required and non-empty for type 'enum'",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string",
                "description": "Value of the option"
              },
              "label": {
                "description": "Human-readable label for the option",
                "type": "string"
              }
            },
            "required": ["value"],
            "additionalProperties": false
          }
        },
        "binding": {
          "description": "How the datapoint value is sourced (input, external or computed). `type` selects the kind; each kind's own properties are listed under `allOf`, as capability entries do (§4.2).",
          "type": "object",
          "properties": {
            "type": {
              "description": "Binding kind: `input` is supplied by the user, `external` is fetched from a source, `computed` is derived from other datapoints",
              "type": "string",
              "enum": ["input", "external", "computed"]
            },
            "hint": {
              "description": "Hint shown to the user when entering the value",
              "type": "string"
            },
            "placeholder": {
              "description": "Placeholder text for the input field",
              "type": "string"
            },
            "defaultValue": {
              "description": "Default value pre-filled for the input"
            },
            "ref": {
              "type": "string",
              "description": "Symbolic reference to the external source"
            },
            "sourceType": {
              "description": "Kind of external source the value is fetched from",
              "type": "string",
              "enum": ["api", "database", "file", "rulemap"]
            },
            "fallback": {
              "description": "Input binding used when the external source cannot be reached",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "input",
                  "description": "Binding kind: the value is supplied by user input"
                },
                "hint": {
                  "description": "Hint shown to the user when entering the value",
                  "type": "string"
                },
                "placeholder": {
                  "description": "Placeholder text for the input field",
                  "type": "string"
                },
                "defaultValue": {
                  "description": "Default value pre-filled for the input"
                }
              },
              "required": ["type"],
              "additionalProperties": false
            },
            "expression": {
              "type": "string",
              "description": "JSONata expression; other datapoints are referenced by their id"
            },
            "description": {
              "description": "Description of the external source or of the calculation",
              "type": "string"
            }
          },
          "required": ["type"],
          "additionalProperties": false
        },
        "validation": {
          "description": "Validation rules applied to the datapoint value",
          "type": "object",
          "properties": {
            "required": {
              "description": "Whether a value must be provided",
              "type": "boolean"
            },
            "min": {
              "description": "Minimum value (number, or ISO-8601 string for temporal types)",
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            },
            "max": {
              "description": "Maximum value (number, or ISO-8601 string for temporal types)",
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            },
            "minLength": {
              "description": "Minimum length of the value",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "maxLength": {
              "description": "Maximum length of the value",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "pattern": {
              "description": "Regular expression the value must match",
              "type": "string",
              "format": "regex"
            },
            "enum": {
              "description": "Explicit set of allowed values",
              "type": "array",
              "items": {}
            },
            "message": {
              "description": "Custom validation error message",
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "set": {
          "$ref": "#/$defs/SetId",
          "description": "The set this datapoint instantiates; required when type is object, not applicable to other types"
        },
        "cardinality": {
          "type": "object",
          "description": "Repetition of the object; absent means a single object. Only applicable to type 'object'",
          "properties": {
            "min": {
              "type": "integer",
              "minimum": 0
            },
            "max": {
              "type": "integer",
              "minimum": 1
            }
          },
          "additionalProperties": false
        }
      },
      "required": ["name", "type", "binding"],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "required": ["binding"],
            "properties": {
              "binding": {
                "required": ["type"],
                "properties": {
                  "type": {
                    "const": "input"
                  }
                }
              }
            }
          },
          "then": {
            "properties": {
              "binding": {
                "propertyNames": {
                  "enum": ["type", "hint", "placeholder", "defaultValue"]
                }
              }
            }
          }
        },
        {
          "if": {
            "required": ["binding"],
            "properties": {
              "binding": {
                "required": ["type"],
                "properties": {
                  "type": {
                    "const": "external"
                  }
                }
              }
            }
          },
          "then": {
            "properties": {
              "binding": {
                "required": ["ref"],
                "propertyNames": {
                  "enum": ["type", "ref", "sourceType", "fallback", "description"]
                }
              }
            }
          }
        },
        {
          "if": {
            "required": ["binding"],
            "properties": {
              "binding": {
                "required": ["type"],
                "properties": {
                  "type": {
                    "const": "computed"
                  }
                }
              }
            }
          },
          "then": {
            "properties": {
              "binding": {
                "required": ["expression"],
                "propertyNames": {
                  "enum": ["type", "expression", "description"]
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "string"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "minLength": true,
                  "maxLength": true,
                  "pattern": true,
                  "enum": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "number"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "min": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  },
                  "enum": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "boolean"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "date"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "min": {
                    "type": "string",
                    "format": "date"
                  },
                  "max": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "datetime"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "min": {
                    "$ref": "#/$defs/DatapointDateTime"
                  },
                  "max": {
                    "$ref": "#/$defs/DatapointDateTime"
                  }
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "time"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "min": {
                    "$ref": "#/$defs/DatapointTime"
                  },
                  "max": {
                    "$ref": "#/$defs/DatapointTime"
                  }
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "integer"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "min": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  },
                  "enum": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "currency"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "min": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  }
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "set": false,
              "cardinality": false
            },
            "required": ["unit"]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "percentage"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "min": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  }
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "duration"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "min": {
                    "type": "string",
                    "format": "duration"
                  },
                  "max": {
                    "type": "string",
                    "format": "duration"
                  }
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "email"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "pattern": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "phone"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "pattern": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "location"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "enum": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": {
                "enum": ["country", "region", "union", "postal", "municipality", "coordinates"]
              },
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "identifier"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "minLength": true,
                  "maxLength": true,
                  "pattern": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": {
                "enum": [
                  "taxId",
                  "vatId",
                  "socialSecurity",
                  "passport",
                  "nationalId",
                  "commercial",
                  "custom"
                ]
              },
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "iban"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "pattern": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "count"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "min": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "max": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "url"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true,
                  "pattern": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "address"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true
                },
                "additionalProperties": false
              },
              "options": false,
              "unit": false,
              "set": false,
              "cardinality": false
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "enum"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true
                },
                "additionalProperties": false
              },
              "options": {
                "minItems": 1
              },
              "format": false,
              "unit": false,
              "set": false,
              "cardinality": false
            },
            "required": ["options"]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "object"
              }
            },
            "required": ["type"]
          },
          "then": {
            "properties": {
              "validation": {
                "properties": {
                  "required": true,
                  "message": true
                },
                "additionalProperties": false
              },
              "options": false,
              "format": false,
              "unit": false
            }
          }
        },
        {
          "title": "§4.7.4 — an object datapoint instantiates a set",
          "if": {
            "type": "object",
            "required": ["type"],
            "properties": {
              "type": {
                "const": "object"
              }
            }
          },
          "then": {
            "required": ["set"]
          }
        }
      ]
    },
    "TextId": {
      "type": "string",
      "pattern": "^[a-z_][a-z0-9_]*$"
    },
    "Text": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1,
          "description": "Human-readable title of the text"
        },
        "uri": {
          "type": "string",
          "minLength": 1,
          "description": "URI of the text as published by its source (see the URI convention in §4.12); omitted for texts written in the RUML file itself"
        },
        "timestamp": {
          "description": "When the author retrieved and recorded this text",
          "$ref": "#/$defs/Timestamp"
        },
        "status": {
          "type": "string",
          "enum": ["draft", "proposed", "enacted", "inForce", "amended", "repealed"],
          "description": "Legislative status of the text"
        },
        "type": {
          "default": "embedded",
          "description": "How the text content is carried; 'external' is deprecated",
          "type": "string",
          "enum": ["embedded", "container", "url", "external"]
        },
        "text": {
          "description": "Plain text; for embedded texts with status 'inForce', exactly one of text and content is required",
          "type": "string"
        },
        "content": {
          "description": "Structured text in RUML Text form (§4.12)",
          "$ref": "#/$defs/RumlTextDocument"
        },
        "digest": {
          "description": "SHA3-256 over the RFC 8785 form of content; required with content",
          "$ref": "#/$defs/Sha3Digest"
        },
        "source": {
          "description": "Provenance of content: the source document it was imported from",
          "$ref": "#/$defs/TextSource"
        },
        "url": {
          "description": "URL of the text; required for type 'url'",
          "type": "string",
          "format": "uri"
        },
        "containerPath": {
          "description": "Path to the text inside the RUML container; required for type 'container'",
          "type": "string",
          "pattern": "^\\.texts\\/"
        },
        "ref": {
          "description": "Symbolic reference; required for type 'external'",
          "type": "string"
        },
        "version": {
          "description": "Version of the text",
          "type": "string"
        },
        "validFrom": {
          "description": "Validity start date",
          "$ref": "#/$defs/Timestamp"
        },
        "validUntil": {
          "description": "Validity end date",
          "$ref": "#/$defs/Timestamp"
        },
        "language": {
          "description": "ISO 639-1 language code",
          "type": "string",
          "pattern": "^[a-z]{2}$"
        },
        "isReferenced": {
          "default": true,
          "description": "Whether the text is referenced by at least one node",
          "type": "boolean"
        }
      },
      "required": ["title", "timestamp"],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "not": {
              "required": ["content"]
            }
          },
          "then": {
            "required": ["status"]
          }
        },
        {
          "if": {
            "required": ["content"]
          },
          "then": {
            "required": ["digest"]
          }
        },
        {
          "not": {
            "required": ["text", "content"]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "embedded"
              },
              "status": {
                "const": "inForce"
              }
            },
            "required": ["status"]
          },
          "then": {
            "anyOf": [
              {
                "required": ["text"],
                "properties": {
                  "text": {
                    "minLength": 1
                  }
                }
              },
              {
                "required": ["content"]
              }
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "url"
              }
            },
            "required": ["type"]
          },
          "then": {
            "required": ["url"]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "container"
              }
            },
            "required": ["type"]
          },
          "then": {
            "required": ["containerPath"]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "external"
              }
            },
            "required": ["type"]
          },
          "then": {
            "required": ["ref"]
          }
        }
      ]
    },
    "Sha3Digest": {
      "type": "string",
      "pattern": "^sha3-256:[0-9a-f]{64}$"
    },
    "TextSource": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "minLength": 1,
          "description": "URI of the source document the content was imported from"
        },
        "digest": {
          "description": "Digest of the archived source document",
          "$ref": "#/$defs/Sha3Digest"
        },
        "terms": {
          "type": "string",
          "minLength": 1,
          "description": "URI of the source's reuse terms, where the source attaches any"
        }
      },
      "required": ["uri"],
      "additionalProperties": false
    },
    "RumlTextName": {
      "type": "string",
      "pattern": "^(?:[A-Za-z_][A-Za-z0-9._-]*:)?[A-Za-z_][A-Za-z0-9._-]*$",
      "description": "Element or attribute name as in the XML, optionally with a prefix declared by an xmlns:<prefix> attribute in scope"
    },
    "RumlTextAttrs": {
      "type": "object",
      "description": "Attributes of an element, keyed by (prefixed) name",
      "propertyNames": {
        "$ref": "#/$defs/RumlTextName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "RumlTextRootAttrs": {
      "type": "object",
      "description": "Attributes of the root element; xmlns declares the dialect's namespace as the default namespace",
      "properties": {
        "xmlns": {
          "type": "string",
          "minLength": 1,
          "description": "Namespace URI of the text's Akoma Ntoso dialect, e.g. http://Inhaltsdaten.LegalDocML.de/1.8.2/"
        }
      },
      "required": ["xmlns"],
      "propertyNames": {
        "$ref": "#/$defs/RumlTextName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "RumlTextContent": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/$defs/RumlTextNode"
        }
      ]
    },
    "RumlTextNode": {
      "type": "object",
      "description": "One element of the Akoma Ntoso tree",
      "properties": {
        "type": {
          "$ref": "#/$defs/RumlTextName"
        },
        "attrs": {
          "$ref": "#/$defs/RumlTextAttrs"
        },
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RumlTextContent"
          }
        }
      },
      "required": ["type"],
      "additionalProperties": false
    },
    "RumlTextDocument": {
      "type": "object",
      "description": "Root of a RUML Text document: the Akoma Ntoso root element, declaring the dialect's namespace as its default namespace (§4.12)",
      "properties": {
        "type": {
          "$ref": "#/$defs/RumlTextName"
        },
        "attrs": {
          "$ref": "#/$defs/RumlTextRootAttrs"
        },
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RumlTextContent"
          }
        }
      },
      "required": ["type", "attrs", "content"],
      "additionalProperties": false
    },
    "TextAnchor": {
      "type": "object",
      "description": "Points at a text of this RUML's own ruml:text-reference data, or at one element of it (§4.12)",
      "properties": {
        "id": {
          "description": "Key of the text entry in this RUML's own data",
          "$ref": "#/$defs/TextId"
        },
        "element": {
          "description": "GUID of an element of the entry's RUML Text; omitted for the whole text",
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "type": {
          "description": "represents: the norm the node implements (at most one per node); refers-to: a text the node refers to",
          "type": "string",
          "enum": ["represents", "refers-to"]
        }
      },
      "required": ["id", "type"],
      "additionalProperties": false
    },
    "ContextId": {
      "type": "string",
      "pattern": "^[a-z_][a-z0-9_]*$"
    },
    "Context": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "Title of the context entry"
        },
        "category": {
          "type": "string",
          "enum": [
            "courtDecision",
            "commentary",
            "administrativeGuidance",
            "explanatoryMemorandum",
            "example",
            "literature",
            "faq",
            "history",
            "rulemap",
            "custom"
          ],
          "description": "Category of the context"
        },
        "type": {
          "default": "embedded",
          "description": "How the context content is carried",
          "type": "string",
          "enum": ["embedded", "container", "url", "external"]
        },
        "timestamp": {
          "description": "Modification time of the context in ISO 8601 format",
          "$ref": "#/$defs/Timestamp"
        },
        "subject": {
          "default": false,
          "description": "Whether this context is the subject of the evaluation",
          "type": "boolean"
        },
        "metadata": {
          "description": "Free-form metadata about the context",
          "type": "object",
          "properties": {},
          "additionalProperties": {}
        },
        "content": {
          "description": "Embedded context content",
          "type": "object",
          "properties": {},
          "additionalProperties": {}
        },
        "source": {
          "description": "Free-form description of the context source",
          "type": "object",
          "properties": {},
          "additionalProperties": {}
        },
        "url": {
          "description": "URL of the context; required for type 'url'",
          "type": "string",
          "format": "uri"
        },
        "containerPath": {
          "description": "Path to the context inside the RUML container; required for type 'container'",
          "type": "string",
          "pattern": "^\\.context\\/"
        },
        "ref": {
          "description": "Symbolic reference; required for type 'external'",
          "type": "string"
        },
        "hash": {
          "description": "Integrity hash, format <algorithm>:<value>",
          "type": "string",
          "pattern": "^(?:sha3-256|sha256|blake3):[0-9a-f]{64}$"
        },
        "accessDate": {
          "description": "Date the context url was last accessed",
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        }
      },
      "required": ["title", "category", "timestamp"],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "url"
              }
            },
            "required": ["type"]
          },
          "then": {
            "required": ["url"]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "container"
              }
            },
            "required": ["type"]
          },
          "then": {
            "required": ["containerPath"]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "external"
              }
            },
            "required": ["type"]
          },
          "then": {
            "required": ["ref"]
          }
        }
      ]
    },
    "CapabilityQuery": {
      "type": "object",
      "properties": {
        "expression": {
          "type": "string",
          "minLength": 1,
          "description": "JSONata expression computing the node's truth value"
        },
        "description": {
          "description": "Optional explanation of what the expression evaluates",
          "type": "string"
        }
      },
      "required": ["expression"],
      "additionalProperties": false
    },
    "Actions": {
      "type": "object",
      "properties": {
        "description": {
          "description": "Description of the actions declared for the node",
          "type": "string"
        },
        "onTrue": {
          "description": "Action to run when the node evaluates to true",
          "$ref": "#/$defs/Action"
        },
        "onFalse": {
          "description": "Action to run when the node evaluates to false",
          "$ref": "#/$defs/Action"
        },
        "onUndefined": {
          "description": "Action to run when the node evaluates to undefined",
          "$ref": "#/$defs/Action"
        }
      },
      "additionalProperties": false,
      "anyOf": [
        {
          "required": ["onTrue"]
        },
        {
          "required": ["onFalse"]
        },
        {
          "required": ["onUndefined"]
        }
      ]
    },
    "Action": {
      "type": "object",
      "properties": {
        "operation": {
          "type": "string",
          "description": "The operation to perform (open vocabulary)"
        },
        "ref": {
          "type": "string",
          "description": "Symbolic reference to the operation implementation"
        },
        "config": {
          "description": "Optional, runtime-defined configuration for the action",
          "type": "object",
          "properties": {},
          "additionalProperties": {}
        }
      },
      "required": ["operation", "ref"],
      "additionalProperties": false
    },
    "ContextRefs": {
      "type": "object",
      "properties": {
        "refs": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContextId"
          },
          "description": "Ids of root-level context entries referenced by the node",
          "uniqueItems": true
        }
      },
      "required": ["refs"],
      "additionalProperties": false
    },
    "CapabilityAiQueryNode": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "minLength": 1,
          "description": "Symbolic reference to the AI model, resolved by the tool at runtime"
        },
        "prompt": {
          "description": "Prompt evaluated for this node",
          "type": "string"
        },
        "description": {
          "description": "Description of what the query determines",
          "type": "string"
        },
        "inputs": {
          "description": "Inputs (context, datapoints, texts) supplied to the query",
          "type": "object",
          "properties": {
            "context": {
              "description": "Context entries supplied as input to the query",
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Id of the referenced context entry"
                      },
                      "role": {
                        "default": "reference",
                        "description": "Role the context plays in the query (reference or subject)",
                        "type": "string",
                        "enum": ["reference", "subject"]
                      }
                    },
                    "required": ["id"],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "dataPoints": {
              "description": "Ids of datapoints supplied as input to the query",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "texts": {
              "description": "Ids of texts supplied as input to the query",
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        },
        "config": {
          "description": "Node-level configuration for the query",
          "type": "object",
          "properties": {
            "deterministic": {
              "description": "Whether the query should be evaluated deterministically",
              "type": "boolean"
            },
            "effort": {
              "default": "medium",
              "description": "Effort the model should spend on the query (low, medium, high)",
              "type": "string",
              "enum": ["low", "medium", "high"]
            },
            "temperature": {
              "description": "Sampling temperature for the query, between 0 and 1",
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          "additionalProperties": false
        }
      },
      "required": ["model"],
      "additionalProperties": false
    },
    "TextRefs": {
      "type": "object",
      "properties": {
        "refs": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/$defs/TextAnchor"
          },
          "description": "Anchors into this RUML's own texts; at most one of type represents",
          "uniqueItems": true,
          "contains": {
            "properties": {
              "type": {
                "const": "represents"
              }
            }
          },
          "minContains": 0,
          "maxContains": 1
        }
      },
      "required": ["refs"],
      "additionalProperties": false
    },
    "NodeAnchor": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9+.-]*:[^#\\s]+#node/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
      "description": "Absolute anchor to a node of one version of another RUML file (§4.15): `<ruml-version-uri>#node/<id>`. Same-document anchors (`#node/…`) are not node anchors."
    },
    "NodeRef": {
      "type": "object",
      "description": "A reference to a node of another RUML file (§4.15).",
      "properties": {
        "uri": {
          "$ref": "#/$defs/NodeAnchor"
        }
      },
      "required": ["uri"],
      "additionalProperties": false
    },
    "TreeRefs": {
      "type": "object",
      "description": "Node payload of ruml:tree-reference (§4.15): references to nodes of other RUML files.",
      "properties": {
        "represents": {
          "$ref": "#/$defs/NodeRef",
          "description": "The node of another RUML file this node stands for."
        },
        "refersTo": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/NodeRef"
          },
          "description": "Nodes of other RUML files this node refers to."
        }
      },
      "minProperties": 1,
      "additionalProperties": false
    },
    "TreeInclude": {
      "type": "object",
      "description": "Node payload of ruml:tree-include (§4.16): the node of another RUML file whose subtree is evaluated in place of this leaf.",
      "properties": {
        "uri": {
          "$ref": "#/$defs/NodeAnchor"
        }
      },
      "required": ["uri"],
      "additionalProperties": false
    },
    "SetId": {
      "type": "string",
      "pattern": "^[a-z_][a-z0-9_]*$"
    },
    "DatapointSet": {
      "type": "object",
      "description": "A reusable structured type: a named group of datapoints (§4.7.4)",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "Display name of the set"
        },
        "description": {
          "type": "string",
          "description": "What the set represents"
        },
        "fields": {
          "type": "object",
          "description": "Member datapoints, keyed by datapoint id; a field may itself be type: object (nesting)",
          "propertyNames": {
            "$ref": "#/$defs/DatapointId"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Datapoint"
          },
          "minProperties": 1
        }
      },
      "required": ["name", "fields"],
      "additionalProperties": false
    },
    "DatapointsPayload": {
      "type": "object",
      "properties": {
        "data": {
          "description": "Datapoint definitions, keyed by datapoint id",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/DatapointId"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Datapoint"
          }
        },
        "sets": {
          "type": "object",
          "description": "Reusable structured types, keyed by set id",
          "propertyNames": {
            "$ref": "#/$defs/SetId"
          },
          "additionalProperties": {
            "$ref": "#/$defs/DatapointSet"
          }
        }
      },
      "additionalProperties": false,
      "description": "Payload of datapoints (§4)"
    },
    "TextReferencePayload": {
      "type": "object",
      "properties": {
        "data": {
          "description": "Text definitions, keyed by text id (text_…)",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/TextId"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Text"
          }
        }
      },
      "additionalProperties": false,
      "description": "Payload of textreference (§4)"
    },
    "ContextPayload": {
      "type": "object",
      "properties": {
        "data": {
          "description": "Context entries, keyed by context id (ctx_…)",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/ContextId"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Context"
          }
        }
      },
      "additionalProperties": false,
      "description": "Payload of context (§4)"
    },
    "AiQueryPayload": {
      "type": "object",
      "properties": {
        "config": {
          "description": "Root-level configuration for the AI query capability",
          "type": "object",
          "properties": {
            "systemPrompt": {
              "description": "System prompt applied to all AI queries in the document",
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false,
      "description": "Payload of aiquery (§4)"
    },
    "ProtocolPayload": {
      "type": "object",
      "description": "Payload of protocol (§4)",
      "properties": {
        "config": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "level": {
              "type": "string",
              "enum": ["standard", "verbose"],
              "default": "standard",
              "description": "Verbosity of the recorded protocol"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "PlainPayload": {
      "type": "object",
      "properties": {
        "config": {
          "description": "Capability-specific configuration",
          "type": "object",
          "properties": {},
          "additionalProperties": {}
        }
      },
      "additionalProperties": false,
      "description": "Payload of the capability (§4)"
    },
    "CapabilityEntry": {
      "type": "object",
      "description": "A declared capability (§4.2). Order is significant.",
      "properties": {
        "id": {
          "$ref": "#/$defs/CapabilityId",
          "description": "The capability this entry configures"
        },
        "payload": {
          "type": "object",
          "description": "Capability-defined content; everything here belongs to the capability"
        },
        "required": {
          "type": "boolean",
          "default": false,
          "description": "Whether the capability must be resolved to evaluate the file"
        },
        "role": {
          "type": "string",
          "enum": ["data", "decision", "combiner", "reaction"],
          "description": "The role the rulemap expects a non-official capability to play (§4.1). Official `ruml:` ids have a fixed role and MUST NOT declare one; every other id MUST declare it. A parser that implements the capability MUST reject a role that differs from its implementation. `decision` decides a leaf, `combiner` decides a node from its children."
        }
      },
      "required": ["id"],
      "additionalProperties": false,
      "allOf": [
        {
          "title": "payload of ruml:datapoints",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:datapoints"
              }
            }
          },
          "then": {
            "properties": {
              "payload": {
                "$ref": "#/$defs/DatapointsPayload"
              }
            }
          }
        },
        {
          "title": "payload of ruml:text-reference",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:text-reference"
              }
            }
          },
          "then": {
            "properties": {
              "payload": {
                "$ref": "#/$defs/TextReferencePayload"
              }
            }
          }
        },
        {
          "title": "ruml:tree-reference has no payload here",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:tree-reference"
              }
            }
          },
          "then": {
            "not": {
              "required": ["payload"]
            }
          }
        },
        {
          "title": "ruml:tree-include has no payload here",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:tree-include"
              }
            }
          },
          "then": {
            "not": {
              "required": ["payload"]
            }
          }
        },
        {
          "title": "payload of ruml:context",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:context"
              }
            }
          },
          "then": {
            "properties": {
              "payload": {
                "$ref": "#/$defs/ContextPayload"
              }
            }
          }
        },
        {
          "title": "payload of ruml:ai-query",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:ai-query"
              }
            }
          },
          "then": {
            "properties": {
              "payload": {
                "$ref": "#/$defs/AiQueryPayload"
              }
            }
          }
        },
        {
          "title": "payload of ruml:protocol",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:protocol"
              }
            }
          },
          "then": {
            "properties": {
              "payload": {
                "$ref": "#/$defs/ProtocolPayload"
              }
            }
          }
        },
        {
          "title": "payload of ruml:query",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:query"
              }
            }
          },
          "then": {
            "properties": {
              "payload": {
                "$ref": "#/$defs/PlainPayload"
              }
            }
          }
        },
        {
          "title": "payload of ruml:actions",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:actions"
              }
            }
          },
          "then": {
            "properties": {
              "payload": {
                "$ref": "#/$defs/PlainPayload"
              }
            }
          }
        },
        {
          "title": "CAP-05 — an official capability does not declare its role",
          "description": "The role of a `ruml:` capability is fixed by its chapter; only a non-official id declares one.",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "$ref": "#/$defs/OfficialCapabilityId"
              }
            }
          },
          "then": {
            "not": {
              "required": ["role"]
            }
          }
        },
        {
          "title": "CAP-03 — a non-official capability declares its role",
          "description": "A `ruml:draft/` or reverse-domain capability has no role in this specification; its root entry states the role the rulemap expects.",
          "if": {
            "required": ["id"],
            "properties": {
              "id": {
                "not": {
                  "$ref": "#/$defs/OfficialCapabilityId"
                }
              }
            }
          },
          "then": {
            "required": ["role"]
          }
        }
      ]
    },
    "UniqueOfficialCapabilityIds": {
      "description": "Each official `ruml:` capability id may appear at most once (§4.2, CAP-10). Only the `ruml:` ids defined by this spec version can be constrained here; duplicate `ruml:draft/…` and reverse-domain ids that differ in payload are not detectable in JSON Schema and MUST be rejected by the parser.",
      "allOf": [
        {
          "contains": {
            "type": "object",
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:datapoints"
              }
            }
          },
          "minContains": 0,
          "maxContains": 1
        },
        {
          "contains": {
            "type": "object",
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:text-reference"
              }
            }
          },
          "minContains": 0,
          "maxContains": 1
        },
        {
          "contains": {
            "type": "object",
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:tree-reference"
              }
            }
          },
          "minContains": 0,
          "maxContains": 1
        },
        {
          "contains": {
            "type": "object",
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:tree-include"
              }
            }
          },
          "minContains": 0,
          "maxContains": 1
        },
        {
          "contains": {
            "type": "object",
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:context"
              }
            }
          },
          "minContains": 0,
          "maxContains": 1
        },
        {
          "contains": {
            "type": "object",
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:query"
              }
            }
          },
          "minContains": 0,
          "maxContains": 1
        },
        {
          "contains": {
            "type": "object",
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:ai-query"
              }
            }
          },
          "minContains": 0,
          "maxContains": 1
        },
        {
          "contains": {
            "type": "object",
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:actions"
              }
            }
          },
          "minContains": 0,
          "maxContains": 1
        },
        {
          "contains": {
            "type": "object",
            "required": ["id"],
            "properties": {
              "id": {
                "const": "ruml:protocol"
              }
            }
          },
          "minContains": 0,
          "maxContains": 1
        }
      ]
    }
  }
}
