IPCC-Queries

regions.rq

Code examples: curl

SPARQL

PREFIX wdt: <https://kg-ipclimatec-reports.wikibase.cloud/prop/direct/>
PREFIX wd:  <https://kg-ipclimatec-reports.wikibase.cloud/entity/>
PREFIX p:   <https://kg-ipclimatec-reports.wikibase.cloud/prop/>
PREFIX pq:  <https://kg-ipclimatec-reports.wikibase.cloud/prop/qualifier/>

PREFIX rwdt: <http://www.wikidata.org/prop/direct/>

SELECT ?specialScope ?specialScopeLabel (COUNT(DISTINCT ?statement) AS ?count) WHERE {
  ?paragraph p:P3 ?statement .
  ?statement pq:P9 ?specialScope .
  ?specialScope wdt:P1 wd:Q42 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?specialScope ?specialScopeLabel
  ORDER BY DESC(?count)

run or edit

Output

specialScope count
Africa 5
South America 5
Arctic 5
Asia 4
Central America 4
Europe 3
Greenland ice sheet 2
Australasia 2
North America 2
West Antarctic Ice Sheet 1
Arctic sea 1
Northern Hemisphere 1
South Asia 1
East Africa 1

Code examples

curl

curl -s https://raw.githubusercontent.com/egonw/IPCC-Queries/master/sparql/regions.rq \
  | sed 's+<lang/>+en+' > regions.rq

curl -H "Accept: text/tab-separated-values" \
  -G https://kg-ipclimatec-reports.wikibase.cloud/query/sparql \
  --data-urlencode query@regions.rq

This SPARQL query is available under CCZero.