[Wikidata-l] Wikidata and PWB
Finally the bug is solved. you can get and set items on wikidata via PWB At first you must define a wikidataPage and these are methods you can use. I'll try to expand and make more methods but i don't know any and your help will be very useful: Supports the same interface as Page, with the following added methods: setitem : Setting item(s) on a page getentity: Getting item(s) of a page these examples worked for me: site=wikipedia.getSite('wikidata',fam='wikidata') page=wikipedia.wikidataPage(site,"Helium") text=page.getentity() page.setitem(summary=u"BOT: TESTING FOO",items={'type':u'item', 'label':'fa', 'value':'OK'}) page.setitem(summary=u"BOT: TESTING GOO",items={'type':u'description', 'language':'en', 'value':'OK'}) page.setitem(summary=u"BOT: TESTING BOO",items={'type':u'sitelink', 'site':'de', 'title':'BAR'}) Cheers! -- Amir ___ Wikidata-l mailing list Wikidata-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-l
Re: [Wikidata-l] Wikidata and PWB
2012/12/10 Amir Ladsgroup > Finally the bug is solved. you can get and set items on wikidata via PWB > Thanks, Amir, you are the king!!! > > > page=wikipedia.wikidataPage(site,"Helium") > text=page.getentity() > This one works, but I don't understand. I tried with Q#... previously that does not work. But what is the title then? Always English? Where is the Q number? How can I find an item from another language? -- Bináris ___ Wikidata-l mailing list Wikidata-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-l
Re: [Wikidata-l] Wikidata and PWB
2012/12/10 Amir Ladsgroup : > Finally the bug is solved. you can get and set items on wikidata via PWB Woo hoo! http://i.imgur.com/0D00v.gif -- Luca "Sannita" Martinelli http://it.wikipedia.org/wiki/Utente:Sannita ___ Wikidata-l mailing list Wikidata-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-l
Re: [Wikidata-l] Wikidata and PWB
There is no need of using q### anymore. For other languages it's not possible for now but i gonna add it soon On 12/11/12, Luca Martinelli wrote: > 2012/12/10 Amir Ladsgroup : >> Finally the bug is solved. you can get and set items on wikidata via PWB > > Woo hoo! http://i.imgur.com/0D00v.gif > > -- > Luca "Sannita" Martinelli > http://it.wikipedia.org/wiki/Utente:Sannita > > ___ > Wikidata-l mailing list > Wikidata-l@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikidata-l > -- Amir ___ Wikidata-l mailing list Wikidata-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-l
Re: [Wikidata-l] Wikidata and PWB
How can the bot make the difference is two itemes have the same label? I think the Q number is the only primary key. Anyway, I think the number is useful and the bot should have the ability to handle it. Can you provide a piece of code that searches for an item and creates it only if it does not exist? 2012/12/10 Amir Ladsgroup > There is no need of using q### anymore. > For other languages it's not possible for now but i gonna add it soon > > > -- Bináris ___ Wikidata-l mailing list Wikidata-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-l
Re: [Wikidata-l] Wikidata and PWB
as my bot is currently running on some parts of the pywikipediabot framework and the pywikidata framework it should be possible to return the saved item if you save it, there for the id has should be saved as some usere e.g. want the bots to stop before milestones liki q1.000.000, my bot also e.g. searches trough all disambiguation pages and saves the items in a list (with the id) so if I run the bot a second time all listed items get skipped and only new items will be treated. Is it currently possible to request 50 items at one apirequest? or 500 if you have botrights? this is also usefull so it schould be possible to submit a list of items, or better a dictionary of "lang" : "Interwikilink" or a list of IDs. This is whats possible with my bot. A feature i would like to have, would be search for Labels, Description in a given language, I am not sure if "opensearch", "languagesearch" or "wbsearchentities" should be used for this. Sk!d (Sk!dbot) On Tue, Dec 11, 2012 at 7:09 AM, Bináris wrote: > How can the bot make the difference is two itemes have the same label? I > think the Q number is the only primary key. > Anyway, I think the number is useful and the bot should have the ability > to handle it. > Can you provide a piece of code that searches for an item and creates it > only if it does not exist? > > > 2012/12/10 Amir Ladsgroup > >> There is no need of using q### anymore. >> For other languages it's not possible for now but i gonna add it soon >> >> >> > -- > Bináris > > ___ > Wikidata-l mailing list > Wikidata-l@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikidata-l > > ___ Wikidata-l mailing list Wikidata-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-l