query-2751f0100ecc832f486ea8468a3e129f

rq turtle/ttl

mean price per year

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?year (round(AVG(?price)) as ?mean) WHERE {
 ?item wdt:P170 wd:Q381238 .      
 ?item p:P793 ?statement .
 ?statement pq:P585 ?date.
 ?statement pq:P2284 ?price.
 FILTER ( ! wikibase:isSomeValue(?price))
 BIND ( YEAR(?date) as ?year).
} group by ?year
order by ?year

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?date") v3("?item") v6("?mean") v2("?price") v4("?statement") v6("?year"):::projected c2(["wd:Q381238"]):::iri f0[["not http://wikiba.se/ontology#isSomeValue(?price)"]] f0 --> v2 v3 --"p:direct/P170"--> c2 v3 --"p:P793"--> v4 v4 --"p:qualifier/P585"--> v5 v4 --"p:qualifier/P2284"--> v2 bind1[/"year-from-dateTime(?date)"/] v5 --o bind1 bind1 --as--o v6 bind3[/"numeric-round()"/] null --o bind3 bind3 --as--o v6