Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapter.xml: Update XSD to v3.0 #161

Merged
merged 7 commits into from
Nov 16, 2023

Conversation

s-heppner
Copy link
Contributor

@s-heppner s-heppner commented Nov 14, 2023

This implements the missing changes to the XSD schema from the specification v3.0.

However, as noted in #72, we did not include the regex patterns for the File.

Since this is quite a lot, I suggest looking at the single commits for the review.

This commit remanes `valueDataType_t` from the XSD to
`valueDataType`.
Furthermore, it adds a missing `<reference>` tag around
the `refersTo` References of `Extension`.
The current order of the elements in `SubmodelElementList`
was wrong. This updates the order.
Version 3.0 of the spec removes the attribute `kind` from
`SubmodelElement`s.
While we already implemented this, it was still missing in the
XSD Schema, as well as the examples. This commit fixes that.
Copy link
Contributor

@jkhsjdhjs jkhsjdhjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside the comment to the Extension serialization, this also currently doesn't adjust the XML deserialization for Extension.refers_to. This went unnoticed because Extensions aren't compared by the AASDataChecker, hence also my message on Zulip. Maybe the AASDataChecker should compare Extensions so we can properly test our SDK?

basyx/aas/adapter/xml/xml_serialization.py Outdated Show resolved Hide resolved
Currently, the XML deserialization missed the
`<aas:refersTo>` wrapper around the single references
inside `Extension.refers_to`. This commit fixes that.
@s-heppner
Copy link
Contributor Author

Aside the comment to the Extension serialization, this also currently doesn't adjust the XML deserialization for Extension.refers_to. This went unnoticed because Extensions aren't compared by the AASDataChecker, hence also my message on Zulip. Maybe the AASDataChecker should compare Extensions so we can properly test our SDK?

The deserialization is fixed in 6071934

@s-heppner s-heppner marked this pull request as draft November 15, 2023 09:04
@s-heppner s-heppner marked this pull request as ready for review November 15, 2023 09:32
@s-heppner s-heppner added the v3.0 label Nov 15, 2023
basyx/aas/model/base.py Outdated Show resolved Hide resolved
Currently, `Extension.refers_to` is declared as a `Iterable[Reference]`.
This implies, that we can not necessarily check, whether or not the
attribute is empty or not.
This creates a problem with the XML serialization, since the
`<aas.refersTo>` element should only appear if there is at least
one `Reference` inside.

This commit changes the `Extension.refers_to` to be a set of
`Reference`s, as well as adapting a more clear check whether
or not the attribute is empty in `adapter.xml.xml_serialization`.
@jkhsjdhjs
Copy link
Contributor

LGTM 👍

@s-heppner s-heppner merged commit 03c1579 into eclipse-basyx:improve/V30 Nov 16, 2023
6 checks passed
@s-heppner s-heppner deleted the update/XSD branch November 16, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants