Skip to content

[BUG] The import/export of JSON in PE is not working when using JSON serialization/deserialization with the basyx-python-sdk. #254

@JS-Aibel

Description

@JS-Aibel

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.

  1. Create a submodel
  2. Serialize the submodel to a JSON file
  3. 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)
  1. Open an AAS with the Package Explorer
  2. In Package Explorer go toFile -> Import -> Import Submodel from JSONand select the JSON file
  3. Error message in Package Explorer occurs: Submodel Read: No valid Submodel, Env, source file selected
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions