IPCC-Queries

impacts.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/>

SELECT ?impact ?impactLabel (COUNT(DISTINCT ?statement) AS ?count) WHERE {
  ?paragraph p:P3 ?statement .
  ?statement pq:P10 ?impact .
  ?impact wdt:P1/wdt:P6* wd:Q41 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?impact ?impactLabel
  ORDER BY DESC(?count)

run or edit

Output

impact count
reduced food security 1
affected water security 1

Code examples

curl

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

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

This SPARQL query is available under CCZero.