MQL: Finding the Wikipedia page for a Freebase Topic

November 27, 2007

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

Tagging demo with Freebase Suggest

November 8, 2007

I whipped up a quick example of tagging with Freebase Suggest.

This is just the client-side user interface. Integration with an existing tagging system is left as an exercise for the reader 😉

Screenshot of Tagging demo