query-2cb02283d7ffb1bc327de47cf4612c4e

rq turtle/ttl

Subspecies with wrong parent species

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?item ?taxonName ?parentTaxonName WHERE {
   ?item wdt:P225 ?taxonName .
   ?item wdt:P105 wd:Q68947 . #subspecies
   ?item wdt:P171/wdt:P225 ?parentTaxonName .
   FILTER (!strStarts(?taxonName, ?parentTaxonName)) 
}
ORDER BY ASC(?taxonName)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v2("?parentTaxonName"):::projected v1("?taxonName"):::projected a1((" ")) c3(["wd:Q68947"]):::iri f0[["not starts-with(?taxonName,?parentTaxonName)"]] f0 --> v1 f0 --> v2 v3 --"wdt:P225"--> v1 v3 --"wdt:P105"--> c3 v3 --"wdt:P171"--> a1 a1 --"wdt:P225"--> v2