eclipse-aaspe / package-explorer

AASX Package Explorer
Other
64 stars 19 forks source link

[BUG] empty <supplementalSemanticIds /> elements exported in XML #195

Closed Christian-Block closed 5 months ago

Christian-Block commented 8 months ago

Please see Issue 273 in AAS4J repository.

The XML generated by AASP creates empty <supplementalSemanticIds /> elements.

supplementalSemanticIds is specified in IDTA 01001-3-0 and is included in XSD. Both define supplementalSemanticIds as optional.

However, it seems, that the AASP does not follow the XML optional-properties rule.

It seems to make a difference if you have created supplementalSemanticIds image (case 1)

or not image (case 2)

In case 1 an empty element is not exported. In case 2 an empty element is exported.

Tested Version: v2024-02-27

FrankSchnicke commented 7 months ago

This does also happen with Qualifiers as well as with OperationVariables. With the latest update of AAS4J, it should be able to handle these AASX - but nevertheless, it would be better if this was fixed.

sebastiankb commented 7 months ago

fyi

https://github.com/eclipse-aas4j/aas4j/issues/273#issuecomment-2049927567

foprs commented 7 months ago

Here is a further example of empty elements in this case a Concept Description copied into the buffer from the AASPE. AASPE is generating these empty elements. In some cases, after deletion of an element, the empty element is left.

In this case a AAS API for ConceptDescriptions (according Open API Spec.) is refusing the JSON and the CD can't be imported into a CD Repository.

This is a major bug and should be adressed a.s.a.p.

image

juileetikekar commented 6 months ago

Hi All,

"Empty Lists", especially in case of optional elements is a known issue of the package explorer. Also, there has been found inconsistency between specifications and schema. An issue for the inconsisteny can be found at https://github.com/admin-shell-io/aas-specs/issues/418.

mristin commented 6 months ago

Just for reference. Here's the excerpt from https://github.com/admin-shell-io/aas-specs/tree/master/schemas/json#uml-properties-to-json-properties:

Aggregations, i.e., the properties with the cardinality 0.., 1.. etc., are modeled as JSON arrays.

We explicitly forbid empty JSON arrays to avoid confusion about properties which have cardinality 0..*. Namely, an empty array is semantically equal to an omitted attribute (according to the meta-model). Thus, the JSON property representing an aggregation attribute must be omitted if the aggregation is empty.

BirgitBoss commented 6 months ago

see https://github.com/admin-shell-io/aas-specs/issues/418

juileetikekar commented 5 months ago

Hi @Christian-Block,

Thank you for raising the issue !

We have developed a new feature "Fix and Finalize" which removes/fixes the issue with empty lists and empty strings. In additional to this, we are also working on more hints in such violations.

Meanwhile, I would like to request you to use this "Fix and Finalize" option to remove empty or such optional strings/lists from the serialization.

image