Closed ecow closed 3 years ago
Hi @ecow -- yes that definitely looks like a bug. Thanks for reporting this, I will look into it.
It looks like transformations work, BUT...
Transformer always works with json, so it breaks when the content-type is not json. Granted, it should break in a more graceful way.
If you set the response content type to application/json
it should work fine:
Does this work for you @ecow?
I'll leave his issue open, until more graceful handling of json content type is fixed.
Hi, @c-martinez . even if using header "Accept: application/json' , my test fails with the simple decoration:
#+ transform: {
#+ "label": "?label"
#+ }
Instead the decoration
#+ transform: {
#+ "label": "?label",
#+ "$anchor": "label"
#+ }
works well, producing something like:
[
{
"label": {
"language": "it",
"value": "string1"
}
},
{
"label": {
"language": "it",
"value": "string2"
}
}
]
Is "$anchor" mandatory?
I would like to produce just a simple structure like:
[ "string1", "string2" ]
How to do it ? (if possible)?
Yes, I think the $anchor
is mandatory.
I'm not an expert on transformer syntax, but maybe check their documentation. Otherwise, perhaps @pasqLisena might be able to shed some light.
Hi, yes the software requires an $anchor
or an id
field.
You can eventually mark it in this way:
transform: {
"label": "?label$anchor"
}
Hi @ecow -- I just wanted to check with you if @pasqLisena's suggestion helped you solve your problem and if I can close this issue?
Yes, you can close these issue but docs should be updated. Thank you.
Is the transform query decorator broken?
It returns 500 Internal Server Error both in my local installation (docker grlc:latest connected with a blazegraph sparql endpoint) and in the the official example ( http://grlc.io/api-git/CLARIAH/grlc-queries/#/default/get_transform )