Is there any API in Java to access wikipedia data

倖福魔咒の 提交于 2019-12-17 18:17:26

问题


I want to know: is there any API or a query interface through which I can access Wikipedia data?


回答1:


Mediawiki, the wiki platform that wikipedia uses does have an HTTP based API. See MediaWiki API.

For example, to get pages with the title stackoverflow, you call

http://en.wikipedia.org/w/api.php?action=query&titles=Stackoverflow

There are some (incomplete) Java wrappers around the API - see the Client Code - Java section of the API page for more detail.




回答2:


For the use with Java, try http://code.google.com/p/wiki-java. It is only one class, but a great one!




回答3:


I had the same question and the closest I came to an out-of-the-box solution is bliki, hosted at http://code.google.com/p/gwtwiki/. I also wrote an article at Integrating Stuff to help you get started with it: http://www.integratingstuff.com/2012/04/06/hook-into-wikipedia-using-java-and-the-mediawiki-api/




回答4:


MediaWiki is a free and open-source wiki software. Originally developed by Magnus Manske and improved by Lee Daniel Crocker, it runs on many websites, including Wikipedia, Wiktionary and Wikimedia Commons.[5][6]

There is list of Java libraries that can help you to connect wiki by java code . https://www.mediawiki.org/wiki/API:Client_code#Java

but after use some of them because of their limitations , we try to call REST services from mediawiki directly.



来源:https://stackoverflow.com/questions/1397938/is-there-any-api-in-java-to-access-wikipedia-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!