Closed tmtmtmtm closed 2 years ago
wb sparql
reshapes the results JSON, unless the --raw
option is called, and does it by regrouping variables in JSON objects, so that ?item ?itemLabel ?itemAltLabel ?itemType
end up in an object as { item: { value, aliases, type } }
, based on their variable names sharing the same prefix. The case where a variable (?endTimePrecision
) has 2 variables (end
and endTime
) to which it could be associated was not handled: should have been fixed in https://github.com/maxlath/wikibase-sdk/commit/6137621 and published in wikibase-cli v15.16.7
Oh, that's a fun one! I was definitely struggling to figure out why three variables would be problematic. Thanks for the quick fix.
given the following
query.js
:wd sparql query.js
errors with:Running this with
-f csv
works fine.It seems that all three of
?end
,?endTime
, and?endTimePrecision
need to be in the query to make it fail: removing any of the three make it work. I also don't think that it matters that these aren't otherwise referenced in the query: this is a pared-down minimal test-case from a much more elaborate version.