query-bd87e9545305343ce1b1bbf89376491b

rq turtle/ttl

Barchart order 23:36, 14 October 2020 (UTC)) talk (TagishsimonI'd like the following in year order, but the #barchart doodab has other ideas. What can I do to persuade it? thx. --

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#>
#defaultView:BarChart
SELECT ?part ?partLabel  (count(*) as ?counts) (year(?pit) as ?year) WHERE 
{
  ?item wdt:P31 wd:Q7604686.
  ?item wdt:P179 ?part.
  ?part wdt:P1001 wd:Q25;
        wdt:P585 ?pit.
  SERVICE wikibase:label {bd:serviceParam wikibase:language "en".}
  } group by ?part ?partLabel ?pit order by ?year

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?counts") v2("?item") v3("?part"):::projected v4("?pit"):::projected v6("?year") c8(["bd:serviceParam"]):::iri c2(["wd:Q7604686"]):::iri c10(["en"]):::literal c5(["wd:Q25"]):::iri v2 --"wdt:P31"--> c2 v2 --"wdt:P179"--> v3 v3 --"wdt:P1001"--> c5 v3 --"wdt:P585"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end bind1[/"count(*)"/] bind1 --as--o v5 bind2[/"year-from-dateTime(?pit)"/] v4 --o bind2 bind2 --as--o v6