query-ae1c7c64a78ffe0b85d662591fb1a202

rq turtle/ttl

Belongs taxon to a higher taxon

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?item ?taxonName ?taxonRank ?higherParentName WHERE {
    BIND("Panthera leo" AS ?taxonName) 
    #BIND(wd:Q7432 AS ?taxonRank) # species
    BIND(wd:Q7377 AS ?higherParent) # Mammalia
    ?item wdt:P225 ?taxonName .
    ?item wdt:P105 ?taxonRank .
    ?item (wdt:P171)* ?higherParent .
    ?higherParent wdt:P225 ?higherParentName .
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?higherParent") v5("?higherParentName"):::projected v3("?item"):::projected v1("?taxonName"):::projected v4("?taxonRank"):::projected bind0[/"'Panthera leo'"/] bind0 --as--o v1 bind1[/"'wd:Q7377'"/] bind1 --as--o v2 v3 --"wdt:P225"--> v1 v3 --"wdt:P105"--> v4 v3 --"wdt:P171"--> v2 v2 --"wdt:P225"--> v5