query-57b09c99a9fe0169764983723e2d664c
GROUP_CONCAT(DISTINCT) : display Label vs URIHello, How is it possible to display the Label of Lieu instead of the URI?
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (GROUP_CONCAT(DISTINCT(?Lieu); separator=", ") as ?Lieux)
WHERE
{
?item wdt:P31/wdt:P279* wd:Q166118;
wdt:P17 wd:Q142.
OPTIONAL {?item wdt:P131 ?Lieu.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".}
}
GROUP BY ?item ?itemLabel ?LieuxLabel
ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?Lieu"):::projected
v4("?Lieux")
v2("?item"):::projected
v1("?itemLabel"):::projected
a1((" "))
c3(["wd:Q166118"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c5(["wd:Q142"]):::iri
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P17"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P131".-> v3
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind1[/"?Lieu"/]
v3 --o bind1
bind1 --as--o v4