Replies: 3 comments 3 replies
-
IT should be possible separating the nested levels with a dot, e.g.: |
Beta Was this translation helpful? Give feedback.
-
I sent this one
and got empty result When I am using my own implementation the service returns what is expected.
E.g. I explicitly define that @id should be found at index = 0 (using [0]) of the json array and use this info to construct the SQL query. |
Beta Was this translation helpful? Give feedback.
-
Yes indeed Opened an issue |
Beta Was this translation helpful? Give feedback.
-
We use EDC for our project and we create assets like the following
The asset is saved in the respective postgres tables. For example ms:cost is saved in edc_asset_property using two columns
property_name and property_value.
property_name = "http://w3id.org/meta-share/meta-share/cost"
and property_value = "{"http://w3id.org/meta-share/meta-share/amount":[{"@value":998.01}],"http://w3id.org/meta-share/meta-share/currency":[{"@id":"http://w3id.org/meta-share/meta-share/euro"}]}"
My question is how (based on the current queryAssets endpoint) someone can create queries for the such cases where
property_value is a JSON with some uknown structure. For example how I can ask for the assets that
property_name = "http://w3id.org/meta-share/meta-share/cost"
and in the respective property_value http://w3id.org/meta-share/meta-share/currency points to
http://w3id.org/meta-share/meta-share/euro via @id.
I read the source code and seems that this is not possible to create a query that somehow expresses the fact that we are searching
in this path http://w3id.org/meta-share/meta-share/currency -> @id
Is this true or do I miss something?
For this reason we are creating our own version of QuerySpec which would allow to write such queries.
Also we are creating the respective code that gets the new QuerySpec and creates the appropriate queries using PG JSON operators.
https://www.postgresql.org/docs/9.5/functions-json.html
Beta Was this translation helpful? Give feedback.
All reactions