maxlath/wikibase-sdk

Add feature: Simplify multiple entities at once

palancana opened this issue · 5 comments

It may be useful in some situations to just simplify a bunch of entities all at the same time, so after using wdk.getEntities(['Q1', 'Q2', 'Q3', ..., 'Q123']) you can simplify them at once instead of going one by one with wdk.simplify.entity(entity).

yes! wdk.simplify.entities? would you do a PR on that?

I'm not able to do that now (my technical knowledge is still not that good and my time is now very short) but I will try in the future if it is not implemented!

braco commented

This is just sugar for results.map(wdk.simplify.entity)?

the typical API response is an object, not an array, so that could be sugar for

Object.keys(results).reduce((obj, key) => {
  obj[key] = wdk.simplify.entity(results[key])
  return obj
}, {})

or equivalent

added to v5.12.0, see doc