MQL: Finding the Wikipedia page for a Freebase Topic

Freebase contains many articles mined from the Wikipedia. For example, this page about Edinburgh.

You might want to show the Wikipedia page in your own web application. Given the Freebase topic ID, in this case /en/edinburgh

This MQL query will return the Wikipedia ‘curid’

[{
"id" : "/en/edinburgh",
"key" : [{
"namespace" : "/wikipedia/en_id",
"value" : null
}]
}]

Run in Query Editor

Result:
{
"code":"/api/status/ok",
"result":[{
"id":"/en/edinburgh",
"key":[{
"namespace":"/wikipedia/en_id",
"value":"9602"
}]
}]
}

The Wikipedia URL is then:
http://en.wikipedia.org/wiki/index.html?curid=9602

Update: You can find the Wikipedia article name + all the redirect names with this query but as far as I know there’s no way to distinguish between redirects and the current article name.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: