query-48a610d04845063517d82da1a36a6667

rq turtle/ttl

A bit fishy

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?itemLabel (COUNT(?item) AS ?ct)
WHERE
{
     ?item wdt:P171+ wd:Q127282. 
     ?item p:P31 ?inst.
     ?inst ps:P31 wd:Q16521.  # extant, not extinct or fossil
     ?item p:P225 ?name. 
     ?name  ps:P225 ?taxonname.
     ?item p:P105 ?rank.
     ?rank ps:P105 wd:Q7432.            # species
     ?item schema:description ?itemLabel.
     FILTER (LANG(?itemLabel) = "en" && STR(?itemLabel) != 'species of fish')
} GROUP BY ?itemLabel
ORDER BY DESC(?ct)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?ct") v4("?inst") v3("?item"):::projected v2("?itemLabel"):::projected v5("?name") v7("?rank") v6("?taxonname") c4(["wd:Q127282"]):::iri c12(["wd:Q7432"]):::iri c7(["wd:Q16521"]):::iri f0[["?itemLabel = 'en'str(?itemLabel) != 'species of fish'"]] f0 --> v2 v3 --"p:direct/P171"--> c4 v3 --"p:P31"--> v4 v4 --"p:statement/P31"--> c7 v3 --"p:P225"--> v5 v5 --"p:statement/P225"--> v6 v3 --"p:P105"--> v7 v7 --"p:statement/P105"--> c12 v3 --"schema:description"--> v2 bind2[/"count(?item)"/] v3 --o bind2 bind2 --as--o v8