User talk:Legoktm/June 2013
This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
I'm planning to switch to the Pywikipedia-rewrite branch, but can't find a quick guide/overview of the differences with the Pywikipedia trunk (mainly about the standard configuration and the write access on Wikidata). Could You Please insert it somewhere? --Ricordisamoa 19:07, 24 April 2013 (UTC)
- Well first, you probably don't want to use my personal version, it's super hacked up and overrides some basic safety features. You should checkout the version from Wikimedia SVN [1]. There are instructions on what some of the differences are in README-conversion.txt. I've been meaning to write up some real documentation, but for now there are some autogenerated docs here. Some super brief docs about Wikidata usage are here. Legoktm (talk) 15:59, 26 April 2013 (UTC)
- Thanks a lot. --Ricordisamoa 17:08, 26 April 2013 (UTC)
- My bot is running fine now, but ... do You know a simple way to set references (maybe before calling
addClaim
, but it doesn't matter)? --Ricordisamoa 19:10, 27 April 2013 (UTC)- Please? --Ricordisamoa 22:13, 30 April 2013 (UTC)
- Sorry, missed your question. Here's a quick code snippet:
- Please? --Ricordisamoa 22:13, 30 April 2013 (UTC)
import pywikibot
repo = pywikibot.Site('wikidata', 'wikidata').data_repository()
claim = pywikibot.Claim(repo, 'p1') # Something
claim.setTarget(pywikibot.ItemPage(repo, 'q1')) # Some target
reference = pywikibot.Claim(repo, 'p2') # Source property
reference.setTarget(pywikibot.ItemPage(repo, 'q2')) # Source target
for item in gen: # Pretend we're adding a claim to a ton of pages
item.addClaim(claim, bot=True) # Add the claim
claim.addSource(reference, bot=True) # Add the source to the claim we just created
- You can of course create the reference on the fly, but that would be created in the same way. Legoktm (talk) 22:39, 30 April 2013 (UTC)
- Okay, there's only the last little problem...: after setting "taxon level" (with the proper reference) and "taxon name", it fails to add the reference for the latter claim... Any ideas? Could it depend on the datatype, or is it a known bug? --Ricordisamoa 10:23, 1 May 2013 (UTC)
- Can I see your code and any error it throws? Legoktm (talk) 18:11, 1 May 2013 (UTC)
- What should I post, in what form, and where? --Ricordisamoa 21:32, 1 May 2013 (UTC)
- Can I see your code and any error it throws? Legoktm (talk) 18:11, 1 May 2013 (UTC)
- Okay, there's only the last little problem...: after setting "taxon level" (with the proper reference) and "taxon name", it fails to add the reference for the latter claim... Any ideas? Could it depend on the datatype, or is it a known bug? --Ricordisamoa 10:23, 1 May 2013 (UTC)
Hi, same problem. Here the code:
import pywikibot
wd = pywikibot.Site('wikidata','wikidata').data_repository()
item = pywikibot.ItemPage(wd,'Q4115189')
item.get()
reference=pywikibot.Claim(wd,'p143') # "imported from"
reference.setTarget(pywikibot.ItemPage(wd,'Q11920')) # "Wikipedia in italiano"
claim = pywikibot.Claim(wd,'p161') # first Property
claim.setTarget(pywikibot.ItemPage(wd,'Q4547')) # Property value
item.addClaim(claim) # add claim
claim.addSource(reference) # add source
claim = pywikibot.Claim(wd,'p161') # second Property
claim.setTarget(pywikibot.ItemPage(wd,'Q134895')) # Property value
item.addClaim(claim) # add claim
claim.addSource(reference) # add source
and error message.
D:\Wikipedia\Py2\pywikibot>python WDTest.py
Sleeping for 8.5 seconds, 2013-05-04 16:49:37
Sleeping for 8.3 seconds, 2013-05-04 16:49:47
Sleeping for 8.4 seconds, 2013-05-04 16:49:57
Traceback (most recent call last):
File "WDTest.py", line 18, in <module>
item.addClaim(claim) # add claim
File "C:\Python27\lib\site-packages\pywikipediabot-2.0alpha-py2.7.egg\pywikibot\page.py", line 2531, in addClaim
self.repo.addClaim(self, claim, bot=bot)
File "C:\Python27\lib\site-packages\pywikipediabot-2.0alpha-py2.7.egg\pywikibot\site.py", line 3392, in addClaim
data = req.submit()
File "C:\Python27\lib\site-packages\pywikipediabot-2.0alpha-py2.7.egg\pywikibot\data\api.py", line 357, in submit
% (mod, result["warnings"][mod]["*"]))
KeyError: '*'
D:\Wikipedia\Py2\pywikibot>
Thanks --ValterVB (talk) 15:03, 4 May 2013 (UTC)
- I will try to get a patch into PWB, but my time is currently limited due to IRL activities. Legoktm (talk) 12:13, 12 May 2013 (UTC)
- For now I have solved with multiple item.get() --ValterVB (talk) 13:04, 12 May 2013 (UTC)
- And more than a month later I finally tracked it down and fixed it. Use pyrev:r11686, and vote for a fix to bugzilla:49978. Legoktm (talk) 21:39, 21 June 2013 (UTC)
- For now I have solved with multiple item.get() --ValterVB (talk) 13:04, 12 May 2013 (UTC)
Array Properties
Hello, I understand you have currently no time to dedicate to Wikidata. Should I move my requests on User talk:Legobot/properties.js/requests to Wikidata:Bot requests, or do think you'll be able to run again requests soon? Thanks. Ayack (talk) 10:08, 27 May 2013 (UTC)
- Hi, I apologize for the downtime. I should be ready to go with a much more intelligent system by Monday or Tuesday. Legoktm (talk) 21:40, 31 May 2013 (UTC)
- Great! Thanks! Ayack (talk) 13:23, 1 June 2013 (UTC)
- (Sorry, I'm harassing you again.) Ayack (talk) 09:45, 12 June 2013 (UTC)
- I've finished a massive rewrite of the script, and am now debugging it. I expect that it will be ready to go live on Tuesday. Legoktm (talk) 04:52, 17 June 2013 (UTC)
- Thanks by the way!!! Ayack (talk) 16:26, 21 June 2013 (UTC)
- I've finished a massive rewrite of the script, and am now debugging it. I expect that it will be ready to go live on Tuesday. Legoktm (talk) 04:52, 17 June 2013 (UTC)
- (Sorry, I'm harassing you again.) Ayack (talk) 09:45, 12 June 2013 (UTC)
- Great! Thanks! Ayack (talk) 13:23, 1 June 2013 (UTC)
Invalid GND type
Hi, strange edits: [2], [3], [4], [5], [6]. — Ivan A. Krestinin (talk) 08:00, 1 June 2013 (UTC)
rfd_done-er.py
I've forked your script!
- Improvements
- it uses
{{Deleted|admin=who}}
- checks if "who" is on User:BeneBot*/RfD-optin
- counter of marked requests and descriptive edit summary
- works also with the last RfD on the page ;-)
--Ricordisamoa 17:23, 1 June 2013 (UTC)
- I'm currently using it for SamoaBot 31. --Ricordisamoa 17:25, 1 June 2013 (UTC)
Wikidata weekly summary #61
- Discussions
- Please use the next week to review the discussions about sourcing of statements (d:Wikidata:Requests for comment/References and sources and Discussion on the Project Chat)
- Events/Press
- Arts, Humanities and Complex Networks
- SemTechBiz
- WMF metrics and activities meeting
- "Exakter und aktueller" Bessere Daten für Wikipedia durch Wikidata
- Other Noteworthy Stuff
- Large donation by Yandex for further development of Wikidata (press coverage here and here among others)
- en:Template:Infobox road and simple:Template:Infobox road now have the ability to use Wikidata for the map field
- Denny writes about Wikidata and the truth
- Average edits per page has passed 4
- Did you know?
- Newest properties: basionym (P566), hangingwall (P567), footwall (P568), date of birth (P569), date of death (P570), foundation/creation date (P571), date of scientific description (P574), discovery date (P575), date of dissolution (P576), date of publication (P577), Sandbox-TimeValue (P578), IMA status (P579), start date (P580), end date (P582), as of (P585), IPNI author ID (P586), MMSI (P587), coolant (P588), point group (P589), GNIS (P590), EC Number (P591), ChEMBL (P592), Homologene ID (P593), Ensembl ID (P594), IUPHAR ID (P595), in the direction of (P596), WTA ID (P597), commands (P598), ITF ID (P599), Wine AppDB-ID (P600), MedlinePlus ID (P604), NUTS (P605), first flight (P606)
- Newest task forces: Catalunya task force
- Development
- Worked on globe coordinate editing
- Reviewed and merged code for SetSiteLink special page
- EditEntity API refactoring (Info: EditEntity API’s EXCLUDE parameter will be dropped - see here)
- First steps towards being able to add sitelinks for the first sister-project (WikiVoyage)
- Improved the Travis CI continuous integration setup
- Made the DataValue component installable via Composer
- Open Tasks for You
- Help fix formatting and value issues for a property
- Respond to a "Request for Comment"
- Hack on one of these
Have you remembered...
...to remove your flood flag? :-) --Ricordisamoa 02:03, 12 June 2013 (UTC)
- Oops, thanks for the reminder. Legoktm (talk) 02:48, 12 June 2013 (UTC)
New message
You can remove this notice at any time by removing the {{Talkback}} or {{Tb}} template.
--Ricordisamoa 01:58, 14 June 2013 (UTC)
- Vogone has un-closed it for now, I'll comment when I'm less busy tomorrow. Legoktm (talk) 04:52, 17 June 2013 (UTC)
Wikidata weekly summary #62
- Noteworthy Stuff
- Geocoordinates can now be entered in Wikidata and language links can now be edited without JavaScript
- The folks at OCLC did a great intro video to Wikidata and VIAF/authority files
- And here's some interesting analysis on the most unique Wikipedias according to Wikidata
- Magnus updated his tool to add missing properties to an item
- Did you know?
- Newest properties: battle/war (P607), exhibition history (P608), terminus location (P609), exhibition history (P608), terminus location (P609), highest point (P610), religious order (P611), mother house (P612), OS grid reference (P613), CHRC (P616), yard number (P617), source of energy (P618), spacecraft launch date (P619), spacecraft landing date (P620), spacecraft decay date (P621), spacecraft docking/undocking dates (P622), crew photo (P623), guidance system (P624), coordinate location (P625), Sandbox-GeoCoordinateValue (P626), IUCN-ID (P627)
- If you're interested in a specific topic then the task forces are a good place to find like-minded people. Can't find one for your interest? Start one!
- Development
- More progress on supporting links to sisterprojects
- Fixing issues with geocoordinate datatype that popped up after deployment
- Selenium tests for time and geocoordinate interface
- EditEntity Refactoring (added parameter “new”)
- Open Tasks for You
- Help fix formatting and value issues for a property
- Respond to a "Request for Comment"
- Hack on one of these
claimit.py problem
Hello, following line in claimit.py:
pywikibot.output('Adding %s --> %s' % (claim.getID(), claim.getTarget().getID()))
doesn't works with string type property because "claim.getTarget().getID()" doesn't exists. Is it correct? --Sbisolo (talk) 10:50, 19 June 2013 (UTC)
- Thanks, fixed in pyrev:11675. Legoktm (talk) 21:14, 19 June 2013 (UTC)
Croix de guerre 1939–1945
Hi! I notice legobot has claimed Vire (Q220684) as having received the Croix de guerre, but this seems to be incorrect. The award is given only to people, as far as I know. Danrok (talk) 16:29, 19 June 2013 (UTC)
- It's correct. Some cities have also received this award. See fr:Catégorie:Ville titulaire de la Croix de guerre 1939-1945. Ayack (talk) 18:35, 19 June 2013 (UTC)
- Ok thanks! I see it now, in the French articles. Just no mention of it on enwiki. Danrok (talk) 20:49, 19 June 2013 (UTC)
Testwiki main page
Hi!
Can you do something to the testwiki's Hungarian main page be Wikidata:Main Page/hu? Thanks,
Tacsipacsi (talk) 13:54, 21 June 2013 (UTC)
Item showing as deleted
Seems to be something not quite right with a number of claims, this one being an example: Polissoir des Sept coups d'épée (Q3394292).
The instance of (P31) claim item is displayed as deleted. Perhaps, because it is prefixed with a lowercase q. Danrok (talk) 13:56, 21 June 2013 (UTC)
- No, it's a red banner at the top of the page about this ("ATTENTION: We are currently experiencing technical difficulties, causing properties and items to appear deleted in statements. They are not, and there is no lost data; please hang on while this is repaired."). Tacsipacsi (talk) 14:01, 21 June 2013 (UTC)
- Shame the red banner is also broken, for me at least. All I see is a red flicker for a fraction of a second. Danrok (talk) 15:47, 21 June 2013 (UTC)
- Weird, well the notice is at MediaWiki:Sitenotice. See also Wikidata:PC#.22Deleted_property.22_and_.22Deleted_item.22. Legoktm (talk) 19:51, 21 June 2013 (UTC)
- Shame the red banner is also broken, for me at least. All I see is a red flicker for a fraction of a second. Danrok (talk) 15:47, 21 June 2013 (UTC)
Wikidata weekly summary #63
- Discussions
- Final vote on the "Guidelines for sourcing statements" till June 24.
- Work started on a policy regarding information about living people
- Feedback needed on a proposal by the development team for how to support Wiktionary
- RfC about sockpuppetry guidelines
- RfC about personal names
- Events/Press
- Did you know?
- Newest properties: E number (P628), edition of (P629), Paris city digital code (P630), structural engineer (P631), cultural properties of Belarus reference number (P632), Répertoire du patrimoine culturel du Québec identifier (P633), captain (P634), ISTAT ID (P635), route of administration (P636), Protein ID (P637), PDB ID (P638), RNA ID (P639), Léonore ID (P640), sport (P641), of (P642), Genloc Chr (P643), Genloc Start (P644), Genloc End (P645), Freebase identifier (P646), drafted by (P647), Open Library identifier (P648), NRHP (P649), RKDartists (P650), BPN (P651), UNII (P652), PubMed Health (P653), direction relative to location (P654)
- Development
- Worked on site-link group editing to make it possible to link to sisterprojects
- Further work on input validation
- Further work on handling invalid data gracefully
- Use Serializers for generating API results
- Finished selenium tests for TimeUI and CoordinateUI
- Changed globe coordinate value input to use backend coordinate parser
- Fixed issues with data type definitions not being available in the frontend
- Wrote a little hack so that on statements with a long list of values you will always be able to see the name of the property of the current section you are in (since the label moves when scrolling the page)
- Open Tasks for You
- Help fix formatting and value issues for a property
- Respond to a "Request for Comment"
- Hack on one of these
Closure RfC
Hi! Sorry, I didn't know that I was not allowed to close an RfC. Do you have any objections about closing it yourself? If so, please, do change my name in the "closed by". Otherwise let me know and I will leave it open. Thanks!--Micru (talk) 15:56, 25 June 2013 (UTC)
- I'm on my phone right now, I can re-close it once I get home in a few hours. Legoktm (talk) 16:33, 25 June 2013 (UTC)
- On your phone? That sounds abusive. Be careful while scrolling your watchlist! :-P Vogone talk 19:19, 25 June 2013 (UTC)
- No problem! I have opened a new one to address specific concerns >> Source items and supporting Wikipedia sources.--Micru (talk) 23:13, 25 June 2013 (UTC)
- On your phone? That sounds abusive. Be careful while scrolling your watchlist! :-P Vogone talk 19:19, 25 June 2013 (UTC)
Wikidata weekly summary #64
- Discussions
- Other Noteworthy Stuff
- d:User:Byrial is creating database reports that are useful to find issues in the current data
- Denny created a map of all geocoordinates currently in Wikidata (normal and huge version - updated daily)
- Did you know?
- Newest properties: RTECS number (P657), RefSeq (P656), translator (P655)
- Development
- The Wikidata bug report with the most votes was closed (bugzilla:36729 - updating the link on Wikidata automatically when a page on Wikipedia is moved)
- Wikipedia pages will soon have a link named "Data item" in the toolbox section of the sidebar that links to the Wikidata item that is connected to the page (bugzilla:49105 - You can already see it on the main page of test2.wikipedia.org for example.)
- Calendar names displayed for time values can now be translated (bugzilla:49080)
- Added serializers for the Ask query language
- Buuuugfixes and testing
- Refactoring
- Worked on better handling of bad values (= values that don't fit the datatype they should have)
- Open Tasks for You
- Update, expand and translate one of the help pages to make it easier for newcomers
- Help fix formatting and value issues for a property
- Hack on one of these
sex
your bot shouldn't add P21 on organizations. --Akkakk 14:36, 29 June 2013 (UTC)
- +1. sex or gender (P21) is meant only for persons. Everything else: Your bot is doing a great job ; ) --Kolja21 (talk) 18:09, 29 June 2013 (UTC)
- Ok, so the error was that my bot was not reading the
{{Constraint:Item}}
template properly. I've disabled the job for now and will write a patch soon. Thanks, Legoktm (talk) 18:30, 29 June 2013 (UTC)- most of the item constraints can't be solved automatically. if you try, don't rely on a single rule or a sinle given claim. they might be wrong. --Akkakk 18:53, 29 June 2013 (UTC)
- Ok, so the error was that my bot was not reading the