wikibase-sdk
wikibase-sdk copied to clipboard
Optionally reduce simplified data
Add an option to further reduce data on simplifiation by
- removal of empty arrays and objects such as
"references": [], "qualifiers": {}" - making single-element arrays simple values (e.g.
"P31": "Q5"instead of"P31": ["Q5"])
This reduced format is better suitable for human inspection and reuse in edit-entity (see https://github.com/maxlath/wikidata-cli/issues/63).
I don't think this kind of simplification is a good thing, we should be tolerant on the input, but consistent on the output: having variable claims values depending on the number of values means that you don't know what you get. For instance, before being able to do something like entity.claims.P31.map(someFunction) you need to first check that entity.claims.P31 is an array