(Note that the <https://mo.wikipedia.org/> IRI also exists in two other triples, as the official website of Q3568049. This is unrelated and doesn’t need to be changed.)
From what I see, the following conditions must be met for this triple to appear in a dump:
- wikidata.org still contains an Item with a sitelink that actually points to a page on mo.wikipedia.org. Weirdly enough I can't find any: https://query.wikidata.org/#SELECT%20%3Fitem%20%3Fpage%20WHERE%20%7B%0A%3Fpage%20schema%3Aabout%20%3Fitem%3B%0Aschema%3AisPartOf%20%3Chttps%3A%2F%2Fmo.wikipedia.org%2F%3E%0A%7D%20LIMIT%2010
- The wiki is still in the sites table.
The actual bug here seems to be that the Wikibase code still thinks "mowiki" is a valid wiki, while it is a redirect in reality. You can see that "mo" can still be found when trying to add a sitelink, but doesn't work properly.
There are 10 (!) calls to \SiteLookup::getSites in the Wikibase code, and they all have this issue. Unfortunately it seems the sites table does not contain the information if a domain is a redirect. Where is this stored?
There used to be sitelinks for this wiki until relatively recently, when @VIGNERON removed them. I assume that when the sitelinks were removed, the WDQS updater removed those triples from the query service, but never removed the wikibase:wikiGroup triple for it, even though I suspect that it no longer would appear in a full Wikibase dump after the last sitelink was removed.
Yes, @Lucas_Werkmeister_WMDE is completely correct - when sitelinks has been removed, the wikiGroup statemens remained since they were present before in the dump, and they do not belong to any specific item. I can manually delete the orphan wikiGroup statements, but I wonder - does it hurt anything to leave them alone? Is this breaking something? We don't have automatic detection of such cases because wiki deletion is an extremely rare event.
I can't do much about the mowiki appearing in Wikidata interface sitelinks widget - I'd suggest making separate task for it.
IMHO, a manual deletion would be the best course of action (unless it’s very cumbersome?). Wiki deletion shouldn’t be common enough to require any automatic detection in the updater, but I don’t think we should wait for the next full dump reload of the query service either to fix this problem – the query service is out of sync with Wikidata, and we can fix it (well, this part…), so why not do it?
Unclear, I removed the 337 sitelinks as they were clearly going nowhere but I didn't touch the label or description (which are more numerous and a bit messy, some are written in Cyrl some in Latn :/ ).
FYI, there was a discussion on the langcom mailing list mid-February : https://lists.wikimedia.org/pipermail/langcom/2018-February/001934.html ; we probably should ask them for a clear decision.