如何从维基百科获取有关人物的所有文章?

发布于 2024-09-29 04:02:42 字数 115 浏览 0 评论 0原文

从维基百科获取有关人物的所有文章的最简单方法是什么?我知道我可以下载所有页面的转储,但是如何过滤这些页面并仅获取有关人员的页面?我需要尽可能多的资源(最好超过一百万),因此使用任何类型的 API 可能都不是一个选择。

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 people? I need as many as I can get (preferably more than a million) so using any sort of API is probably not an option.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

蓝礼 2024-10-06 04:02:42

由于有关人物的文章通常包含 Persondata 模板,因此您只需搜索包含 Persondata 的所有文章即可。您可以在此处找到用于执行此操作的示例 API 查询:

维基百科 API 是否支持搜索特定模板?

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?

别在捏我脸啦 2024-10-06 04:02:42

自 2014 年起,您还有另一个选择:查询 WikiData 属性 实例 (P31) 的值为 人类 (Q5)

完整的人类列表:https://www.wikidata.org/wiki/Special:WhatLinksHere/ Q5

从该列表中过滤掉任何没有性别的内容或性别 (P21),摆脱像“科学家”这样的页面

,这样,您就不需要跟踪每个不同语言版本中的人员使用的模板(有是维基百科的285)。

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.

下雨或天晴 2024-10-06 04:02:42

如果您要自己推出,基本上您需要关注的是 XML 转储中的“infobox 数据”。

参考:http://code.google.com/p/infobox2rdf/

或者您也可以查看 http://www.freebase.comhttp://dbpedia.org

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文