Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KasperBrandt/6107184 to your computer and use it in GitHub Desktop.
Save KasperBrandt/6107184 to your computer and use it in GitHub Desktop.
SPARQL query for retrieving country codes and activity counts per country. Should be performed on the IATI endpoint: http://eculture.cs.vu.nl:1987/iati/user/query
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX iati: <http://purl.org/collections/iati/>
SELECT ?countrycode (COUNT(?activity) AS ?count)
WHERE {
?activity a iati:activity .
?activity iati:activity-recipient-country ?country .
?country iati:country-code ?code .
?code iati:code ?countrycode
} GROUP BY ?countrycode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment