Re: Help with Musicbrainz

Terry,

How exactly are you submitting your HTTP request? What did you do in  
order to obtain the error message? I get the same message when I  
remove the closing angle bracket on the rdf: namespace URI, or when I  
insert whitespace anywhere in that URI. Did any of these things happen  
by chance?

(Kurt: It's probably not a problem with escaping the brackets, the  
"<" bit is just because the web server tries to respond with an  
error message in HTML, and therefore the web server escapes the  
brackets in the error message. This doesn't mean they were encoded in  
the request.)

Best,
Richard


On 25 Aug 2009, at 00:42, Terry Brooks wrote:

> I'm trying to build a query for Musicbrainz.
>
> At the SPARQL explorer for Musicbrainz,   (http://dbtune.org/musicbrainz/snorql/ 
>   )this query works:
>
> ==== SNIP =========
>
> SELECT ?type WHERE {
> ?name foaf:name 'Screwtape' . ?name rdf:type ?type .
> }
>
> =============
>
> but  when I try an HTTP request to the SPARQL endpoint ("http://dbtune.org/musicbrainz/sparql 
> ";) with the following query, I must  include PREFIX:
>
> "prefix foaf: <http://xmlns.com/foaf/0.1/>  prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns# 
> >  SELECT ?type WHERE { ?name foaf:name 'Screwtape' . ?name  
> rdf:type ?type  }";
>
> and I get a parsing error that seems to indicate some parsing  
> problem with the angle brackets:
>
> ====== SNIP ============
>
> <title>Error 400 Parse error:
> prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt;  prefix rdf:  &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns
>
> Encountered "&lt;" at line 1, column 57.
> Was expecting:
>    &lt;IRIref&gt; ...
>    </title>
> </head>
>
> ===============
>
> Does someone have a working example of an HTTP request to the SPARQL  
> endpoint to Musicbrainz that includes more than one PREFIX that  
> finesses the angle brackets problem?
>
> Thanks,
>
>
> Terry Brooks
> Information School
> Suite 370, Mary Gates Hall
> Box 352840
> Seattle, WA 98195-2840
>
>
>
>

Received on Tuesday, 25 August 2009 10:41:12 UTC