开发者

How do I get all articles about people from Wikipedia?

What would be the easiest way to get all articles about people from Wikipedia? I know I can download a dump of all the pages, but then how do I filter those and get only the ones about pe开发者_如何学编程ople? I need as many as I can get (preferably more than a million) so using any sort of API is probably not an option.


Since articles about people usually contain the Persondata template, you can just search for all articles that contain Persondata. You can find a sample API query for doing just that here:

Does the Wikipedia API support searches for a specific template?


As of 2014 you have another option: Query WikiData for all entities where the property instance of (P31) has the value human (Q5).

Full list of humans: https://www.wikidata.org/wiki/Special:WhatLinksHere/Q5

From that list, filter out any thing that doesn't have a sex or gender (P21), to get rid of pages like “scientist”

This way, you don't need to keep track of what templates are used for people in each and every different language edition (there are 285) of Wikipedia.


If you are going to roll out on your own, basically what you need is to focus is on the "infobox data" in the XML dump.

Reference: http://code.google.com/p/infobox2rdf/

Or you can also checkout the http://www.freebase.com or http://dbpedia.org

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜