query-10156e6491c9a1c85781bf9af3ad67d9
Combing lists of images into one stringI want to select the different sorts of images from an article and gather them into one comma separated string, something like the following, only that works, my problem is that while I can GROUP_CONCAT individual properties, I can't combine the results into a list
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item (GROUP_CONCAT(something; SEPARATOR = ", ") AS ?images WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-GB,en". }
{
SELECT DISTINCT ?item something WHERE {
?item p:P31 ?statement0.
?statement0 (ps:P31/(wdt:P279*)) wd:Q23413.
?item p:P7959 ?statement1.
?statement1 (ps:P7959/(wdt:P279*)) wd:Q67479626.
OPTIONAL {?item wdt:P18 ?images1}
OPTIONAL {?item wdt:P3311 ?images2}
}
}
}
GROUP BY ?item