fix(examples): correct broken BNF and JSON example files#73
Open
aorzelskiGH wants to merge 1 commit into
Open
Conversation
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: <FieldIdentifierFragment>
to match <SecurityQueryFilter>.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes concrete bugs in the BNF and JSON example files under
documentation/IDTA-01004/modules/ROOT/partials/examples/. WiderCI-side example validation is intentionally deferred to the
conformance-tests PR (T-16).
Problem
Several examples were broken in ways that prevent them from being
used as normative illustrations:
filter.bnf,filter.json:DESCRIPTOR $aasDesc("*")— thegrammar token is
$aasdesc. Case-sensitive parsers reject this.filter.bnf:FILTER: FRAGMENT "$aasdesc#specificAssetIds[]"used the old route-literal form. The current
<SecurityQueryFilter>requiresFRAGMENT: <FieldIdentifierFragment>.allow-read-list-semanticids-machinestate.json:FORMULAwasnot a
logicalExpressionat all; it contained a stray"REFERENCE"object with a dangling string, not even well-formedJSON of a formula value.
reuse-acl-object-formula.json: the firstREFERABLEhad anunbalanced escape sequence
"$sme("\https://s1.com\").p1".allow-create-only-specific.json:$eqcompared{"CLAIM": "Role"}directly (an attribute descriptor) instead ofwrapping it in
{"$attribute": {"CLAIM": "Role"}}.allow-read-all-users-of-company-for-submodel.bnf,allow-read-submodels-id-pattern.bnf:CLAIM("…")was at thesame indentation as
RIGHTS, so the attribute was visually notscoped under
ATTRIBUTES:.Solution
Targeted fixes only, keeping the examples' original intent:
$aasdescthroughoutfilter.*.allow-read-list-semanticids-machinestate.jsonFORMULAto mirror its
.bnftwin:$eqof the REFERENCE$attributeanda
$strVal "not-running".reuse-acl-object-formula.json.CLAIMin$attributeinallow-create-only-specific.json.CLAIM("…")underATTRIBUTES:in the two BNF files.All 11 JSON examples under
partials/examples/now parse as validJSON.
Impact
inputs.
Review notes
allow-read-list-semanticids-machinestate.json(allowEXECUTEonly when machineState is
"not-running") is what the originalauthors wanted — the previous content was unreconstructable; this
interpretation follows the sibling
.bnffile.filter.*FRAGMENT rewrite depends on the canonicalSecurityQueryFilterform from the Security BNF; it is orthogonalto the API-side harmonization in the parallel API PR.
Related
Review Finding T-12: Broken example files.
Complements: T-02 (
aas-specs-apiPR #579) for the canonicalSecurityQueryFiltershape.