Given that the page's Wikidata ID has been become de facto on of the main identifiers for Wikipedia pages, it is really useful to have ease access to that ID. Currently, there are three ways to do this (please complete the list if you need more):
(1) querying the wb_items_per_site table in the wikidatawiki on MariaDB, or
(2) through the sitelinks on Wikidata Json dumps.
(3) using page_props table for a specific wiki (its wikibase_item rows give the local page IDs corresponding to a Wikidata ID and vice versa, cf. T215616#4945911)
In the first two cases, the triplet is {WikidataId, wiki, Page_Title}, for example {Q298, enwiki, Chile}. Therefore, for any other information about that page, a join on page_title is needed. Considering that page_titles might change, and also that joining by strings might create some problems depending on the language, having the page Id would be also useful.
For example, if now I want to know how many revisions have the Q298 in each wiki, I would need first to query wikidatawiki.wb_items_per_site for Q298, and next join by page title in each wiki_db.
We should find and schema that make these kind of tasks easier.
UPDATE:
- @JAllemandou suggested using sitelinks instead of wb_items_per_site table. I'm exploring if these two methodologies returns the same results.
- I've updated the task to describe a more general problem: how to link content across wikis.