-
Notifications
You must be signed in to change notification settings - Fork 1
Add adapter to write/read AASX packages #9
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
base: main
Are you sure you want to change the base?
Conversation
s-heppner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been reviewing of what I thought was the design until I understood that there are actually two possible designs that we should probably discuss in more detail:
- Only add
aasx.pyand theObjectStore, moving what you need from the other adapters into these modules and remove everything else completely to keep the framework as lightweight as possible - Be (somewhat) backward compatible with the BaSyx-Python SDK and add the XML and JSON adapters with their outermost signatures and methods, so that users do not have to learn the new methods.
It seems you have followed the 2nd method, however with the tutorials, we already updated to the 1st one. I think both are viable and we should discuss.
The adapter actually is not backward compatible with the BaSyx-Python SDK. It just happens that we did not update the folder structure to actually match what has been done. |
|
As far as I can see it, this lgtm now. Could you resolve the conflicts? |
s-heppner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should discuss which functionalities from the old adapters we really really need, or if we can get around using them, as to provide a more readable and minimalistic AASX adapter. Let's talk about that in our next meeting.
The route now uses the submodel identifier instead of the submodel reference.
The submodel routes of the AAS API `/shells/<aas_id>/submodels` are the same already implemented as the submodel API, so we return a redirect here, after checking that the AAS indeed has a reference to the requested submodel. `PUT` and `DELETE` are different, as we also have to update the AAS in this case, either by adding a new updated reference in case of a `PUT` request changes the submodel id, or by removing the submodel reference for `DELETE` requests.
The `IdentifierConverter` is also used to decode values from URLs, that aren't necessarily Identifiers, e.g. Qualifier types. Thus, a name like `Base64URLConverter` suits its use better and is also more expressive. For the same reasons, the key `identifier`, which was used for the `IdentifierConverter`, is renamed to `base64url`.
Methods `_get_shell()` and `_get_shells()` are added similarly to `_get_submodel()` and `_get_submodels()`, which were previously added in a5c7d69. Furthermore, when requesting multiple AAS/Submodels, we're now also updating these in `_get_all_obj_of_type()` before returning them. Finally, updating AAS/Submodel objects is also moved to `_get_obj_ts()`.
* adapter.http: implement the attachment routes * adapter.http: fix codestyle errors * adapter.http: implement recommended changes * adapter.http: implement new recommended changes
This change makes use of the `SupplementaryFileContainer` interface of the AASX adapter. It allows the API to operate seamlessly on AASX files, including the contained supplementary files, without having to access the filesystem. Furthermore, the support for the modification of `Blob` values is removed (the spec prohibits it).
…sitory to be compatible with aas-core3.0
…style/mypy errors
…rious typing/codestyle errors
…tion of return type
… match project structure. Simplify some functions of aasx.py
…eate_simple_aas.py: Implement tutorial comparable to the tutorial in the basyx python sdk
…import. sdk/basyx/aasx.py: Include sample codeblock for adapter usage. Update imports in tutorial files
|
LGTM now. If you resolve the conflicts for rebasing, we can close this PR. Thanks for your hard work! |
Implement the adapter and DictSupplementaryFileContainer of basyx-python-sdk.
We use the serialisation/deserialisation of aas-core3.0 of json/xml to write/read AASX packages.