Page MenuHomePhabricator

Mismatch Finder formats random values using unrelated labels if they look like item IDs
Closed, DeclinedPublicBUG REPORT

Assigned To
None
Authored By
Lucas_Werkmeister_WMDE
Oct 19 2022, 4:03 PM
Referenced Files
F35780943: image.png
Nov 15 2022, 11:01 AM
F35780940: image.png
Nov 15 2022, 11:01 AM
F35780938: image.png
Nov 15 2022, 11:01 AM
F35780705: image.png
Nov 15 2022, 11:01 AM
F35600113: image.png
Oct 19 2022, 4:03 PM

Description

Steps to replicate the issue

  • create a mismatch CSV with a mismatch that has an external value that looks like an Item ID (i.e. Qxxx)
  • upload it into the Mismatch Finder
  • See the external value formatted as an Item ID on the Mismatch Finder results page

What happens?:
If there is a mismatch with a string value that happens to look like an item ID, Mismatch Finder will try to show it as the label of that item, even though it has nothing to do with the mismatch. For example, when I created a fictional mismatch for the Q2 (Star Trek: Voyager) WikiTrek ID on a local install, it looked like this:

image.png (260×441 px, 13 KB)

The value should just be Q2, but it gets shown as a reference to the item Earth.

If the item doesn’t actually exist, you even get an error, e.g. for q0 or Q052.

[2022-10-19 15:52:44] local.ERROR: Could not find an entity with the ID "Q0". {"exception":"[object] (App\\Exceptions\\WikibaseAPIClientException(code: 0): Could not find an entity with the ID \"Q0\". at /var/www/html/app/Services/WikibaseAPIClient.php:42)
[stacktrace]
...
[2022-10-19 15:53:09] local.ERROR: Could not find an entity with the ID "Q052". {"exception":"[object] (App\\Exceptions\\WikibaseAPIClientException(code: 0): Could not find an entity with the ID \"Q052\". at /var/www/html/app/Services/WikibaseAPIClient.php:42)
[stacktrace]
...

What should have happened instead?:

  • No error is thrown
  • Mismatch Finder should format Wikidata values depending on the data type of the property they belong to, instead of trying to guess what data type they look like.

Event Timeline

Lydia_Pintscher changed the subtype of this task from "Task" to "Bug Report".
Lydia_Pintscher subscribed.

Declining because we decided the remaining issue is a very edgy edge case and not worth spending time on now.

So the error for Q0/q0 has already been fixed by #444 (part of T321173):

image.png (397×1 px, 62 KB)

The only buggy scenario left is where one results page shows the same string both as an item ID and as a string; in that case, the string usage will also be shown as the item label. (This probably also applies to property IDs and strings looking like them.)

Examples from localhost: the string on its own is fine;

image.png (347×1 px, 46 KB)

the item ID on its own is fine (of course);

image.png (347×1 px, 45 KB)

both together are problematic:

image.png (734×1 px, 93 KB)