query-1ab506dd2139f1798ae4b6bce71da190
Double GROUP_CONCATHello, Why the double GROUP_CONCAT don't work? And it's possible to have a ORDER BY who follow the numeric order?
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?institution ?institutionLabel ?twitter (COUNT(distinct (?item)) AS ?total) (GROUP_CONCAT(DISTINCT(?LieuLabel); separator=", ") as ?Lieux) (GROUP_CONCAT(DISTINCT(?departementLabel); separator=", ") as ?departements) ?pop
WHERE
{
?institution wdt:P31/wdt:P279* wd:Q166118;
wdt:P17 wd:Q142.
OPTIONAL {?institution wdt:P2002 ?twitter .}
OPTIONAL {
?institution wdt:P131 ?Lieu.
OPTIONAL {?Lieu rdfs:label ?LieuLabel. filter(lang(?LieuLabel)="fr") }
?Lieu wdt:P131 ?departement.
?departement wdt:P31 wd:Q6465;
wdt:P1082 ?pop.
OPTIONAL {?departement rdfs:label ?departementLabel. filter(lang(?departementLabel)="fr") }
}
OPTIONAL {
?item wdt:P485 ?institution .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".}
}
group by ?institution ?institutionLabel ?twitter ?lieux ?departements ?pop
HAVING (?total < 5)
ORDER BY ?institution