Open WelliSolutions opened 9 months ago
I see what the problem is there.
Before version 3.0 of the specification, there existed a constraint:
Constraint AASd-100: An attribute with data type "string" is not allowed to be empty
However, that constraint has been removed with v3.0:
AASd-100 Removed: Since new string types with length constraints were added, this constraint is no longer needed
So, the idea behind the removal was, that it already exists implicitly in every data type that is based on string anyway.
However, such constraint appears to have been forgotten with the most basic xs:String
.
Semantically, it is unclear what is meant with an empty string ""
in comparision to a None
, therefore we (and the specification as well) did not allow it.
Due to the fact, that the behavior of the function you provided is expected in every case except for values of SubmodelElement
s, your fix sadly is not sufficient.
In order to be fully compliant to the specification, I will convert your Issue to a Bug and we will fix it for v3.0 However, I will also bring this issue up with the specification group.
Thanks for helping to uncover this issue!
AAS before processing with Basyx: it has an empty manufacturer name:
AAS after processing with Basyx: the manufacturer name is gone:
So, basically the difference is between
""
(empty string) andNone
(null).IMHO, the cause is in line 219 of xml_deserialization.py
Proposed fix: