Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally reduce simplified data #40

Open
nichtich opened this issue Dec 23, 2018 · 1 comment
Open

Optionally reduce simplified data #40

nichtich opened this issue Dec 23, 2018 · 1 comment

Comments

@nichtich
Copy link
Contributor

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 maxlath/wikibase-cli#63).

@maxlath
Copy link
Owner

maxlath commented Jan 2, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants