query-82e20fd0c475113f6c61171718ca7102
title:number of instances of genres in descending order
credit:Solidest
SELECT ?genre ?genreLabel (COUNT() AS ?count) WHERE { wd:Q188451 ^wdt:P279/^wdt:P31 ?genre. ?instance wdt:P31 ?genre SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?genre ?genreLabel ORDER BY DESC(?count)
Use at
- https://query.wikidata.org/sparql
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#>
#title:number of instances of genres in descending order
#credit:Solidest
SELECT ?genre ?genreLabel (COUNT(*) AS ?count) WHERE {
wd:Q188451 ^wdt:P279*/^wdt:P31 ?genre.
?instance wdt:P31 ?genre
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?genre ?genreLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count")
v2("?genre"):::projected
v3("?instance")
a1((" "))
c5(["bd:serviceParam"]):::iri
c2(["wd:Q188451"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
a1 --"wdt:P279"--> c2
v2 --"wdt:P31"--> a1
v3 --"wdt:P31"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind1[/"count(*)"/]
bind1 --as--o v4