Hello,
I have run into the problem that when I send a SPARQL request with a CONSTRUCT query to DBpedia programmatically (using Rob Vesse's dotNetRDF library; http://www.dotnetrdf.org) to obtain a result graph, DBpedia sends back the resulting graph in Turtle notation, but indicates the Content-Type as text/plain. (Which in turn leads to dotNetRDF wrongfully guessing that the graph is in N-Triples format, resulting in an exception thrown by the N-Triples parser that naturally cannot process Turtle.)

The accept header sent by dotNetRDF by default looks like this:

text/plain,text/ntriples,text/ntriples+turtle,application/rdf-triples,application/x-ntriples,text/plain,text/ntriples,text/ntriples+turtle,application/rdf-triples,application/x-ntriples,text/turtle,application/x-turtle,application/turtle,text/turtle,application/x-turtle,application/turtle,text/n3,text/rdf+n3,text/n3,text/rdf+n3,application/rdf+xml,text/xml,application/xml,application/rdf+xml,text/xml,application/xml,application/json,text/json,application/rdf+json,application/json,text/json,application/rdf+json,text/html,application/xhtml+xml,text/html,application/xhtml+xml,*/*;q=0.5

dotNetRDF does offer an option to override that default accept header, so when setting the accept header to
 
"application/turtle"
 
DBpedia correctly returns a Turtle graph and indicates the Content-Type as application/turtle.

Even if text/plain is also accepted as a response, why doesn't DBpedia indicate the actual Content-Type of the message format sent back, so clients know what they are supposed to parse? Is there any alternative recommended way of finding out what the format is when DBpedia sends back text/plain as the Content-Type?

Thanks & Regards
Florian
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to