title: DBpedia SPARQL - getting image and resource link of other artists?
body: <p>Given a musical artist, I am trying to find other musical artists who have the most common "associatedActs of" with a particular artist. I have the following query for Eminem and it works fine</p>
  
  <pre><code>SELECT ?c (COUNT(*) AS ?count) WHERE {
  {
  ?b &lt;http://dbpedia.org/property/associatedActs&gt; &lt;http://dbpedia.org/resource/Eminem&gt;.
  ?b &lt;http://dbpedia.org/property/associatedActs&gt; ?
  }
  }group by ?c order by desc(?count) LIMIT 10
  </code></pre>
  
  <p>But I would like to get back the picture of the artist as well as their dbpedia resource link (?c) adding. Trying this</p>
  
  <pre><code>SELECT ?c (COUNT(*) AS ?count) WHERE {
  {
  ?b &lt;http://dbpedia.org/property/associatedActs&gt; &lt;http://dbpedia.org/resource/Eminem&gt;.
  ?b &lt;http://dbpedia.org/property/associatedActs&gt; ?c.
  ?c &lt;http://dbpedia.org/ontology/thumbnail&gt; ?i
  }
  }group by ?c order by desc(?count) LIMIT 10
  </code></pre>
  
  <p>gives me an error "Variable ?i is used in the result set outside aggregate and not mentioned in GROUP BY clause". If i groupby by i it works fine but I can't get ?c back.</p>
  
  <p>So how can I get the picture and the resource link other matching artists?</p>