I have this SPARQL code that is meant to work on Wikidata:
SELECT
?game
(group_concat(distinct ?gameLabel ; separator = ", ") AS ?gameLabels)
(group_concat(distinct ?genreLabel ; separator = ", ") AS ?genreLabels)
WHERE {
?game wdt:P31 wd:Q7889;
wdt:P136 wd:Q744038.
OPTIONAL {?game wdt:P136 ?genre}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en".
?game rdfs:label ?gameLabel.
?genre rdfs:label ?genreLabel.
}
}
GROUP BY $game
ORDER BY ASC (?gameLabels)
You can test the code here:
Suppose that ?genreLabel
is always lower case by default. How do I capitalize the first letter of each returned value? Thanks.