query-f8484ae000f77af949706648d5736e2a
Return protein counts for each bacterial genome in Wikidata SELECT ?species ?label (count (DISTINCT ?protein) as ?protein_counts) WHERE { ?protein wdt:P31 wd:Q8054 ; wdt:P703 ?species . ?species wdt:P171* wd:Q10876 . ?species rdfs:label ?label FILTER (lang(?label) = "en") . } GROUP BY ?species ?label ORDER BY DESC(?protein_counts)
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#Return protein counts for each bacterial genome in Wikidata
SELECT ?species ?label (count (DISTINCT ?protein) as ?protein_counts) WHERE {
?protein wdt:P31 wd:Q8054 ;
wdt:P703 ?species .
?species wdt:P171* wd:Q10876 .
?species rdfs:label ?label FILTER (lang(?label) = "en") .
} GROUP BY ?species ?label ORDER BY DESC(?protein_counts)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?label"):::projected
v3("?protein"):::projected
v5("?protein_counts")
v4("?species"):::projected
c3(["wd:Q8054"]):::iri
c6(["wd:Q10876"]):::iri
f0[["?label = 'en'"]]
f0 --> v2
v3 --"wdt:P31"--> c3
v3 --"wdt:P703"--> v4
v4 --"wdt:P171"--> c6
v4 --"rdfs:label"--> v2
bind2[/"count(?protein)"/]
v3 --o bind2
bind2 --as--o v5