matej_suchanek added a comment.
I managed to drop this to around 40 instances. I did it using
`action=wbeditentity&clear=1&data={entity_without_tokipona}`. But in some
cases, it isn't possible because of inconsistent data (missing `precision`
value attributes, links to deleted pages, label-description conflicts etc.).
For curiosity, this is the Pywikibot script:
name=tokipona.py
# -*- coding: utf-8 -*-
import pywikibot
from pywikibot import pagegenerators
pywikibot.handle_args()
repo = pywikibot.Site('wikidata', 'wikidata')
query = ''
query += 'SELECT 0 AS ns, term_full_entity_id FROM wb_terms'
query += ' WHERE term_language = \'tokipona\' AND term_entity_type =
\'item\''
summary = 'remove tokipona terms (see [[phab:T200432]])'
gen = pagegenerators.MySQLPageGenerator(query, site=repo)
def handle_entity(entity):
if 'tokipona' in entity._content['labels']:
entity._content['labels'].pop('tokipona')
if 'tokipona' in entity._content['descriptions']:
entity._content['descriptions'].pop('tokipona')
if 'tokipona' in entity._content['aliases']:
entity._content['aliases'].pop('tokipona')
entity.editEntity(entity._content, clear=True, summary=summary)
for item in pagegenerators.PreloadingEntityGenerator(gen):
handle_entity(item)
query = query.replace("'item'", "'property'")
for page in pagegenerators.MySQLPageGenerator(query, site=repo):
p = pywikibot.PropertyPage(repo, page.title(with_ns=False))
p.get()
handle_entity(p)
TASK DETAIL
https://phabricator.wikimedia.org/T200432
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: matej_suchanek
Cc: Pasleim, matej_suchanek, Mbch331, Harmonia_Amanda, Aklapper,
Lydia_Pintscher, alaa_wmde, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden,
LawExplorer, _jensen, rosalieper, Wikidata-bugs, aude
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs