Code examples: curl
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 DISTINCT ?driver ?driverLabel ?pressure ?pressureLabel ?state ?stateLabel ?impact ?impactLabel ?response ?responseLabel WITH {
SELECT DISTINCT ?driver ?pressure ?state ?impact ?response WHERE {
?fact ^p:P3 / wdt:P1 wd:Q18 .
OPTIONAL { ?fact pq:P18 ?driver ; pq:P19 ?pressure }
OPTIONAL { ?fact pq:P19 ?pressure ; pq:P20 ?state }
OPTIONAL { ?fact pq:P20 ?state ; pq:P10 ?impact }
OPTIONAL { ?fact pq:P10 ?impact ; pq:P21 ?response }
}
} AS %PARAGRAPHS WHERE {
INCLUDE %PARAGRAPHS
BIND (COALESCE(?driver, ?pressure, ?state, ?impact, ?response) AS ?someDPSIR)
FILTER (BOUND(?someDPSIR))
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
curl -s https://raw.githubusercontent.com/egonw/IPCC-Queries/master/sparql/dpsir.rq \
| sed 's+<lang/>+en+' > dpsir.rq
curl -H "Accept: text/tab-separated-values" \
-G https://kg-ipclimatec-reports.wikibase.cloud/query/sparql \
--data-urlencode query@dpsir.rq
This SPARQL query is available under CCZero.