Page MenuHomePhabricator

Terms table not updated when deleting properties (deleted properties can still be found by label with wbsearchentities)
Closed, ResolvedPublic

Description

Just discovered this weird issue:
if you search for the label of a deleted property, it is still found.
I've deleted the property with the label "AuWKYzfw", see http://wikidata.beta.wmflabs.org/w/index.php?title=Property:P2345&action=edit&redlink=1

But it can still be found by doing:
http://wikidata.beta.wmflabs.org/w/api.php?action=wbsearchentities&format=json&search=AuWKYzfw&language=en&type=property&limit=10

This also means it can still be selected when adding statements as the property suggester uses wbsearchentities.


Version: unspecified
Severity: normal
Whiteboard: u=dev c=backend p=0

Details

Reference
bz71914

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:45 AM
bzimport set Reference to bz71914.
bzimport added a subscriber: Unknown Object (MLST).

This does not apply to items:
http://wikidata.beta.wmflabs.org/w/api.php?action=wbsearchentities&format=json&search=kuzTrkkK&language=en&type=item&limit=10

Above query does not give you any search results which is correct because the item was deleted.

You also cannot create a new property with the same label the deleted one had. Special:NewProperty also gives you a strange error message in case you try:

Property P2345 already has label "AuWKYzfw" associated with language code en.
Property P2345 already has label "ZTMfXXavmfzRtmdtGGAH" associated with language code en.

So P2345 has two labels for language en associated? The second one should be the description.

(In reply to tobias.gritschacher from comment #2)

You also cannot create a new property with the same label the deleted one
had. Special:NewProperty also gives you a strange error message in case you
try:

Property P2345 already has label "AuWKYzfw" associated with language code en.
Property P2345 already has label "ZTMfXXavmfzRtmdtGGAH" associated with
language code en.

So P2345 has two labels for language en associated? The second one should be
the description.

This seems unrelated, created another bug for it: https://bugzilla.wikimedia.org/show_bug.cgi?id=71915

(In reply to tobias.gritschacher from comment #0)

Just discovered this weird issue:
if you search for the label of a deleted property, it is still found.
I've deleted the property with the label "AuWKYzfw", see
http://wikidata.beta.wmflabs.org/w/index.php?title=Property:
P2345&action=edit&redlink=1

But it can still be found by doing:
http://wikidata.beta.wmflabs.org/w/api.
php?action=wbsearchentities&format=json&search=AuWKYzfw&language=en&type=prop
erty&limit=10

This also means it can still be selected when adding statements as the
property suggester uses wbsearchentities.

The possible cause of the issue is outlined here:
https://bugzilla.wikimedia.org/show_bug.cgi?id=71784

It seems like entries in the terms table are not removed when deleting entities. On test.wikidata.org, I created a property called "role" and then deleted it. However, "role" is still shown as a siggestion in the entity selector, and i cannot create a new property with the label "role".<<

  • Bug 71784 has been marked as a duplicate of this bug. ***

gerritadmin wrote:

Change 166425 had a related patch set uploaded by Daniel Kinzler:
Fix entity deletion updates for properties.

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

gerritadmin wrote:

Change 166425 merged by jenkins-bot:
Fix entity deletion updates for properties.

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

Patch merged... not sure how to deal with the old data still in the table? Worth cleaning that up per hand?

Would be good to delete the orphan entries, yes.
Note that similar orphans are probably present in the entity_per_page table.

I've no manually purged both the orphan entity per page and the orphan terms table entries. Would be nice to have a maintenance script for that (but not really worth the work atm).