query-f04406894a7584d7b8fb14f75e24ad27

rq turtle/ttl

Basic taxon properties

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?taxonName ?rank ?parentName ?parentRank ?id ?idTaxonName WHERE {
   ?item wdt:P225 ?taxonName .
   #?item wdt:P105 wd:Q7432 . # species
   ?item wdt:P105 wd:Q35409 . # family
   BIND(wd:Q35409 AS ?rank) .
   #?item wdt:P105 ?rank .
   ?item wdt:P171/wdt:P225 ?parentName .
   ?item wdt:P171/wdt:P105 ?parentRank .  
   ?item wdt:P685 ?id . # NCBI id
   ?item p:P685 ?idStatement .
   ?idStatement prov:wasDerivedFrom ?ref .    
   #?ref pr:P248 wd:Q82494 . # National Center for Biotechnology Information 
   OPTIONAL {?ref pr:P225 ?idTaxonName} .
} 
#ORDER BY ASC(?taxonName)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?id"):::projected v7("?idStatement") v9("?idTaxonName"):::projected v1("?item"):::projected v4("?parentName"):::projected v5("?parentRank"):::projected v3("?rank"):::projected v8("?ref") v2("?taxonName"):::projected a1((" ")) a2((" ")) c3(["wd:Q35409"]):::iri v1 --"p:direct/P225"--> v2 v1 --"p:direct/P105"--> c3 bind0[/"'wd:Q35409'"/] bind0 --as--o v3 v1 --"p:direct/P171"--> a1 a1 --"p:direct/P225"--> v4 v1 --"p:direct/P171"--> a2 a2 --"p:direct/P105"--> v5 v1 --"p:direct/P685"--> v6 v1 --"p:P685"--> v7 v7 --"prov:wasDerivedFrom"--> v8 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:reference/P225".-> v9 end