4.2 Capability Declaration
The `role` declaration of non-official capabilities at root, node capabilities without a root declaration, and duplicate ids at root.
custom-capability-with-role
| Description | A third-party capability declares the role the rulemap expects. |
|---|---|
| Expect | accept |
| Layer | schema |
| RUML | 4-2-capabilities-field.fixtures/accept-custom-capability-with-role.ruml |
| Spec | §4.2§4.1 |
{ "$format": "RUML", "$specVersion": "1.0", "capabilities": [ { "id": "org.ruml.test/data", "role": "data" } ], "metadata": { "id": "ec36948d-fbb2-4815-985a-bd5e9375d934", "version": "1.0.0", "created": "2024-01-01T00:00:00Z", "modified": "2024-01-01T00:00:00Z", "status": "inForce", "validFrom": "2024-01-01T00:00:00Z" }, "rulemap": { "nodes": { "1": { "id": "0eb360a6-626a-406d-89a1-9f434ced141b", "label": "Prüfung abgeschlossen", "capabilities": [ { "id": "org.ruml.test/data", "payload": { "status": "pending" } } ] } } }}custom-capability-without-role
| Description | A third-party capability has no role in this specification, so its root entry MUST declare one. |
|---|---|
| Expect | reject |
| Layer | schema |
| RUML | 4-2-capabilities-field.fixtures/reject-custom-capability-without-role.ruml |
| Spec | §4.2§4.1 |
| Expected rule violations | CAP-03 |
| At | /capabilities/0 |
{ "$format": "RUML", "$specVersion": "1.0", "capabilities": [ { "id": "org.ruml.test/data" } ], "metadata": { "id": "ec36948d-fbb2-4815-985a-bd5e9375d934", "version": "1.0.0", "created": "2024-01-01T00:00:00Z", "modified": "2024-01-01T00:00:00Z", "status": "inForce", "validFrom": "2024-01-01T00:00:00Z" }, "rulemap": { "nodes": { "1": { "id": "0eb360a6-626a-406d-89a1-9f434ced141b", "label": "Prüfung abgeschlossen", "capabilities": [ { "id": "org.ruml.test/data", "payload": { "status": "pending" } } ] } } }}empty-node-capabilities-without-root
| Description | The file declares no capabilities, and node `1` carries an empty `capabilities` array; the field MUST be absent on all nodes. |
|---|---|
| Expect | reject |
| Layer | schema |
| RUML | 4-2-capabilities-field.fixtures/reject-empty-node-capabilities-without-root.ruml |
| Spec | §4.2 |
| Expected rule violations | CAP-14 |
| At | /rulemap/nodes/1/capabilities |
{ "$format": "RUML", "$specVersion": "1.0", "metadata": { "id": "51a392a5-6ece-4eca-ad2d-c4d3a8399be6", "version": "1.0.0", "created": "2024-01-01T00:00:00Z", "modified": "2024-01-01T00:00:00Z", "status": "inForce", "validFrom": "2024-01-01T00:00:00Z" }, "rulemap": { "nodes": { "1": { "id": "ec36948d-fbb2-4815-985a-bd5e9375d934", "label": "Anspruch auf Schadensersatz", "capabilities": [] } } }}duplicate-official-capability
| Description | `ruml:expression` is declared twice in the root `capabilities` array. |
|---|---|
| Expect | reject |
| Layer | schema |
| RUML | 4-2-capabilities-field.fixtures/reject-duplicate-official-capability.ruml |
| Spec | §4.2 |
| Expected rule violations | CAP-10 |
| At | /capabilities |
{ "$format": "RUML", "$specVersion": "1.0", "capabilities": [ { "id": "ruml:expression", "required": true }, { "id": "ruml:expression", "required": true } ], "metadata": { "id": "6d0f3b2a-8c41-4e7a-9b5d-2f1e0a9c7b34", "version": "1.0.0", "created": "2024-01-01T00:00:00Z", "modified": "2024-01-01T00:00:00Z", "status": "inForce", "validFrom": "2024-01-01T00:00:00Z" }, "rulemap": { "nodes": { "1": { "id": "0eb360a6-626a-406d-89a1-9f434ced141b", "operator": "DELEGATED", "label": "Mindestens zwei Merkmale erfüllt", "children": ["2", "3", "4"], "capabilities": [ { "id": "ruml:expression", "payload": { "description": "Mindestens zwei der drei Merkmale müssen erfüllt sein", "expression": "$count($children[status = 'true']) >= 2" } } ] }, "2": { "id": "1a5b7c3d-2e4f-4a6b-8c9d-0e1f2a3b4c5d", "label": "Merkmal 1" }, "3": { "id": "2b6c8d4e-3f5a-4b7c-9d0e-1f2a3b4c5d6e", "label": "Merkmal 2" }, "4": { "id": "3c7d9e5f-4a6b-4c8d-ae1f-2a3b4c5d6e7f", "label": "Merkmal 3" } } }}duplicate-custom-capability
| Description | A third-party capability is declared twice in the root `capabilities` array. The schema cannot detect this for third-party ids, so the parser MUST reject it. |
|---|---|
| Expect | reject |
| Layer | semantic |
| RUML | 4-2-capabilities-field.fixtures/reject-duplicate-custom-capability.ruml |
| Spec | §4.2 |
| Expected rule violations | CAP-10 |
| At | /capabilities/1 |
{ "$format": "RUML", "$specVersion": "1.0", "capabilities": [ { "id": "org.ruml.test/data", "role": "data" }, { "id": "org.ruml.test/data", "role": "data" } ], "metadata": { "id": "9b2e4c71-5a3d-4f08-8e6b-1c7d0f2a3b45", "version": "1.0.0", "created": "2024-01-01T00:00:00Z", "modified": "2024-01-01T00:00:00Z", "status": "inForce", "validFrom": "2024-01-01T00:00:00Z" }, "rulemap": { "nodes": { "1": { "id": "0eb360a6-626a-406d-89a1-9f434ced141b", "label": "Prüfung abgeschlossen", "capabilities": [ { "id": "org.ruml.test/data", "payload": { "status": "pending" } } ] } } }}