As a Wikidata editor, I want to create and edit items without getting conflict reports for pages that don’t exist.
Problem:
The Wikidata term store (aka new term store, normalized term store) contains some rows for items that have been deleted during the wb_terms migration phase.
Acceptance criteria:
- The term store does not contain any data for deleted items.
Example:
An editor tried to set the Spanish label of an item to «Nicki Nicole» and the description to «cantante argentina», but got an error that “Item Nicki Nicole (Q67179790) already has label "Nicki Nicole" associated with language code es, using the same description text” (project chat permalink); however, the page Q67179790 was actually deleted on 12 September 2019.
Querying the term store on Toolforge, we can see that the rows still exist which allowed Wikidata to detect the “conflict”, and also to render {{Q|Q67179790}} using the label of the deleted item:
MariaDB [wikidatawiki_p]> SELECT wbit_item_id, wby_name, wbxl_language, wbx_text FROM wbt_item_terms JOIN wbt_term_in_lang ON wbit_term_in_lang_id = wbtl_id JOIN wbt_type ON wbtl_type_id = wby_id JOIN wbt_text_in_lang ON wbtl_text_in_lang_id = wbxl_id JOIN wbt_text ON wbxl_text_id = wbx_id WHERE wbit_item_id = 67179790; +--------------+-------------+---------------+---------------------------------------------------------------+ | wbit_item_id | wby_name | wbxl_language | wbx_text | +--------------+-------------+---------------+---------------------------------------------------------------+ | 67179790 | label | en | Nicki Nicole | | 67179790 | label | es | Nicki Nicole | | 67179790 | label | ast | Nicki Nicole | | 67179790 | description | en | Argentine singer | | 67179790 | description | es | cantante argentina | | 67179790 | description | en-gb | Argentine singer | | 67179790 | description | sq | këngëtare argjentinase | | 67179790 | description | fr | chanteuse argentine | | 67179790 | description | gl | cantante arxentina | | 67179790 | description | bn | আর্জেন্টিনীয় গায়িকা | | 67179790 | description | ar | مغنية أرجنتينية | | 67179790 | description | he | זמרת ארגנטינאית | | 67179790 | description | ro | cântăreață argentiniană | | 67179790 | description | ca | cantant argentina | | 67179790 | description | en-ca | Argentine singer | +--------------+-------------+---------------+---------------------------------------------------------------+ 15 rows in set (0.04 sec)