Created
November 22, 2015 17:59
-
-
Save antoinecourtin/b350539328d9a01d4d05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX wd: <http://www.wikidata.org/entity/> | |
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |
PREFIX wikibase: <http://wikiba.se/ontology#> | |
PREFIX p: <http://www.wikidata.org/prop/> | |
PREFIX v: <http://www.wikidata.org/prop/statement/> | |
PREFIX q: <http://www.wikidata.org/prop/qualifier/> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
SELECT ?villeLabel (COUNT(distinct ?villeLabel) AS ?nombre) | |
WHERE { | |
?peintre wdt:P31 wd:Q5 . # ce sont des humains | |
?peintre wdt:P106* wd:Q1028181 . #qui occupent comme fonction peintre | |
?peintre wdt:P19 ?ville . #et qui sont né(e)s dans une ville | |
?peintre wdt:P569 ?datenaissance . #pour récupérer la date de naissance | |
?peintre wdt:P570 ?datemort . #pour récupérer la date de mort | |
?peintre wdt:P27 wd:Q142 . #qui sont de nationalité française | |
SERVICE wikibase:label { | |
bd:serviceParam wikibase:language "fr" . #on récupère les jolies labels plutôt que les Q | |
} | |
} GROUP BY ?villeLabel ORDER BY DESC(?nombre) #on les regroupe par ville et on récupère le nombre |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment