Pi botEdit

Hello Mike, I hope you're doing well. I wanted to let you know the error I get when I try running the enwp_wikidata_newitem.py script, It says

Traceback (most recent call last):
File "C:\Users\Username\pywikibot\enwp_wikidata_newitem.py", line 83, in <module>
if done == 0 and newitems == 1:
NameError: name 'done' is not defined

Please where can I define "done"? Joseph202 (talk) 10:06, 2 December 2021 (UTC)

@Joseph202: It doesn't look like it is defined, probably 'done == 0 and' can be removed. But, why are you trying to run this script? This was a test script that led to Wikidata:Requests for permissions/Bot/Pi bot 19, and shouldn't generally be useful. Thanks. Mike Peel (talk) 16:02, 2 December 2021 (UTC)
@Mike Peel: Thanks for your response, I am trying to run the script on another wiki (a non WMF wiki), the script has been configured to match these wikis, so that's why I am trying to run it. What do youn think? Joseph202 (talk) 16:33, 2 December 2021 (UTC)
@Mike Peel: I tried removing
done ==0 and
from that line but it still showed me
NameError: name 'newitems' is not defined
. So I decided take only
if 1:
and then it worked, but I now get an exception error which says;
Traceback (most recent call last):
:::  File "C:\Users\Username\pywikibot\enwp_wikidata_newitem.py", line 88, in <module>
:::    new_item = pywikibot.ItemPage(repo)
:::  File "C:\Users\Username\pywikibot\pywikibot\page\__init__.py", line 3900, in __init__
:::    ns = site.item_namespace
:::  File "C:\Users\Username\pywikibot\pywikibot\site\_datasite.py", line 91, in item_namespace
:::    self._item_namespace = self.get_namespace_for_entity_type('item')
:::  File "C:\Users\Username\pywikibot\pywikibot\site\_datasite.py", line 78, in get_namespace_for_entity_type
:::    raise EntityTypeUnknownError(
:::pywikibot.exceptions.EntityTypeUnknownError: DataSite("en", "thewikibaserepofamily") does not support entity type "item"
My question now is, How do I make the DataSite support entity type "item"?
I await your benevolent reply, thank you for your anticipated cooperation. Joseph202 (talk) 17:09, 2 December 2021 (UTC)

IMO numbers and ship namesEdit

Hello Mike, I am contacting you because I have seen your activity in user talks. I have uploaded many ship photos in Wikimedia and started to create and edit also Wikidata pages. I have learnt from Ein Dahmer that the main Wikidata Infobox is linked to the Wikimedia category with IMO number and that this number is used as label, wheras the infobox for the individual ship name (xxx (ship, xxxx)) is only a Wikimedia category linked to the IMO number. Many of the infoboxes created by me were automatically updated by PiBot in this way, which I found logical.

When inputting further data, I made the error that I thought the infobox for the IMO number would be more clear if I exchange the data in 'description' by the ship name of my data. However this was wrong and I was punished by restoring many data to its original state. I am sorry for any confusion created.

Now to my problem: I found many Wikidata infoboxes linked to IMO numbers with ship names as label. In some of them I replaced them by IMO numbers, especially if there are different Wikimedia categories, i.e. different names of the same ship. Most of them I left as they are, but for me it remains unclear how the labels, descriptions and aliases are to be filled in case of Wikidata linked with IMO numbers. I had some debate with Hjart who liked to ban all IMO numbers from these fields. I think, this is a weak point of the Data base as sometimes current names, sometimes famous names, sometimes different names for different languages and sometimes the last names are chosen. Especially the last one is doubtful because often the final names are only for the voyage to the ship breakers. What would you recommend?

By the way, in some cases I have added data (like an image) on the Wikimedia category, see e.g. https://commons.wikimedia.org/wiki/Category:Otto_Sverdrup_(ship,_2002). In principle all data referring only to the respective period of the ship should be here.--Wolfgang Fricke (talk) 09:15, 3 December 2021 (UTC)

@Wolfgang Fricke: category for ship name (P7782) was meant as a work-around to cope with the multiple ship name subcategories here. The main Commons category seems to be the IMO number, so that's the one that should get the site link in the main item (like MS Finnmarken (2002) (Q1418252) - and the Wikipedia sitelinks should be on the main item as well, as should all the information about the ship. The 'ship name' category really should just be the Commons sitelink, instance of (P31) value and category combines topics (P971) values - nothing else - and you shouldn't really need to edit items like Otto Sverdrup (ship, 2002) (Q109906000). The Infobox here automatically fetches the ship info from the main item, it really doesn't need to be duplicated. For the label, I don't care as much - my suggestion would be the 'most-well-known' name as the main label (this is normally what's used for Wikipedia article titles anyway), and have all the rest as aliases - including the IMO number. Ideally we should just have the one category for the ship here, rather than the whole IMO structure, but that's a whole big argument for another day. Thanks. Mike Peel (talk) 19:23, 3 December 2021 (UTC)
Thanks, Mike, for the clear answer. Wolfgang Fricke (talk) 12:24, 6 December 2021 (UTC)

events as humansEdit

Hi Mike,

There are few items that end up being created as humans despite their label, e.g. [1]. For more:

It's something that did happen before, but it would be preferable not having to fix them afterwards.

It's possible to create an additional item for the person, but that wouldn't be linked to the article.

Possibly it happens for less morbid events too. --- Jura 15:08, 5 December 2021 (UTC)

@Jura1: You're linking to 2020 diffs here, is this still happening after the code changes since then? Thanks. Mike Peel (talk) 21:47, 5 December 2021 (UTC)
Maybe not. The searches find some recent ones, not necessarily by your bot, except maybe:
Some are correctly skipped [8][9], but the lack of P31 leads Noclaimsbot to step in.
"Case of" seems to be another label worth checking. --- Jura 11:05, 6 December 2021 (UTC)

Lists are no humansEdit

Hi Mike,

I have seen your bot indicating that lists of deceased people are people, most recently on November 30. Could you prevent it from doing so? These lists are a collection of deceased people, not articles about human beings.

Thanks, RonnieV (talk) 12:19, 7 December 2021 (UTC)

@RonnieV: Apparently the list died in 2021 - it's in pt:Categoria:Mortos em 2021? I can tweak the bot code, but I'm currently traveling so it will have to wait a few days. Thanks. Mike Peel (talk) 15:55, 7 December 2021 (UTC)
Hi Mike, yes it concerns the items in pt:Categoria:Mortos_em_2021, under 0-9. There will be new lists in the next year, so maybe you can exclude pages starting with 'Mortos em'? There is no hurry to do so, it's just one edit a month, which someone has to undo. Thanks and have a good trip! RonnieV (talk) 17:08, 7 December 2021 (UTC)

Song released in 2021?Edit

Hi. There are some problems with your bot. It says in the description that songs, which were not released in 2021, were released in 2021. See for example that (There are more, but I can't remember where I saw). Euro know (talk) 22:25, 7 December 2021 (UTC)

@Euro know: Pi bot just copies descriptions from enwiki, it doesn't generate them. The place to complain would be en:Wikipedia_talk:Short_description. That said, I think this one came up before, and the template has already been fixed - so if you just blank the description here or revert the edit, pi bot will copy over the updated one. Thanks. Mike Peel (talk) 06:59, 8 December 2021 (UTC)