query-1c5839c4743d556f545bf5a578075dcd
Query #7: Experimenting with QualifiersRevenue of a country, by year
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
Select ?x ?xLabel ?revamt ?revunitLabel ?year WHERE {
BIND(wd:Q1349918 AS ?x).
?x p:P2139 ?y .
?y psv:P2139 ?revnode .
?revnode wikibase:quantityAmount ?revamt .
?revnode wikibase:quantityUnit ?revunit .
?y pq:P585 ?year .
FILTER(YEAR(?year) = 2017).
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?revamt"):::projected
v4("?revnode")
v6("?revunit")
v2("?x"):::projected
v3("?y")
v1("?year"):::projected
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["year-from-dateTime(?year) = '2017^^xsd:integer'"]]
f0 --> v1
bind1[/"'wd:Q1349918'"/]
bind1 --as--o v2
v2 --"p:P2139"--> v3
v3 --"p:statement/value/P2139"--> v4
v4 --"wikibase:quantityAmount"--> v5
v4 --"wikibase:quantityUnit"--> v6
v3 --"p:qualifier/P585"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end