query-1ba10c5902d8c4b58a091bba3748dbc5

rq turtle/ttl

title:Religions and worldviews with numbers of adherents known to Wikidata SELECT ?rel ?relLabel ?count WITH { SELECT ?rel (COUNT(?item) AS ?count) WHERE {?item wdt:P31 wd:Q5 ; # human wdt:P140 ?rel } GROUP BY ?rel } AS %sub WHERE { INCLUDE %sub SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } } ORDER BY DESC(?count)

Use at

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:Religions and worldviews with numbers of adherents known to Wikidata
SELECT ?rel ?relLabel ?count WHERE {

{ SELECT ?rel (COUNT(?item) AS ?count) WHERE {?item wdt:P31 wd:Q5 ; # human
  wdt:P140 ?rel } GROUP BY ?rel }SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?count"):::projected v2("?item") v3("?rel"):::projected c5(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"wdt:P31"--> c2 v2 --"wdt:P140"--> v3 bind1[/"count(?item)"/] v2 --o bind1 bind1 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end