1

I'm using the MediaWiki API to get the first paragraph of certain Wikipedia articles. Currently the issue I'm having is with terms that have multiple entries in Wikipedia. For example, the term Java brings up the Wikipedia article for the island Java, not the programming language. Is there some parameter that I should use to differentiate between the two?

4

2 回答 2

1

检查类别。文章“Java”属于“大巽他群岛”,文章“Java(编程语言)”属于“C 编程语言家族”、“基于类的编程语言”、“并发编程语言”等。

于 2013-05-29T05:01:40.163 回答
-2

检查http://en.wikipedia.org/w/api.php以获得:

* list=querypage (qp) 

Parameters:
 qppage              - The name of the special page. Note, this is case sensitive
                    This parameter is required
                    One value: Ancientpages, BrokenRedirects, Deadendpages, Disambiguations, DoubleRedirects, Listredirects,
                        Lonelypages, Longpages, Mostcategories, Mostimages, Mostinterwikis, Mostlinkedcategories,
                        Mostlinkedtemplates, Mostlinked, Mostrevisions, Fewestrevisions, Shortpages,
                        Uncategorizedcategories, Uncategorizedpages, Uncategorizedimages, Uncategorizedtemplates,
                        Unusedcategories, Unusedimages, Wantedcategories, Wantedfiles, Wantedpages, Wantedtemplates,
                        Unwatchedpages, Unusedtemplates, Withoutinterwiki

我猜 Mostrevisions 、 Mostlinked 和 Mostcategories 可以帮助你获得一个有意义的页面。

这是一个使用示例:http ://en.wikipedia.org/w/api.php?action=query&list=querypage&qppage=Ancientpages

于 2013-05-28T14:48:51.410 回答