Page MenuHomePhabricator

Modify category.py to also update Wikidata on category rename
Closed, ResolvedPublic

Description

At the moment when a category gets renamed the bot creates a new category and moves all the contents there. This creates a lot of disconnected wikidata items. See https://www.wikidata.org/wiki/User:Pasleim/Items_for_deletion/Category for a list.

What the bot should do:

  1. Create the new category
  2. Check if the old category is connected to a Wikidata item.
  3. If that's the case update the sitelink to the new item
  4. If the label in the language of the category is the same as the old category name, update that to the new category name
  5. Start moving contents as usual

Version: core-(2.0)
Severity: normal

Details

Reference
bz64815

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:12 AM
bzimport set Reference to bz64815.

Actually, what I think we should do is simply create a new item for the new category name and delete the sitelink for the old one...

And creating a duplicate item? Why would we want to do that?

(In reply to Maarten Dammers from comment #2)

And creating a duplicate item? Why would we want to do that?

Because the old item could contain a lot more sitelinks than just Commons, with varying labels as well. In your illustrated case you are assuming the Commons sitelink is the only one that exists, and that we could easily move the Commons sitelink and change the English label while say enwiki or another one decides to use a different label.

Change 148539 had a related patch set uploaded by Ricordisamoa:
update Wikibase item on category rename

https://gerrit.wikimedia.org/r/148539

Change 148539 merged by jenkins-bot:
update Wikibase item on category rename

https://gerrit.wikimedia.org/r/148539