query-cb4ead193b6b7123c0fc1e62d932b534
number of films by number of ratings SELECT (count(?item) as ?numberOfFilms) ?numberOfRatingProperties WHERE { SELECT ?item (count(distinct ?p) AS ?numberOfRatingProperties) WHERE { [] wdt:P31/wdt:P279 wd:Q24716199; wikibase:claim ?p . ?item wdt:P31/wdt:P279 wd:Q11424; ?p [] . } GROUP BY ?item } GROUP BY ?numberOfRatingProperties
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/>
#number of films by number of ratings
SELECT (count(?item) as ?numberOfFilms) ?numberOfRatingProperties
WHERE {
SELECT ?item (count(distinct ?p) AS ?numberOfRatingProperties)
WHERE {
[] wdt:P31/wdt:P279* wd:Q24716199; wikibase:claim ?p .
?item wdt:P31/wdt:P279* wd:Q11424; ?p [] .
} GROUP BY ?item
} GROUP BY ?numberOfRatingProperties
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v4("?numberOfFilms")
v3("?numberOfRatingProperties"):::projected
v1("?p")
a1((" "))
a4((" "))
a2((" "))
a3((" "))
c3(["wd:Q24716199"]):::iri
c5(["wd:Q11424"]):::iri
a1 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c3
a1 --"wikibase:claim"--> v1
v2 --"wdt:P31"--> a3
a3 --"wdt:P279"--> c5
v2 -->v1--> a4
bind1[/"count(?p)"/]
v1 --o bind1
bind1 --as--o v3
bind3[/"count(?item)"/]
v2 --o bind3
bind3 --as--o v4