Describe the bug
When using the methods in the basyx-python-sdk to serialize a submodel to a JSON file, the file can not be imported in the Package Explorer with the use of Import Submodel from JSON.
To Reproduce
By using the basyx-python-sdk do the following.
- Create a submodel
- Serialize the submodel to a JSON file
- Code to reproduce:
#!/usr/bin/env python3
from basyx.aas import model
import basyx.aas.adapter.json
identifier = 'https://acplt.org/Simple_Submodel'
submodel = model.Submodel(id_=identifier)
obj_store: model.DictObjectStore[model.Identifiable] = model.DictObjectStore()
obj_store.add(submodel)
with open('data.json', "w") as file:
basyx.aas.adapter.json.write_aas_json_file(file, obj_store)
- Open an AAS with the Package Explorer
- In Package Explorer go to
File -> Import -> Import Submodel from JSONand select the JSON file
- Error message in Package Explorer occurs: Submodel Read: No valid Submodel, Env, source file selected
- An error still occurs after trying the workaround in Import Submodel as JSON · Issue #30 · eclipse-aaspe/package-explorer (github.com)
Error: Submodel Read: Can not read SubModel.: Unexpected property
Expected behavior
Import/export in PE should work with the sdk's serialization/deserialization.
Additional context
Deserialization of a file from Package Explorer Export Submodel from JSON into basyx-python-sdk does not work either.