query-7b9c9d8f7568524b4df94ef9a6094551

rq turtle/ttl

Pamputt

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX pqv: <http://www.wikidata.org/prop/qualifier/value/>
PREFIX p: <http://www.wikidata.org/prop/>
select ?date ?main_val ?upper ?lower where {
  wd:Q2348 p:P2645 ?measure_val .                   # get the set of all relevant statements of the relevant item, their values and qualifiers 

  ?measure_val psv:P2645 ?numeric_val .             # from the statement, get the detailed value (value, upper bound, lower bound and unit)
  ?measure_val pqv:P585 ?measure_date_val .         # get the date qualifier detailes value (date + precision + calendar)

  ?numeric_val wikibase:quantityUpperBound ?upper . # unpack the upper bound from the measure value
  ?numeric_val wikibase:quantityLowerBound ?lower . # same with lower
  ?numeric_val wikibase:quantityAmount  ?main_val .

  ?measure_date_val wikibase:timeValue ?date .

} order by ?date

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?date"):::projected v6("?lower"):::projected v7("?main_val"):::projected v4("?measure_date_val") v2("?measure_val") v3("?numeric_val") v5("?upper"):::projected c1(["wd:Q2348"]):::iri c1 --"p:P2645"--> v2 v2 --"p:statement/value/P2645"--> v3 v2 --"p:qualifier/value/P585"--> v4 v3 --"wikibase:quantityUpperBound"--> v5 v3 --"wikibase:quantityLowerBound"--> v6 v3 --"wikibase:quantityAmount"--> v7 v4 --"wikibase:timeValue"--> v1