Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@filbertkm
Last active February 11, 2016 20:44
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 filbertkm/3fef89d16f4ae384af1e to your computer and use it in GitHub Desktop.
Save filbertkm/3fef89d16f4ae384af1e to your computer and use it in GitHub Desktop.
number of museums per country
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?isoCode (count(*) as ?count) WHERE {
?place wdt:P31/wdt:P279* wd:Q33506 .
?place wdt:P17 ?country .
?country wdt:P297 ?isoCode
}
GROUP BY ?isoCode
ORDER BY (?isoCode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment