Page MenuHomePhabricator

Add endpoint for Wikidata-based navigation in Wikipedias
Closed, ResolvedPublic

Description

Based on the discussion in OpenStreetMap mailing list, I would like to propose a new way to open Wikipedia articles - with a Wikidata ID:

https://en.wikipedia.org/w/index.php?wd=Q42  ->  Douglas Adams

This way, Wikidata IDs can be used directly from other systems like OSM, without storing (or dynamically querying) the Wikipedia link. Storing Wikipedia title has proven to be a bad idea due to constant article renaming, especially when disambig pages are left behind.

Alternative: Multilingual redirect

The biggest problem with the above approach is that the external system must know which language of Wikipedia to use. In case of OSM, the "language of the land" is usually a good starting point, but often enough there is no such. So we could allow Wikipedia to dynamically redirect to another language, or better yet, instead of Wikipedia, add the endpoint to Wikidata itself, with a list of language fallbacks:

https://wikidata.org/w/index.php?q=Q42&site=wikipedia&langs=en,fr,ru,zh,de,ja,ANYTHING

This way 3rd party sites can create links to Wikipedia/Wikivoyage/... without much code - simply provide a link, and let Wikipedia open something in the first available language.

Event Timeline

Lydia_Pintscher claimed this task.

This already exists: https://www.wikidata.org/wiki/Special:GoToLinkedPage
You can submit a chain of sites for fallback.

This is awesome, sorry I didn't know about it! Is fallback documented anywhere? (i did try it, and it does work with comma-separated site values)

@Lydia_Pintscher I found that I can specify the list of fallbacks, but can I specify a list + "anything", which doesn't even have to be deterministic? Without it, one would have to generate a full list of all sites with every link - just like we currently have in the WDQS examples page. You don't want that :)

https://www.wikidata.org/wiki/Special:GoToLinkedPage?itemid=Q3669&site=enwiki,ptwiki