query-f90b3a29732a6a7ad3e00c3d2c0b1054
Histogram 14:18, 17 October 2016 (UTC)) talk (Infovarius, or to get a distribution of films by countries? --thisIs it possible to make a statistics of films by several parameters? For example, to get a histogram like The data for the number of films by year you can get with
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?year (count(?item) as ?cnt) WHERE{
?item wdt:P31/wdt:P279* wd:Q11424 .
?item wdt:P577 ?publicationdate .
BIND(str(year(?publicationdate)) as ?year)
FILTER(bound(?year))
} GROUP BY ?year ORDER BY ?year
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?cnt")
v2("?item"):::projected
v3("?publicationdate")
v4("?year"):::projected
a1((" "))
c3(["wd:Q11424"]):::iri
f0[["bound(?year)"]]
f0 --> v4
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P577"--> v3
bind1[/"str(year-from-dateTime(?publicationdate))"/]
v3 --o bind1
bind1 --as--o v4
bind3[/"count(?item)"/]
v2 --o bind3
bind3 --as--o v4