Hoi, Does anyone have a script that will give the Wikidata ID when a Wikipedia article name is given ?
The script should be preferably in PHP. Thanks, Gerard
Hey,
$store = Wikibase\StoreFactory::getStore(); $numericId = $store->newSiteLinkCache()->getItemIdForLink( $globalSiteId, $pageTitle );
Cheers
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. --
Someone mentioned https://github.com/Tpt/wikibase-api-php in #wikimedia-wikidata a while back. -- Legoktm
On Mon, Feb 18, 2013 at 12:11 PM, Gerard Meijssen <[email protected]
wrote:
Hoi, Does anyone have a script that will give the Wikidata ID when a Wikipedia article name is given ?
The script should be preferably in PHP. Thanks, Gerard
Wikidata-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-l
On 18.02.2013 19:11, Gerard Meijssen wrote:
Hoi, Does anyone have a script that will give the Wikidata ID when a Wikipedia article name is given ?
The simplest way by far is Special:ItemByTitle:
will redirect to
https://www.wikidata.org/wiki/Q72250
which references
https://en.wikipedia.org/wiki/Wau_Holland
Alternatively, you can use the API:
Note that "title" in the output is the item ID (which is also the title of the wikidata page).
hth -- daniel