Javadoc link

 

[ service actualy in debug state for some fixes ( quantities ) ]

Mostly copy/paste from Beetlejuice blog post : http://myrobotlab.org/content/wikidatafetcher

This service grab data from wikis website ( for now wikidata )

wikidata store data by entities with an ID , by exemple, Adam Sandler have the ID Q132952 .

each entity contain several elements :

To use wikiDataFetcher , you will need an ID for the properties , but not for the label . the better thing is to show you a demo file ! see at the bottom of this post !

Here you can use french or english ID database for MAP

https://github.com/MyRobotLab/inmoov/blob/develop/InMoov/system/bdd/WIK…

https://github.com/MyRobotLab/inmoov/blob/develop/InMoov/system/bdd/WIK…

There is a lot of possibily with this service ; It's possible to use it with AIML so when the bot don't know the answer, it can have a look on the web to find it , wikidata is multilingual so the description can be returned in english, but also in french, italian, spanish ...

Example code (from branch develop):
#########################################
# WikiDataFetcher.py
# description: used as a general template
# more info @: http://myrobotlab.org/service/WikiDataFetcher
#########################################
# start the service
wiki = Runtime.start("wikiDataFetcher", "WikiDataFetcher")
wiki.setWebSite("enwiki")
wiki.setLanguage("en")
 
print(wiki.getDescription("halloween"))
print(wiki.getDescription("empire state building"))
print(wiki.getDescription("the pyramids"))
print(wiki.getDescription("dog"))
 
# french crawl
wiki.setWebSite("frwiki")
wiki.setLanguage("fr") 
print (u"c est quoi un éléphant  : " + wiki.getDescription(u"éléphant"))
Example configuration (from branch develop):
!!org.myrobotlab.service.config.ServiceConfig
listeners: null
peers: null
type: WikiDataFetcher