query-cb52b5df0c617a7f4f4f9ede684bfcfc
Any idea how I could get that to not start at "decade" 0? I don't mind if it was a bar chart or an area chart. (or the ones on the right side), even if no data is available for some decades. this chartIdeally, it would look more like 10:24, 14 February 2020 (UTC) Jura. --- #Queries_about_"John"BTW, this is now one of the queries for : If you convert ?decade to a string, it will only show points for existing values. The disadvantage is that there will be holes, so the x axis isn't linear:Jura1@
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
#defaultView:LineChart
SELECT (STR(?decade_number) AS ?decade) (COUNT(DISTINCT ?item) as ?ct)
{
?item wdt:P735 wd:Q2829505 ; wdt:P569 ?b .
?item p:P569/psv:P569 [ wikibase:timeValue ?b ; wikibase:timePrecision ?precision ]
FILTER(?precision > 7 )
BIND( (FLOOR(YEAR(?b)/10)*10) as ?decade_number)
}
GROUP BY ?decade_number
ORDER BY ?decade_number
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?b")
v6("?ct")
v5("?decade")
v5("?decade_number"):::projected
v3("?item"):::projected
v2("?precision")
a2((" "))
a1((" "))
c3(["wd:Q2829505"]):::iri
f0[["?precision > '7^^xsd:integer'"]]
f0 --> v2
v3 --"p:direct/P735"--> c3
v3 --"p:direct/P569"--> v4
a1 --"wikibase:timeValue"--> v4
a1 --"wikibase:timePrecision"--> v2
v3 --"p:P569"--> a2
a2 --"p:statement/value/P569"--> a1
bind1[/"numeric-floor(year-from-dateTime(?b) / '10^^xsd:integer') * '10^^xsd:integer'"/]
v4 --o bind1
bind1 --as--o v5
bind3[/"str(?decade_number)"/]
v5 --o bind3
bind3 --as--o v5
bind4[/"count(?item)"/]
v3 --o bind4
bind4 --as--o v6