query-ea3ec54e3d3aaed708f4bbf5ed50eaf8

rq turtle/ttl

grouping problems (Bad aggregate)Hi @all, I definitly lack practice, so please bear with me: The data is the result of my survival project lasting thoughout the last lockdowns, and now I would like to harvest some of the first fruits ;-) … the query breaks with the grouping of the architects. I read about the group_concat bug, added 2 variables for grouping but it breaks anyway. I bet you see the problem in a second. Another open issue is the image, I know I've seen an example where the output was limited on 1 value, but I cannot find it.

Use at

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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT ?item ?itemLabel ?coords ?img (YEAR(?date) as ?year) (GROUP_CONCAT(DISTINCT ?architectLabel;separator=", ") AS ?architects)  WHERE {
  ?item wdt:P166 wd:Q1795794;
        p:P166 [ps:P166 ?award; pq:P585 ?date].            
  OPTIONAL{
    ?item wdt:P625 ?coords.
  }
  OPTIONAL{
    ?item wdt:P18 ?img. # might be more than one. I want the first one
  }
  OPTIONAL {
    ?item wdt:P84 ?architect. # up to 7 per ?item, needs grouping

  }
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de". }
} GROUP BY ?item ?itemLabel 
LIMIT 300

Query found at