query-ab438fcf9ef904d2fb221529e669ffbd
Chart of number books on animal magnetism (1766-1880) grouped by decade SELECT ?decade (COUNT(?item) AS ?noB) WHERE { ?item wdt:P2 wd:Q394362; wdt:P243 wd:Q172203; wdt:P222 ?date. BIND(YEAR(?date) AS ?year) BIND(STR((ROUND(?year / 10 )) * 10) AS ?decade) } GROUP BY ?decade ORDER BY (?decade)
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#Chart of number books on animal magnetism (1766-1880) grouped by decade
SELECT ?decade (COUNT(?item) AS ?noB) WHERE {
?item wdt:P2 wd:Q394362;
wdt:P243 wd:Q172203;
wdt:P222 ?date.
BIND(YEAR(?date) AS ?year)
BIND(STR((ROUND(?year / 10 )) * 10) AS ?decade)
}
GROUP BY ?decade
ORDER BY (?decade)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?date")
v5("?decade"):::projected
v2("?item"):::projected
v5("?noB")
v4("?year")
c2(["wd:Q394362"]):::iri
c4(["wd:Q172203"]):::iri
v2 --"wdt:P2"--> c2
v2 --"wdt:P243"--> c4
v2 --"wdt:P222"--> v3
bind0[/"year-from-dateTime(?date)"/]
v3 --o bind0
bind0 --as--o v4
bind1[/"str(numeric-round(?year / '10^^xsd:integer') * '10^^xsd:integer')"/]
v4 --o bind1
bind1 --as--o v5
bind3[/"count(?item)"/]
v2 --o bind3
bind3 --as--o v5