CanonicalAAS: Define Ordering Rules and Canonical Representation for AAS #521
Labels
requires workstream approval
strategic decision proposal needs to be prepared in TF spec team
specification
impact on specification and thus on xml, json etc., label "aas-core" not set additinally
Is your feature request related to a problem? Please describe.
In AAS only at two places we conceptually have ordering :
SubmodelElementList
when theorderRelevant
flag istrue
Key
s withinReference
.In all other scenarios, ordering has no impact on the meaning of the asset. For example, elements inside a Submodel are conceptually unordered, meaning their sequence does not carry semantic significance.
However, the issue arises because the JSON representation of AAS uses arrays rather than dictionaries for serialization. While this approach is practical and widely supported, it unintentionally suggests that the order of elements in arrays is meaningful. This misunderstanding leads to users and tools, such as Package Explorer, implementing ordering-related features like "Move Up" and "Move Down" for elements inside a Submodel, which is conceptually incorrect.
This creates a situation where users and developers rely on ordering where it is not intended, causing confusion and potential interoperability issues. Addressing this misconception is critical to aligning implementations with the intended AAS concepts.
So if inside the ContactInformations Submodel we have this ordering:
Changing the order shouldn't be important for people. Which I am sure it is not the case:
But if your AAS is in circulation between diferent system, and for some reason they decide to mess around with the ordering of elements (at JSON serialization level), then it will be confusing.
Describe the solution you'd like
The Asset Administration Shell (AAS) doesn’t have a canonical form, which can lead to instability in how data is serialized. Similar to JSON canonicalization, having a standard format for AAS ensures consistent ordering and structure, making debugging easier. It also simplifies version control, such as using Git, by making it clear what has changed between versions. Additionally, a canonical form would help REST APIs provide data in a stable and predictable way, improving compatibility and reliability.
Additional context
This is particularly relevant for the IDTA Ontology Workgroup, as ordering in RDF needs special consideration. If we only preserve the order for elements where it matters, round-tripping between JSON/XML and RDF (e.g., for Submodel elements) may result in changes to the order of other elements. If clients assume a specific order for purposes like display or processing, this can lead to interoperability issues. However, if we preserve the order for all elements to ensure a stable round-trip, we deviate from the correct conceptual model, where order should only matter for specific elements.
The text was updated successfully, but these errors were encountered: