https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
Web browser: --- Bug ID: 54415 Summary: claimit.py: enable claim with the same property, but different value Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: legoktm.wikipedia@gmail.com Classification: Unclassified Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/349/ Reported by: apac1 Created on: 2013-09-15 16:15:03.602000 Subject: claimit.py: enable claim with the same property, but different value Original labels: claimit.py, wikidata, enhancement, python, pywikibotOriginal description: The below can be added to claimit.py to enable adding statements on items with the same property, but different values.
https://github.com/wikimedia/pywikibot-core/blob/master/scripts/claimit.py
:::python
for claim in self.claims: if claim.getID() in item.get().get('claims'): propertytoadd = claim.getID() for valueofproperty in item.claims[propertytoadd]: if valueofproperty.getTarget() == claim.getTarget(): pywikibot.output("item for %s has already property %s with value %s" % (page.title(), propertytoadd, valueofproperty.getTarget())) break else: continue else: pywikibot.output('Adding additional %s --> %s' % (claim.getID(), claim.getTarget())) item.addClaim(claim)
else: pywikibot.output('Adding %s --> %s' % (claim.getID(), claim.getTarget())) item.addClaim(claim)
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- slightly improved version, merged with the new "source" function
:::python
for claim in self.claims: if claim.getID() in item.get().get('claims'): for existingclaimwithproperty in item.claims[claim]: if existingclaimwithproperty.getTarget() == claim.getTarget(): pywikibot.output("item for %s has already property %s with value %s" % (page.title(), claim, existingclaimwithproperty.getTarget())) break else: continue else: pywikibot.output('Adding additional %s --> %s' % (claim.getID(), claim.getTarget())) item.addClaim(claim) source = self.getSource(page.site.language()) if self.source: claim.addSource(self.source, bot=True) # TODO FIXME: We need to check that we aren't adding a # duplicate source
else: pywikibot.output('Adding %s --> %s' % (claim.getID(), claim.getTarget())) item.addClaim(claim) source = self.getSource(page.site.language()) if self.source: claim.addSource(self.source, bot=True) # TODO FIXME: We need to check that we aren't adding a # duplicate source
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
Nemo federicoleva@tiscali.it changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|General |Wikidata
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
--- Comment #2 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 92073 had a related patch set uploaded by Merlijn van Deen: Enable adding statements on items with the same property, but different values.
https://gerrit.wikimedia.org/r/92073
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
Gerrit Notification Bot gerritadmin@wikimedia.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |PATCH_TO_REVIEW
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
Merlijn van Deen valhallasw@arctus.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- Priority|Unprioritized |Low
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
Strainu crangasi2001@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |crangasi2001@yahoo.com Whiteboard| |gci2013 | |https://www.mediawiki.org/w | |iki/Google_Code-In#Candidat | |e_tasks
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
--- Comment #3 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 97198 had a related patch set uploaded by Tholam: Enable claims with the same property, but different value for claimit.py
https://gerrit.wikimedia.org/r/97198
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
--- Comment #4 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 92073 abandoned by Merlijn van Deen: Enable adding statements on items with the same property, but different values.
Reason: One of the GCI students has worked on this: https://gerrit.wikimedia.org/r/#/c/97198/
https://gerrit.wikimedia.org/r/92073
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
--- Comment #5 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 97198 merged by jenkins-bot: Enable claims with the same property, but different value for claimit.py
https://gerrit.wikimedia.org/r/97198
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
xqt info@gno.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|PATCH_TO_REVIEW |RESOLVED CC| |info@gno.de Resolution|--- |FIXED
https://bugzilla.wikimedia.org/show_bug.cgi?id=54415
--- Comment #6 from Merlijn van Deen valhallasw@arctus.nl --- *** Bug 54542 has been marked as a duplicate of this bug. ***
pywikipedia-bugs@lists.wikimedia.org