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

What are the various types of JSON representations for a submodel? #115

Closed
JS-Aibel opened this issue Sep 10, 2024 · 6 comments
Closed

What are the various types of JSON representations for a submodel? #115

JS-Aibel opened this issue Sep 10, 2024 · 6 comments

Comments

@JS-Aibel
Copy link

JS-Aibel commented Sep 10, 2024

What are the various types of JSON representations for a submodel, and what are their use cases?

API
Why are the https://admin-shell.io/api/v3.0 JSON response for the endpoints
GET/serialization?submodelIds={submodelIdentifier} and GET/submodels/{submodelIdentifier} different?

Package Explorer
Are any of the API endpoints related to the Import/Export submodel from JSON in the Package Explorer?

@StenGruener StenGruener self-assigned this Sep 16, 2024
@StenGruener
Copy link
Collaborator

StenGruener commented Sep 17, 2024

Hi Jon,

not really sure if i understood correctly, but from what we see, the serialization endpoint returns an AAS-environment which consists, among others, of an array of submodels and also concept descriptoins. The one submodel GET response returns only one submodel, whicle you can define the answer based on parameters, e.g., deep or shallow representation of nested contents.

@StenGruener StenGruener removed their assignment Sep 17, 2024
@JS-Aibel
Copy link
Author

JS-Aibel commented Sep 17, 2024

Hi Sten,

Thank you for the reply.
The question came up because of the question eclipse-basyx/basyx-java-server-sdk#423 for the basyx-java-server-sdk AAS Environment.
Since the AAS Environment is following the specification of the AAS Part 2: Application Programming Interfaces, I thought it was better to ask the question here.

Use case where the difference in response has an impact.
When using the BaSyx-Python SDK method read_aas_json_file(), the json from the /submodels/ endpoint will not return any objects in the object store. When using the /serialization endpoint the method work as expected.

Questions

  1. Why is the difference in response breaking the method?
  2. Which of the endpoint’s responses corresponds to Import/Export submodel from JSON in the Package Explorer?

@StenGruener
Copy link
Collaborator

StenGruener commented Oct 2, 2024

Hi, sorry i so dumb to understand what are "object in the object store", are those aasx files?

@JS-Aibel
Copy link
Author

JS-Aibel commented Oct 2, 2024

ObjectStore
The ObjectStore is provided by the BaSyx Python SDK and can be used as a simple in-memory store for multiple AAS and their shell objects. The SDK has methods for serialization and deserialization of AASs.

Use case
Using the methods in the SDK, I tried to read the response from the endpoint GET/submodels/{submodelIdentifier}, but it did not work. However, the GET/serialization?submodelIds={submodelIdentifier} response was properly read by the SDK method.
This use case seems to show that these endpoints give out distinct JSON response structures.

Question
The question boils down to why there are three different JSON structures even though they support the same JSON Schema.

  • GET/submodels/{submodelIdentifier} response
  • GET/serialization?submodelIds={submodelIdentifier response
  • Package Explorer export to JSON

Note: The answer to issue eclipse-aaspe/package-explorer#254 could provide an explanation for the JSON from Package Explorer.

@StenGruener
Copy link
Collaborator

Examples of the differences could be helpful :)

Did you check the REST API (https://app.swaggerhub.com/apis/Plattform_i40/SubmodelRepositoryServiceSpecification/V3.0.2_SSP-001#/Submodel%20Repository%20API/GetSubmodelById)?
image

Is this the "extent" thingy? But i guess i misundestand.

@JS-Aibel
Copy link
Author

JS-Aibel commented Oct 3, 2024

the serialization endpoint returns an AAS-environment which consists, among others, of an array of submodels and also concept descriptoins. The one submodel GET response returns only one submodel

Your first answer was the solution to the problem with the SDK methods.
By wrapping the content from the response GET/submodels/{submodelIdentifier} in a ‘submodels’ array, the SDK method was able to read it. For the JSON from the Package Explorer, it seems to be missing the attribute modelType. I guess this will be answered in eclipse-aaspe/package-explorer#254.

Thank you for the help!

@JS-Aibel JS-Aibel closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants