Quantcast

Getting wikipedia language links for a set of wikidata items via generator (in a single query)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Getting wikipedia language links for a set of wikidata items via generator (in a single query)

Bjoern Hassler-3
Hi all,

I'd like to generate a set of wikidata items via a generator, with the listing containing the various associated wikipedia language pages. I think this would essentially be like using wbgetentities with a generator. I guess it's not possible in a single query?

To explain: I can run this query:

<a href="https://ca.wikipedia.org/w/api.php?action=query&amp;prop=langlinks|pageprops|pageterms&amp;ppprop=wikibase_item&amp;generator=geosearch&amp;ggscoord=39.4|2.8&amp;ggsradius=10000">https://ca.wikipedia.org/w/api.php?action=query&prop=langlinks|pageprops|pageterms&ppprop=wikibase_item&generator=geosearch&ggscoord=39.4|2.8&ggsradius=10000

which gives me the langlinks, as well as the wikidata item. 

I'd now like run an equivalent query on wikidata, retrieving all language links. However, I cannot see a way in which a query like

<a href="https://www.wikidata.org/w/api.php?action=query&amp;prop=...&amp;generator=geosearch&amp;ggscoord=39.4|2.8&amp;ggsradius=10000">https://www.wikidata.org/w/api.php?action=query&prop=...&generator=geosearch&ggscoord=39.4|2.8&ggsradius=10000

can be made to include the language links? It's of course possible to get the ids with the above query, and then the language links with a second query:

<a href="https://www.wikidata.org/w/api.php?action=wbgetentities&amp;props=sitelinks&amp;ids=Q1034758|Q11909237|.">https://www.wikidata.org/w/api.php?action=wbgetentities&props=sitelinks&ids=Q1034758|Q11909237|...

Is it possible in one query? I.e. something like

<a href="https://www.wikidata.org/w/api.php?action=wbgetentities&amp;props=sitelinks&amp;generator=geosearch&amp;ggscoord=39.4|2.8&amp;ggsradius=10000">https://www.wikidata.org/w/api.php?action=wbgetentities&props=sitelinks&generator=geosearch&ggscoord=39.4|2.8&ggsradius=10000

Many thanks!
Bjoern

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Loading...