Closed the-nic closed 2 years ago
Many thanks for providing your report. I tried to reproduce your issue with the AAS Server 1.0.2 Version but on my end it is working as expected.
Can you provide further details? Are you using our Docker Image on Docker Hub or are you starting the AAS Server differently? Can you provide the specific rest calls, i.e., URL & payload, that you are doing?
It is aas-server image 1.0.2 from dockerhub
the calls:
PUT http://172.29.8.193:8082/aasServer/shells/sim%2Faas%2F1220_8141_0112_0875/aas/submodels/test_submodel
{"idShort": "test_submodel", "modelType": {"name": "Submodel"}, "identification": {"id": "Alarm", "idType": "IRI"}, "submodelElements": [{"idShort": "ExampleProperty2", "modelType": {"name": "Property"}, "value": "exampleValue2", "valueType": "string"}, {"idShort": "ExampleProperty", "modelType": {"name": "Property"}, "value": "exampleValue", "valueType": "string"}]}
GET http://172.29.8.193:8082/aasServer/shells/sim%2Faas%2F1220_8141_0112_0875/aas/submodels
{"identification": {"idType": "IRI", "id": "Alarm"}, "modelType": {"name": "Submodel"}, "idShort": "test_submodel", "submodelElements": {"ExampleProperty2": {"idShort": "ExampleProperty2", "valueType": "string", "modelType": {"name": "Property"}, "value": "exampleValue2"}, "ExampleProperty": {"idShort": "ExampleProperty", "valueType": "string", "modelType": {"name": "Property"}, "value": "exampleValue"}}}
Expected a SubmodelElement in Submodel[Identifier(IRI=Alarm)], but found 'ExampleProperty2'
Expected a SubmodelElement in Submodel[Identifier(IRI=Alarm)], but found 'ExampleProperty'
I still can't reproduce it. I'm doing the following:
docker run --name=aas -p 8081:4001 eclipsebasyx/aas-server:1.0.2
Create dummy AAS via
PUT http://localhost:8081/aasServer/shells/test
{ "hasDataSpecification": [], "asset": { "keys": [], "kind": "Instance", "identification": { "idType": "IRI", "id": "exampleAsset" }, "idShort": "exampleAssetIdShort" }, "submodels": [], "conceptDictionaries": [], "identification": { "idType": "IRI", "id": "test" }, "idShort": "HandsOnOven", "modelType": { "name": "AssetAdministrationShell" } }
Afterwards, I create your submodel using your JSON and
PUT http://localhost:8081/aasServer/shells/test/aas/submodels/test_submodel
Getting it via
http://localhost:8081/aasServer/shells/test/aas/submodels/test_submodel/submodel
returns exactly what I'm expecting
{ "identification": { "idType": "IRI", "id": "Alarm" }, "modelType": { "name": "Submodel" }, "idShort": "test_submodel", "submodelElements": [ { "idShort": "ExampleProperty2", "valueType": "string", "modelType": { "name": "Property" }, "value": "exampleValue2" }, { "idShort": "ExampleProperty", "valueType": "string", "modelType": { "name": "Property" }, "value": "exampleValue" } ] }
Are you doing anything differently?
After further internal discussion, we could reproduce this issue. It only happens when retrieving all Submodels of an AAS, i.e.
GET http://localhost:8081/aasServer/shells/test/aas/submodels/
We will address this issue in the first service release of the upcoming 1.1 release. The 1.1.1 release is projected to happen in April.
I will update this ticket when the bug is fixed. Many thanks again for pointing this out!
Note that a very similar issue appears on modelTypes of SubmodelElementCollection
.
Can you provide a json example of what exactly is going wrong?
Sorry, its the same as above: Instead of returning a list of elements, a dict
is returned with id_short
as key. Also only happens when requesting all submodels, not when requesting a specific submodel or submodel value.
I've set up a AAS server and request all submodels. I generate it like this using https://github.com/eclipse-basyx/basyx-python-sdk
and then simply upload it via a
PUT
request to the aasServer.Afterwards I
GET
the submodel again and the payload from AAS server 1.0.2 looks like thisthis is a bit different from what the json serialization from python returns:
And according to my bug report in https://github.com/eclipse-basyx/basyx-python-sdk/issues/7 the AASServer is violating the spec and returning an incorrect payload. Could you verfy that?