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
Conversation
|
|
||
| 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" |
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
format: "time"and RFC 3339 semantics.Closes #63.
Why
Date-time literals already use the standard JSON Schema
format: "date-time". Time literals should use the matching standardformat: "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:00are ambiguous across clients, servers, and deployments in different time zones.Changes
timeLiteralPatternregex withformat: "time".09:00:00Z.Compatibility
This rejects shorthand values such as
09:00. The stricter format is intentional because time comparisons should include seconds and timezone information.