Hi again,

We did some more tests against DBpedia resources on our framework, it
looks like DBpedia does not do content negotiation properly in case it
does not support the client requested MIME-type:

curl -v -H "Accept: text/turtle" http://dbpedia.org/resource/Tim_Berners-Lee
* About to connect() to dbpedia.org port 80 (#0)
*   Trying 194.109.129.58...
* connected
* Connected to dbpedia.org (194.109.129.58) port 80 (#0)
> GET /resource/Tim_Berners-Lee HTTP/1.1
> User-Agent: curl/7.25.0 (x86_64-apple-darwin11.3.0) libcurl/7.25.0
OpenSSL/1.0.1b zlib/1.2.7 libidn/1.22
> Host: dbpedia.org
> Accept: text/turtle
>
< HTTP/1.1 303 See Other
< Date: Wed, 30 May 2012 20:03:31 GMT
< Content-Type: text/html; charset=UTF-8
< Connection: keep-alive
< Server: Virtuoso/06.04.3132 (Linux) x86_64-generic-linux-glibc25-64  VDB
< Location: http://dbpedia.org/page/Tim_Berners-Lee
< Content-Length: 0
<
* Connection #0 to host dbpedia.org left intact
* Closing connection #0

The "303 see other" is wrong in this case, it should instead return a
"406 not acceptable". Otherwise the client expects that he gets the
requested MIME-type at the other location. With 406 it could return the
HTML type as "alternates", that would be correct.

see:

https://developer.mozilla.org/en/HTTP/Content_negotiation
https://developer.mozilla.org/en/HTTP/HTTP_response_codes#406

If I do it with a list of supported MIME-types (including one which is
returned by DBpedia) it is correct:

% curl -v -H "Accept: text/turtle,application/rdf+xml"
http://dbpedia.org/resource/Tim_Berners-Lee
* About to connect() to dbpedia.org port 80 (#0)
*   Trying 194.109.129.58...
* connected
* Connected to dbpedia.org (194.109.129.58) port 80 (#0)
> GET /resource/Tim_Berners-Lee HTTP/1.1
> User-Agent: curl/7.25.0 (x86_64-apple-darwin11.3.0) libcurl/7.25.0
OpenSSL/1.0.1b zlib/1.2.7 libidn/1.22
> Host: dbpedia.org
> Accept: text/turtle,application/rdf+xml
>
< HTTP/1.1 303 See Other
< Date: Wed, 30 May 2012 20:15:07 GMT
< Content-Type: application/rdf+xml; qs=0.95
< Connection: keep-alive
< Server: Virtuoso/06.04.3132 (Linux) x86_64-generic-linux-glibc25-64  VDB
< Accept-Ranges: bytes
< TCN: choice
< Vary: negotiate,accept
< Content-Location: /data/Tim_Berners-Lee.xml
< Link:
<http://mementoarchive.lanl.gov/dbpedia/timegate/http://dbpedia.org/resource/Tim_Berners-Lee>;
rel="timegate"
< Location: http://dbpedia.org/data/Tim_Berners-Lee.xml
< Content-Length: 0
<
* Connection #0 to host dbpedia.org left intact
* Closing connection #0

So now it redirects me with 303 to the rdf+xml version, which is an
accepted MIME-type from the client.

BTW I found it correctly described on a Virtuoso page ;)

http://virtuoso.openlinksw.com/whitepapers/VirtDeployingLinkedDataGuide_Introduction.html

BTW2 any reasons that turtle is not supported? IMHO rdf+xml has to
become extinct and replaced by turtle. Today someone asked me if they
have to learn XML first to understand RDF because many samples in RDF
books are in RDF/XML. That does not help adoption of RDF in the real
world ;)

cu

Adrian


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to