query-9af0295e8b43b3ecc496a7eea8b5d173

rq turtle/ttl

Taxons with taxon rank "phylum" SELECT DISTINCT ?item WHERE { ?item wdt:P31 wd:Q16521 . ?item wdt:P105 wd:Q38348 . ?item wdt:P171 ?parent . ?parent wdt:P171 ?grandparent . SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } }

Use at

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#>
#Taxons with taxon rank "phylum"
SELECT DISTINCT ?item
WHERE {
  ?item wdt:P31 wd:Q16521 .
  ?item wdt:P105 wd:Q38348 .
  ?item wdt:P171 ?parent .
  ?parent wdt:P171 ?grandparent .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?grandparent") v1("?item"):::projected v2("?parent") c4(["wd:Q38348"]):::iri c7(["bd:serviceParam"]):::iri c9(["en"]):::literal c2(["wd:Q16521"]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P105"--> c4 v1 --"wdt:P171"--> v2 v2 --"wdt:P171"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end