IPCC-Queries

pressures.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 ?pressure ?pressureLabel (COUNT(DISTINCT ?statement) AS ?count) WHERE {
  ?paragraph p:P3 ?statement .
  ?statement pq:P19 ?pressure .
  ?pressure wdt:P1/wdt:P6* wd:Q285 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?pressure ?pressureLabel
  ORDER BY DESC(?count)

run or edit

Output

pressure count
greenhouse gas emission 8
CO₂ emission 4
aerosol emissions 2
methane emission 1

Code examples

curl

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

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

This SPARQL query is available under CCZero.