From eed066b695f83009230f2a77c4b8cfb54fa8bb34 Mon Sep 17 00:00:00 2001 From: aorzelskiGH Date: Fri, 17 Apr 2026 16:53:05 +0200 Subject: [PATCH] fix(examples): correct broken BNF and JSON example files Several example files in partials/examples shipped broken content that a reader or test harness would either reject or silently misinterpret. This change fixes the concrete bugs; wider CI-side example validation is added by a follow-up PR (T-16). filter.bnf / filter.json - DESCRIPTOR used $aasDesc; grammar defines $aasdesc. Corrected. - FRAGMENT syntax inside FILTER used the old route-literal form (FRAGMENT "..."). Corrected to FRAGMENT: to match . allow-read-list-semanticids-machinestate.json - FORMULA was not a logicalExpression: it contained a stray "REFERENCE" object with a bare string token, not even valid JSON of a formula. Rewritten to match the .bnf counterpart: REFERENCE(...) $eq "not-running" -> $eq of $attribute/REFERENCE and $strVal. reuse-acl-object-formula.json - First REFERABLE had an unbalanced backslash/quote sequence ('$sme("\https://s1.com\").p1'). Replaced by the correctly escaped form used in its sibling entry. allow-create-only-specific.json - $eq compared {"CLAIM": "Role"} (an attribute descriptor, not a Value object). Wrapped it in {"$attribute": {"CLAIM": "Role"}} to match the BNF form CLAIM("Role") $eq "...". allow-read-all-users-of-company-for-submodel.bnf allow-read-submodels-id-pattern.bnf - ATTRIBUTES child was at the same indentation as RIGHTS, making the examples visually ambiguous. Indented under ATTRIBUTES:. Refs: Review Finding T-12 Made-with: Cursor --- .../examples/allow-create-only-specific.json | 4 +++- ...allow-read-all-users-of-company-for-submodel.bnf | 2 +- .../allow-read-list-semanticids-machinestate.json | 13 ++++++++++--- .../examples/allow-read-submodels-id-pattern.bnf | 2 +- .../modules/ROOT/partials/examples/filter.bnf | 4 ++-- .../modules/ROOT/partials/examples/filter.json | 2 +- .../partials/examples/reuse-acl-object-formula.json | 2 +- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-create-only-specific.json b/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-create-only-specific.json index 46af593..56889ce 100644 --- a/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-create-only-specific.json +++ b/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-create-only-specific.json @@ -23,7 +23,9 @@ { "$eq": [ { - "CLAIM": "Role" + "$attribute": { + "CLAIM": "Role" + } }, { "$strVal": "person with legitimate interest" diff --git a/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-all-users-of-company-for-submodel.bnf b/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-all-users-of-company-for-submodel.bnf index 53be34a..db0af8d 100644 --- a/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-all-users-of-company-for-submodel.bnf +++ b/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-all-users-of-company-for-submodel.bnf @@ -1,6 +1,6 @@ ACCESSRULE: ATTRIBUTES: - CLAIM("email") + CLAIM("email") RIGHTS: READ ACCESS: ALLOW OBJECTS: diff --git a/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-list-semanticids-machinestate.json b/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-list-semanticids-machinestate.json index ce6e9d9..df9d67d 100644 --- a/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-list-semanticids-machinestate.json +++ b/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-list-semanticids-machinestate.json @@ -19,9 +19,16 @@ } ], "FORMULA": { - "REFERENCE": { - "$sme(\"SubmodelID-OperationalData\").machineState#value" - } + "$eq": [ + { + "$attribute": { + "REFERENCE": "$sme(\"SubmodelID-OperationalData\").machineState#value" + } + }, + { + "$strVal": "not-running" + } + ] } } ] diff --git a/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-submodels-id-pattern.bnf b/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-submodels-id-pattern.bnf index c3be952..cf9bdb7 100644 --- a/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-submodels-id-pattern.bnf +++ b/documentation/IDTA-01004/modules/ROOT/partials/examples/allow-read-submodels-id-pattern.bnf @@ -1,6 +1,6 @@ ACCESSRULE: ATTRIBUTES: - CLAIM("companyName") + CLAIM("companyName") RIGHTS: READ ACCESS: ALLOW OBJECTS: diff --git a/documentation/IDTA-01004/modules/ROOT/partials/examples/filter.bnf b/documentation/IDTA-01004/modules/ROOT/partials/examples/filter.bnf index 1a712f3..58b3f57 100644 --- a/documentation/IDTA-01004/modules/ROOT/partials/examples/filter.bnf +++ b/documentation/IDTA-01004/modules/ROOT/partials/examples/filter.bnf @@ -4,7 +4,7 @@ ACCESSRULE: RIGHTS: READ ACCESS: ALLOW OBJECTS: - DESCRIPTOR $aasDesc("*") + DESCRIPTOR $aasdesc("*") FORMULA: $and( CLAIM("BusinessPartnerNumber") $eq "BPNL00000000000A", @@ -19,7 +19,7 @@ ACCESSRULE: ) ) FILTER: - FRAGMENT "$aasdesc#specificAssetIds[]" + FRAGMENT: $aasdesc#specificAssetIds[] CONDITION: $or( $match( diff --git a/documentation/IDTA-01004/modules/ROOT/partials/examples/filter.json b/documentation/IDTA-01004/modules/ROOT/partials/examples/filter.json index 92d926a..38a9531 100644 --- a/documentation/IDTA-01004/modules/ROOT/partials/examples/filter.json +++ b/documentation/IDTA-01004/modules/ROOT/partials/examples/filter.json @@ -15,7 +15,7 @@ }, "OBJECTS": [ { - "DESCRIPTOR": "$aasDesc(\"*\")" + "DESCRIPTOR": "$aasdesc(\"*\")" } ], "FORMULA": { diff --git a/documentation/IDTA-01004/modules/ROOT/partials/examples/reuse-acl-object-formula.json b/documentation/IDTA-01004/modules/ROOT/partials/examples/reuse-acl-object-formula.json index 545e473..2837ed9 100644 --- a/documentation/IDTA-01004/modules/ROOT/partials/examples/reuse-acl-object-formula.json +++ b/documentation/IDTA-01004/modules/ROOT/partials/examples/reuse-acl-object-formula.json @@ -22,7 +22,7 @@ "name": "Properties", "objects": [ { - "REFERABLE": "$sme("\https://s1.com\").p1" + "REFERABLE": "$sme(\"https://s1.com\").p1" }, { "REFERABLE": "$sme(\"https://s1.com\").p2"