IPCC-Queries

ecosystems.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:P6 wd:Q32 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?specialScope ?specialScopeLabel
  ORDER BY DESC(?count)

run or edit

Output

specialScope count
terrestrial ecosystem 1
freshwater ecosystem 1
cryospheric ecosystem 1
coastal ecosystem 1
open ocean ecosystem 1

Code examples

curl

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

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

This SPARQL query is available under CCZero.