IPCC-Queries

sectionsWithStatements.rq

Code examples: curl

SPARQL

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

SELECT DISTINCT ?section ?sectionLabel (COUNT(?statement) AS ?count) WHERE {
  ?section wdt:P1 wd:Q18 ;
           wdt:P3 ?statement .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?section ?sectionLabel
  ORDER BY DESC(?count)

run or edit

Output

section count
2.1.2.c 11
2.1.2.l 10
3.1.3.b 9
2.1.2.d 7
4.9.c 6
2.1.1.h 5
3.1.1.h 5
2.1.1.b 4
2.3.2.b 4
3.1.1.f 4
2.1.2.a 3
2.1.1.a 2
4.9.d 2
2.1.1.g 1
2.1.1.i 1
4.1.f 1
2.1.1.e 1

Code examples

curl

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

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

This SPARQL query is available under CCZero.