query-ad0eb92252825f327f3dcf81e13c6151

rq turtle/ttl

And here it is in Python: """ } FILTER(REPLACE(REPLACE(STR(?alias), "í", "’"), "‰", "ä") = STR(?commonName)). FILTER(CONTAINS(?alias, "í") && CONTAINS(?alias, " ")). skos:altLabel ?alias. ?item wdt:P1843 ?commonName; { WHERE SELECT ?item """ = querySo let’s put the pieces together: the SPARQL generator just like for the common names, and the alias editing from just now. # break out of loop, because mass editing is still scary Exception raise )"Fix broken taxon common name alias: see https://www.wikidata.org/wiki/User:TweetsFactsAndQueries/Darwin%C3%ADs_Fox"=summary ,aliases(editAliases.item ]))index][lang[aliases ,alias ,item(format."{} to {} to change {}"Editing (print )"ä" ,"‰"(replace.)"’" ,"í"(replace.alias = ]index][lang[aliases :alias in "í" if ]):lang[aliases(enumerate in alias ,index for :aliases in lang for ]"aliases"()[get.item = aliases ):site ,query(WikidataSPARQLPageGenerator.pg in item for would also work), to be on the safe side. The result looks good, so let’s remove that raise and run again: break to break out of the loop (even though in this case break instead of raise ExceptionThis time, I used )"Fix broken taxon common name alias: see https://www.wikidata.org/wiki/User:TweetsFactsAndQueries/Darwin%C3%ADs_Fox"=summary ,aliases(editAliases.item ]))index][lang[aliases ,alias ,item(format."{} to {} to change {}"Editing (print )"ä" ,"‰"(replace.)"’" ,"í"(replace.alias = ]index][lang[aliases :alias in "í" if ]):lang[aliases(enumerate in alias ,index for :aliases in lang for ]"aliases"()[get.item = aliases ):site ,query(WikidataSPARQLPageGenerator.pg in item forAgain, pywikibot has to sleep for about ten seconds after each edit to avoid running into rate limits (my account doesn’t have the bot flag), so this will take another hour. Some time later, that’s done as well. I looked over the results, and there was actually a fair amount of false positives :( mostly for two reasons: At least one language seems to use í for the genitive case. ”Delfín” is spelled with an í in Spanish. looked suspicious, but a quick Google search revealed that “Bois d’ebene feuilles” seems to be correct.) (Q15341736)Diospyros revaughanii . (I also went back and looked through the taxon common name changes, but didn’t find any edits that stood out as incorrect. (Q369889)Etruscan shrew , and (Q370965)Kitti's hog-nosed bat , (Q1247992)Vipera latastei , (Q133818)Angraecum sesquipedale , (Q751965)Fraser's dolphin , (Q187484)Steller’s sea cow , (Q724354)Commerson's dolphin fix above – there are less “taxon common name” statements than aliases, and mostly just English ones.) I could have stopped pywikibot and improved the query, but instead I decided to let it run and fix the broken cases manually: (P1843)taxon common name Both of these could have been avoided if I’d limited the query and replacements to English labels. (Which is also why the problem didn’t occur in the , with taxon common name and alias “G¸nther’s frog”. Clearly, more characters than ’ and ä were broken – in this case, the ¸ should be an ü. (Q3150486)Indirana diplosticta There’s one final problem. In the alias results, I also noticed the item A quick SPARQL query –

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?taxon ?name WHERE {
  ?taxon wdt:P1843 ?name.
  FILTER(CONTAINS(?name, "¸")).
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?name"):::projected v2("?taxon"):::projected f0[["contains(?name,'¸')"]] f0 --> v1 v2 --"wdt:P1843"--> v1