0

我想获得一个单词的所有维基百科含义的列表。例如,对于单词“bar”,消歧列在http://en.wikipedia.org/wiki/Bar_(disambiguation)中:

  • 酒吧(机构)
  • 甜品吧
  • 潜水吧
  • ...

有什么方法可以从 Wikipedia API 访问来自不同语言的单词的消歧?

对于英语,我认为网址大多采用上述格式(标题中有歧义)。但是对于西班牙语或其他语言,消歧页面的 url 是不同的。

我试过查看列出所有消歧页面的类别页面(例如http://en.wikipedia.org/w/index.php?title=Category:All_article_disambiguation_pages&pagefrom=a),但它没有直接列出所有术语的消歧。

4

1 回答 1

1

Most (all?) Wikipedia editions now have the disambiguator extension installed, meaning that you can access all disambiguation pages from the API:

    api.php?action=query&list=querypage&qppage=DisambiguationPages

There is however a limit on WMF wikis like Wikipedia on the number of results you can retrieve this way, so if you need them all, you have to download a database dump and make the query agains that (in that case, you can read up a bit on the page_props table, and make a SQL query against that).

A second approach is to use WikiData, and query for all pages that is an instance of (P31) Wikimedia disambiguation page (Q4167410).

于 2014-11-01T18:05:04.900 回答