You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider a ResourceShape ObjectType that has an inlined property "targets", as examplified below.
Creating such an insstance (with inlined resources) works fine with LyoStore.
However, when calling getResource() on the uri http://localhost:8080/oslc-server1/oslc/pm/ObjectType/12, the properties of the inlined AnotherObjectType resources are not returned as part of the request.
That is, getResource() does not consider the resourceShape properties of ObjectType in its query.
This an be easily seen in the code of getResource() which is too simple to deal with this scenario.
A very simple workaround is to do another getResource() call on the set of target properties, to construct the complete instance.
//Individually get the set of inlined resources the aResource points to.
Set<AnotherObjectType> inlinedTargets = new HashSet<>();
for (AnotherObjectType obj : aResource.getTargets()) {
AnotherObjectType r = store.getResource(...., obj.getAbout(), AnotherObjectType.class);
inlinedTargets.add(r);
}
aResource.setTargets(inlinedTargets);
The text was updated successfully, but these errors were encountered:
Consider a ResourceShape ObjectType that has an inlined property "targets", as examplified below.
Creating such an insstance (with inlined resources) works fine with LyoStore.
However, when calling getResource() on the uri http://localhost:8080/oslc-server1/oslc/pm/ObjectType/12, the properties of the inlined AnotherObjectType resources are not returned as part of the request.
That is, getResource() does not consider the resourceShape properties of ObjectType in its query.
This an be easily seen in the code of getResource() which is too simple to deal with this scenario.
A very simple workaround is to do another getResource() call on the set of target properties, to construct the complete instance.
The text was updated successfully, but these errors were encountered: