Help Center » Developing Applications » The MQL Cookbook » Wikipedia article text

Wikipedia article text

Freebase doesn't store wikipedia articles.  Freebase provides the wikipedia key so that you can get the article from wikipedia.

For example.

/topic/en/radiohead has property "/wikipedia/topic/en_id" : "38252"

Which allows you to fetch:
http://en.wikipedia.org/wiki/index.html?curid=38252

wikipedia has several ways to get their full textttp://en.wikipedia.org/wiki/index.html?curid=38252&action=render

More options are available via their API.
http://en.wikipedia.org/w/api.php but I'm not sure how to get nice formatted html out of it (meaning deal with all that wiki
formatting)

e.g.

http://en.wikipedia.org/w/query.php?what=content&format=xmlfm&titles=radiohead

change xmlfm to foo and it will give you the options.

 

note: not all freebase topics have an equivalent wikipedia article
(one can consider freebase topics a superset of wikipedia articles) so
your code might handle the case where there is no wikipedia article,
in which case you might look to see if the freebase article exists:

{
"/common/topic/alias" : [],
"/common/topic/article" : {
"id" : null
},
"id" : "/topic/en/radiohead",
}

 

Recent Discussions about Wikipedia article text

There are no conversations on this topic. Would you like to start one?

Start the Discussion »