Page MenuHomePhabricator

Detection of duplicate claim doesn't work for Coordinate type
Closed, ResolvedPublic4 Estimated Story Points

Description

Comparing a newly created Coordinate claim with one fetched from Wikidata fails even if these are the same.

This occurs because _entity does not get initialised if globe is used during initialisation. Similarly if entity/globe_item is used globe would not get initialised.

The solution is to override __eq__ in a similar way to how this was done for WbQuantity or to rethink how we compare the different Wikibase claim types.

Event Timeline

I don't think I've added Coordinate claims using WikidataStuff before so I had not encountered this. Could you post a link here of an example where this happened and (ideally) also including the source data?

I don't think I've added Coordinate claims using WikidataStuff before so I had not encountered this. Could you post a link here of an example where this happened and (ideally) also including the source data?

This is a good example: Q296758. Indata would still be good though.

The data for this item is: https://tools.wmflabs.org/heritage/api/api.php?action=search&format=json&srcountry=se-arbetsl&srlanguage=sv&srid=2490

Interestingly, when I run the query, it looks like items with 3 coordinate claims don't exist. Q296758 is listed as having only two of them. Completely identical claims seem not be counted in some way.

Thanks. If this is no longer a blocker for the migration then I might steal this task to investigate the base cause.

Investigating this further it seems as though _entity does not get initialised if globe is set via the text parameter. This issue will only get more pronounced once https://gerrit.wikimedia.org/r/#/c/334912/is merged.

The solution is to override __eq__ in a similar way to how this was done for WbQuantity.

Change 342494 had a related patch set uploaded (by Lokal Profil):
[pywikibot/core] [WIP][BUG]Correctly compare Coordinate

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

Lokal_Profil updated the task description. (Show Details)
Lokal_Profil set the point value for this task to 4.

Change 342494 merged by jenkins-bot:
[pywikibot/core@master] [BUG]Correct _wbtypes equality comparison

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