Récupérations des données WikiData

Exemples

Fiche wikidata (pour les humains)

Données wikidata (pour les ordinateurs)

Logiciels

Collectivités


exemple requête sur query.wikidata.org :

Régions

# Régions
SELECT DISTINCT ?region ?regionLabel ?population ?OpenStreetMap ?site_officiel ?code_INSEE ?carte_de_localisation ?image_du_logo 
?Twitter WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr". }
  ?region wdt:P31 wd:Q36784.
  OPTIONAL { ?region wdt:P2585 ?code_INSEE. }
  OPTIONAL { ?region wdt:P1082 ?population. }
  OPTIONAL { ?region wdt:P402 ?OpenStreetMap. }
  OPTIONAL { ?region wdt:P242 ?carte_de_localisation. }
  OPTIONAL { ?region wdt:P856 ?site_officiel. }
  OPTIONAL { ?region wdt:P154 ?image_du_logo. }
  OPTIONAL { ?region wdt:P2002 ?Twitter. }
}
LIMIT 100

Départements

# Départements
SELECT DISTINCT ?departement ?code_INSEE ?departementLabel ?population ?OpenStreetMap ?carte_de_localisation ?locationMap ?geoshape WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr". }
  ?departement wdt:P31 wd:Q6465;
    wdt:P2586 ?code_INSEE.
  OPTIONAL { ?departement wdt:P1082 ?population. }
  OPTIONAL { ?departement wdt:P402 ?OpenStreetMap. }
  OPTIONAL { ?departement wdt:P242 ?carte_de_localisation. }
  OPTIONAL { ?departement wdt:P1943 ?locationMap. }
  OPTIONAL { ?departement wdt:P3896 ?geoshape. }
}
ORDER BY (?code_INSEE)
LIMIT 125

Départements de la région Ile de France

# Départements de la région Ile de France
SELECT DISTINCT ?departement ?code_INSEE ?departementLabel ?population ?OpenStreetMap  WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr". }
  ?departement wdt:P31 wd:Q6465.
  ?departement wdt:P131 wd:Q13917.
  ?departement wdt:P2586 ?code_INSEE.
  OPTIONAL { ?departement wdt:P1082 ?population. }
  OPTIONAL { ?departement wdt:P402 ?OpenStreetMap. }
}
ORDER BY (?code_INSEE)
LIMIT 100

Population of cities and towns in France and their OSM relation id

# Population of cities and towns in France and their OSM relation id
SELECT DISTINCT ?city ?cityLabel ?population ?OSM_relation_ID WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr". }
  VALUES ?town_or_city {
    wd:Q3957
    wd:Q515
  }
  ?city (wdt:P31/(wdt:P279*)) ?town_or_city;
    wdt:P17 wd:Q142.
  OPTIONAL { ?city wdt:P1082 ?population. }
  OPTIONAL { ?city wdt:P402 ?OSM_relation_ID. }
}
LIMIT 100

autres exemples :


Ressources


voir aussi : #772

Edited by Fabrice Gangler