Skip to content

fix: align time literals with JSON Schema time format & more examples & added ReferenceAttribute explanation & fixed json schema being too broad#88

Open
Martin187187 wants to merge 7 commits into
admin-shell-io:IDTA-01004-3-1_Workingfrom
Martin187187:fix-time
Open

fix: align time literals with JSON Schema time format & more examples & added ReferenceAttribute explanation & fixed json schema being too broad#88
Martin187187 wants to merge 7 commits into
admin-shell-io:IDTA-01004-3-1_Workingfrom
Martin187187:fix-time

Conversation

@Martin187187

@Martin187187 Martin187187 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • This PR aligns time literals with JSON Schema format: "time" and RFC 3339 semantics.
  • I also fixed dateTimeAttributeItem in json schema and bnf. This was too broad and too narrow at the same time.
  • Json Schema was in general too broad.
  • add more examples
  • add explanation for ReferenceAttribute

Closes #63.

Why

Date-time literals already use the standard JSON Schema format: "date-time". Time literals should use the matching standard format: "time" instead of a custom regex.

Using the standard format improves interoperability with existing JSON Schema validators and avoids different interpretations of time values. It also makes timezone information explicit, which is important for access rules because values like 09:00 are ambiguous across clients, servers, and deployments in different time zones.

Changes

  • Replaced the custom timeLiteralPattern regex with format: "time".
  • Aligned the BNF grammar with the JSON Schema time format.
  • Updated examples to use explicit values such as 09:00:00Z.
  • Added validation coverage for valid and invalid time literals.

Compatibility

This rejects shorthand values such as 09:00. The stricter format is intentional because time comparisons should include seconds and timezone information.

Comment thread tests/query/test_time_literal_regex.py Dismissed
Comment thread tests/query/test_time_literal_regex.py Dismissed
Comment thread tests/query/test_time_literal_regex.py Dismissed
Comment thread tests/query/test_time_literal_regex.py Dismissed
Comment thread tools/validate_spec_artifacts.py Fixed

An important special operation is $match, which can be used with any element containing a list of elements, e.g. semanticId[], specificAssetId[], SubmodelElementList or SubmodelElementCollection.
The list element is written with [] to express, that $match shall check if a certain expression is true for at least one element in the list.
FILTER defines one fragment restriction for a returned object, while FILTERLIST defines several fragment restrictions with independent conditions.
@@ -0,0 +1,38 @@
DEFACLS "maintenanceRead"
RIGHTS: READ
ACCESS: ALLOW

DEFOBJECTS "MaintenanceDocuments"
DEFOBJECTS "MaintenanceDocuments"
REFERABLE $sme("SubmodelID-Maintenance").maintenanceDocuments

DEFFORMULAS "maintenanceWhenRunning"
DEFFORMULAS "matchingMaintenanceDocuments"
$sme.maintenanceDocuments[].requiredMachineState#value $eq REFERENCE($sme("SubmodelID-OperationalData").machineState#value)

ACCESSRULE:
"USEOBJECTS": [
"MaintenanceDocuments"
],
"USEFORMULA": "maintenanceWhenRunning",
"USEFORMULA": "maintenanceWhenRunning",
"FILTER": {
"FRAGMENT": "$sme.maintenanceDocuments[]",
"USEFORMULA": "matchingMaintenanceDocuments"
}
},
{
"USEACL": "maintenanceRead",
},
{
"USEACL": "maintenanceRead",
"USEOBJECTS": [
"USEOBJECTS": [
"MaintenanceDocuments"
],
"USEFORMULA": "maintenanceWhenNotRunning"
@Martin187187 Martin187187 changed the title fix: align time literals with JSON Schema time format fix: align time literals with JSON Schema time format & more examples & added ReferenceAttribute explanation & fixed json schema being too broad Jun 30, 2026
Comment thread tools/validate_spec_artifacts.py Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants