query-ce473425b25ad407c30c353494677ce7
Propertiesparent taxon (P171)taxon rank (P105)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?item2Label ?item3Label ?item4Label ?item4rankLabel
WHERE {
?item wdt:P171+ wd:Q7377 .
FILTER NOT EXISTS { [] wdt:P171 ?item } # Leaf nodes only
?item wdt:P171 ?item2 .
?item2 wdt:P171 ?item3 .
?item3 wdt:P171 ?item4 .
?item4 wdt:P105 ?item4rank
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?item4Label ?item3Label
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v4("?item2")
v5("?item3")
v2("?item3Label"):::projected
v6("?item4")
v1("?item4Label"):::projected
v7("?item4rank")
a1((" "))
c2(["wd:Q7377"]):::iri
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0a1 --"wdt:P171"--> e0v1
e0v1("?item"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> a1
f0 --> c1
f0 --> v3
a1 --"wdt:P171"--> v3
v3 --"wdt:P171"--> c2
v3 --"wdt:P171"--> v4
v4 --"wdt:P171"--> v5
v5 --"wdt:P171"--> v6
v6 --"wdt:P105"--> v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end