query-78c46242829860b9ae3668bb060cc68f

rq turtle/ttl

How to get the parent taxon of the parent taxon?

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?taxon_name ?PL_id ?PLLink   WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  ?item p:P225 ?stat . 
  ?stat ps:P225 ?taxon_name.
  ?item wdt:P1070 ?PL_id. # PlantList ID
  ?item wdt:P105 wd:Q7432. # taxon rank is species
  bind(uri(concat("http://www.theplantlist.org/tpl1.1/record/",?PL_id)) as ?PLLink)  
  MINUS {?stat pq:P405 ?taxon_author.}
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?PLLink"):::projected v4("?PL_id"):::projected v1("?item"):::projected v2("?stat") v6("?taxon_author") v3("?taxon_name"):::projected c2(["bd:serviceParam"]):::iri c9(["wd:Q7432"]):::iri c4(["en"]):::literal subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v1 --"p:P225"--> v2 v2 --"p:statement/P225"--> v3 v1 --"p:direct/P1070"--> v4 v1 --"p:direct/P105"--> c9 bind0[/"concat('http://www.theplantlist.org/tpl1.1/record/',?PL_id)"/] v4 --o bind0 bind0 --as--o v5 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v2 --"p:qualifier/P405"--> v6 end