Utilisateur:Gz260/Routes/(F)/Wikidata/SPARQL

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?item ?itemLabel ?lieux WHERE {
  {
    SELECT DISTINCT ?item (GROUP_CONCAT(?l; separator = ', ') as ?lieux) WHERE {
      ?item wdt:P31 ?sub0 .
      ?sub0 (wdt:P279)* wd:Q34442 .
      ?item wdt:P17 wd:Q142 .
      OPTIONAL { ?item wdt:P131 ?local } .
      SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,nl" . ?local rdfs:label ?l }
    } GROUP BY ?item
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,nl" . }
} ORDER BY ?itemLabel

Cliquez pour essayer !