We have a problem in Wikidata query service that seems to be the result of DELETE not deleting all triples it should on update. The result is data duplication e.g. as described here:
As an example, this query:
returns two labels - "Schadenfreude" and "schadenfreude", even though the entity never has more than one. This is because when updating, old label for some reason was not deleted. It can not be skipped update or caching issue, since the new data is there, and new data always only contains one label.
This also happens with other updates, and is reproducible with edits to Q4115189, as described in the bug above. I.e. if I do
now I see two references ( wdref: ) even though looking at https://www.wikidata.org/wiki/Q4115189 (or https://www.wikidata.org/wiki/Special:EntityData/Q4115189.ttl?flavor=dump&nocache=11123) there is only one reference for wds:Q4115189-cba17f58-4bc5-7155-f0dc-efd77847efaf (which is "child:Hägar the Horrible" claim). So somehow the old data is not deleted. Since this happens for both statements and labels, it does not seem to be limited to cases where we have custom vocabulary. It also does not happen all the time - many times deletion works just fine.
Another consequence of it is this query:
Which should return 0 since the statement can not have two ranks. However, it returns over 4000 results. Which probably because rank changed but old data was not deleted properly.
Also, if I manually update any of the affected entities, the problem is gone - so it is not persistent, it happens intermittently during running the batch updates, but I never could reproduce it through individual update to an entity.
Any help with this is highly appreciated as the data quality suffers a lot because of this issue.