maxlath / wikibase-sdk

JS utils functions to query a Wikibase instance and simplify its results
MIT License
325 stars 47 forks source link

Support for tabular data #79

Open mshd opened 2 years ago

mshd commented 2 years ago

Could you add a feature to support tabular data. (example)

Would be nice if P4179 could get the data directly.

maxlath commented 2 years ago

Tabular data is already supported, in the sense that the functions simplify.claims and such will be be able to simplify the claim and give you just the file name (ex: Data:Population_FR_Q117517.tab), but it doesn't give you a way to retrieve that data indeed. We could have a function like getImageUrl, which given a file name returns the URL to fetch it (in the case of media files, something like https://commons.wikimedia.org/wiki/Special:FilePath/Peredot.jpg?width=250), but I couldn't find the URL that would need to be generated: is there an API endpoint to retrieve the raw data file?