query-0412846e6b2bbaa2568f2278988953ab
Taxa with a preferred parent taxon
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?taxonName ?parentTaxon WHERE {
?item wdt:P225 ?taxonName .
?item p:P171 ?statement .
?statement wikibase:rank wikibase:PreferredRank .
?statement ps:P171/p:P225/ps:P225 ?parentTaxon .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v4("?parentTaxon"):::projected
v3("?statement")
v2("?taxonName"):::projected
a1((" "))
a2((" "))
c4(["wikibase:PreferredRank"]):::iri
v1 --"p:direct/P225"--> v2
v1 --"p:P171"--> v3
v3 --"wikibase:rank"--> c4
v3 --"p:statement/P171"--> a1
a1 --"p:P225"--> a2
a2 --"p:statement/P225"--> v4