fix(schema): align /// with BNF; widen timeLiteralPattern#76
Open
aorzelskiGH wants to merge 1 commit into
Open
fix(schema): align /// with BNF; widen timeLiteralPattern#76aorzelskiGH wants to merge 1 commit into
aorzelskiGH wants to merge 1 commit into
Conversation
…h/$year and timeLiteralPattern
The BNF defines these keys as numeric-extraction functions over a
dateTime expression:
<dateTimeToNum> ::=
( "$dayOfWeek" | "$dayOfMonth" | "$month" | "$year" )
<ws> "(" <ws> <dateTimeOperand> <ws> ")" <ws>
where <dateTimeOperand> is a DateTimeLiteral, a cast to dateTime, or
a GlobalAttribute (e.g. GLOBAL(UTCNOW)). The argument is therefore a
Value expression that evaluates to a dateTime, not a literal
xsd:dateTime string.
The JSON schemas typed these four keys as
$ref: "#/definitions/dateTimeLiteralPattern"
which forced them to be literal ISO date-time strings and made
constructs like `{"$dayOfWeek": {"$attribute": {"GLOBAL": "UTCNOW"}}}`
invalid even though the BNF explicitly allows them.
timeLiteralPattern was also stricter than the grammar: it rejected
fractional seconds. The BNF <time> is:
<hour> ":" <minute> ( ":" <second> )? ( "." <fraction> )?
Changes:
- $dayOfWeek, $dayOfMonth, $month, $year -> $ref Value
- timeLiteralPattern pattern
before: ^[0-9][0-9]:[0-9][0-9](:[0-9][0-9])?$
after : ^[0-9]{2}:[0-9]{2}(:[0-9]{2})?(\.[0-9]+)?$
Files:
- aas-specs-api: partials/query-json-schema.json, pages/schema.adoc
- aas-specs-security: partials/json/aas-queries-and-access-rules-schema.json, partials/json/formulas-and-logical-expressions.json
Refs: Review Finding T-14
Made-with: Cursor
Martin187187
approved these changes
Apr 20, 2026
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
Align the JSON Schemas for Access Rules with the BNF grammar for date and time semantics.
Problem
The BNF defines
$dayOfWeek,$dayOfMonth,$month,$yearas numeric extraction functions whose argument is a<dateTimeOperand>(a literal, adateTime(...)cast or aGLOBAL(UTCNOW)attribute access). The schemas typed these keys asdateTimeLiteralPattern, forcing the argument to be a literal xsd:dateTime string and rejecting legal constructs such as:{"$dayOfWeek": {"$attribute": {"GLOBAL": "UTCNOW"}}}In addition,
timeLiteralPatterndid not allow fractional seconds, although the BNF<time>rule does.Solution
$dayOfWeek,$dayOfMonth,$month,$yearnow reference#/definitions/Value, matching the BNF.timeLiteralPatternis widened to^[0-9]{2}:[0-9]{2}(:[0-9]{2})?(\.[0-9]+)?$to cover optional seconds and fractional seconds per xsd:time / BNF<time>.Affected files
documentation/IDTA-01004/modules/ROOT/partials/json/aas-queries-and-access-rules-schema.jsondocumentation/IDTA-01004/modules/ROOT/partials/json/formulas-and-logical-expressions.jsonReview notes
Refs: Review Finding T-14