title: simple sparql query from dbpedia
body: <p>I have a question about a SPARQL query that I'm trying to build from a tutorial. I want to generate triples that return a list of band members and the bands that they are in using a DBPedia endpoint. </p>
  
  <p><a href="http://dbpedia.org/snorql/?query=PREFIX%20dbo%3A%20%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0APREFIX%20dbp%3A%20%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2F%3E%0D%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0A%0D%0ASELECT%20%3Fname%20%3Fbandname%20where%20%7B%0D%0A%3Fperson%20foaf%3Aname%20%3Fname%20.%0D%0A%3Fband%20dbo%3AbandMember%20%3Fperson%20.%0D%0A%3Fband%20dbo%3Agenre%20dbpedia%3APunk_rock%20.%0D%0A%3Fband%20dbp%3Aname%20%3Fbandname%20.%0D%0A%7D" rel="noreferrer">my query</a></p>
  
  <pre><code>PREFIX dbo: &lt;http://dbpedia.org/ontology/&gt;
  PREFIX dbp: &lt;http://dbpedia.org/resource/&gt;
  PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
  
  SELECT ?name ?bandname where {
  ?person foaf:name ?name .
  ?band dbo:bandMember ?person .
  ?band dbo:genre dbpedia:Punk_rock .
  ?band dbp:name ?bandname .
  }
  </code></pre>
  
  <p>I'm also using a [SPARQL query validator][2] to try to figure out my problem and it seems I'm using an incorrect prefix for "dbp:name ?bandname"I just want the triples returned in JSON if possible. </p>
  
  <p>Once I can get this to run, I'd like to add another prefix, from GeoNames, to see the places associated with the bands, if possible (but that part is in the future). Any insights would be greatly appreciated!</p>