Skip to content

Instantly share code, notes, and snippets.

@edouardhue
Last active March 12, 2017 11:10
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 edouardhue/b67e44ef3b2b1bdc059b73b929e23888 to your computer and use it in GitHub Desktop.
Save edouardhue/b67e44ef3b2b1bdc059b73b929e23888 to your computer and use it in GitHub Desktop.
Voies et lieux-dits de Rennes avec Fantoir
# Nombre de voies et lieux-dits à Rennes, dont nombre ayant un code Fantoir renseigné
SELECT ?natureLabel (COUNT(?lieu) AS ?Nombre) (COUNT(?fantoir) AS ?Fantoir)
WHERE {
?lieu wdt:P31 ?nature ;
wdt:P131 wd:Q647 . # à Rennes
{ ?lieu wdt:P31/wdt:P279* wd:Q181307 } # Lieu-dit
UNION
{ ?lieu wdt:P31/wdt:P279* wd:Q83620 } # Voie de communication
OPTIONAL {
?lieu wdt:P3182 ?fantoir ;
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr"
}
}
GROUP BY ?natureLabel
ORDER BY DESC(?Fantoir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment