Comments (9)
@lenaxus You are right.
the root cause is on this line probably.
@FrankSchnicke Maybe a deep copy and then removing the extra submodelelements
would be a quick fix. I can try to fix it if no one is going to do.
from basyx-java-server-sdk.
@FrankSchnicke you can assign it to me, I will raise a PR.
from basyx-java-server-sdk.
The issue is fixed and a new SNAPSHOT version was uploaded to DockerHub. Thanks again for pointing this out!
from basyx-java-server-sdk.
However, what would be your suggestion for deep cloning? AAS4j doesn't offer any copy constructor, nor override clone method. I think there should be such a feature, when mutation is allowed and the structure is so complex. It will be difficult to keep track of these mutations.
So now the easy approach would be to serialize to JSON, and get back a new object again, which is not the most efficient way.
from basyx-java-server-sdk.
Thank you very much for pointing out this issue.
@mhrimaz : Currently the only way of creating a deep copy is serialization and deserialization, e.g., to JSON. However, we're planning on adding a deep copy function to AAS4J. Would you like to raise a PR? Otherwise, we will take a look at this and fix it.
from basyx-java-server-sdk.
@mhrimaz are you still interested in doing this PR? If yes, can you estimate until when the PR will be available?
from basyx-java-server-sdk.
@FrankSchnicke Yes.
Submodel to Json serialization was clear, but I am looking for a way to serialize json to Submodel. (for deep cloning)
If you have a hint here, I appreciate it, otherwise, I have to look in other places in the code to find a way for it.
from basyx-java-server-sdk.
You can use the readReferable method of AAS4J for this.
from basyx-java-server-sdk.
Exactly tried that:
Submodel submodelDeepCopy = new JsonDeserializer().readReferable(submodelAsJSON, Submodel.class);
but getting an error:
com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve subtype of [simple type, class org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement]: missing type id property 'modelType' (for POJO property 'submodelElements')
However, I am pretty sure my payload is correct, but I have to debug it further to spot the problem.
from basyx-java-server-sdk.
Related Issues (20)
- Invoking /shells with invalid asset ids returns 500 HOT 3
- BaSyx AAS Environment Component - Cant´t post new SubmodelElement in existing SubmodelElementColletion HOT 8
- Improvements on BaSyx delegation feature HOT 1
- Unable to Retrieve AAS from MongoDB HOT 3
- Incosistent naming of Enums in openAPI-spec and returned bodies HOT 6
- No MQTT Events send when changing MLPs HOT 5
- No MQTT events for PUT-Requests? HOT 6
- Unable to retrieve list of AAS Identifiers from MongoDB in Discovery HOT 3
- cant connect my aasx file to the registry HOT 1
- Issue with Invokable Operation for File Input in Submodel HOT 4
- Bug: basyx.aasenvironment+MongoDB stores binaries in Memory anyways (and by extension basyx.aassubmodelregitry as well i guess) HOT 3
- Issue : Unexpected Error 500 Occurred After using Blob input HOT 1
- Discovery service startup error when starting with MongoDB instead of InMemory HOT 2
- Invoking /shells?cursor=x returns 500 HOT 2
- Invoking /shells/$reference returns 400 HOT 2
- Problem with Adding DataBridge to Docker-Compose File HOT 4
- Submodel Repository returns empty embeddedDataSpecificatios for SubmodelElements HOT 1
- Dependency to license-tool-plugin:1.1.1-SNAPSHOT makes it hard to build out-of-the-box HOT 6
- move org.eclipse.digitaltwin.basyx.core.LoggingPropertySourceLoader to new artifact basyx.springcore - would help to reduce dependencies to basyx.core HOT 1
- SubmodelRepository Test Suite - AAS Instances
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from basyx-java-server-sdk.