On 27/08/13 02:01, Holger Knublauch wrote:
I was too quick: with the latest SVN snapshot, the following test now
fails:
Model owlrl = ModelFactory.createDefaultModel();
owlrl.read("http://topbraid.org/spin/owlrl");
I believe it should work, because that file is stored in RDF/XML, plus
Model.read(url) should use RDF/XML.
Holger,
Please can we have a complete set of examples?
(And a description of "fails".)
There was logic bug which I've just fixed. A set of tests have gone in
as well : TestSynatxDetermination.
But let's look at the bigger picture. There is something going on here
- it's to do with RDF 1.1.
Model.read(url) can not assume RDF/XML regardless anymore.
Come RDF 1.1 there is no one unique RDF serialization; previously, there
was RDF/XML. I expect Turtle to overtake RDF/XML.
Jena does not know what "owlrl" might be. In fact, earlier in this
thread, you have an example where you store what was RDF/XML as TTL (my
question on this is still outstanding).
The server is returning "text/plain" [*] and the URL has no file
extension. You have been relying on Jena's local behaviour which
reflected the old world and has been increasing dubious for sometime.
Many Turtle files are serves as text/plain; to some people, text/plain
is N-triples. Current behaviour may change - whatever reduces support
costs.
The best fix for you is to fix content negotiation at the server.
The accept header used by Jena is nowadays:
"text/turtle,application/n-triples;q=0.9,application/rdf+xml;q=0.8,application/xml;q=0.7,*/*;q=0.5
Andy
[*] Your server's content negotiation is bizarre.
The server is not doing content negotiation. Worse, it does different
things depending on the user agent - using wget gives different conneg
to using curl! curl, mimicking wget, behaves like wget!!
Details below but in summary:
wget -> text/plain and content, regardless of accept header
curl -> 406
wget accept for RDF/XML => text/plain and content
curl, accept for RDF/XML => 406
curl, user-agent set to "Wget" => text/plain and content, regardless of
accept header
-------------------
~ >> curl -v http://topbraid.org/spin/owlrl > /dev/null
==>
GET /spin/owlrl HTTP/1.1
User-Agent: curl/7.29.0
Host: topbraid.org
Accept: */*
< HTTP/1.1 406 Not Acceptable
< Date: Tue, 27 Aug 2013 10:36:37 GMT
< Server: Apache
< Content-Length: 323
< Content-Type: text/html; charset=iso-8859-1
<
-------------------
but
wget -d http://topbraid.org/spin/owlrl
---request begin---
GET /spin/owlrl HTTP/1.1
User-Agent: Wget/1.14 (linux-gnu)
Accept: */*
Host: topbraid.org
Connection: Keep-Alive
---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.1 200 OK
Date: Tue, 27 Aug 2013 10:37:33 GMT
Server: Apache
Last-Modified: Mon, 02 Jul 2012 06:55:42 GMT
Accept-Ranges: bytes
Content-Length: 219311
Keep-Alive: timeout=3, max=100
Connection: Keep-Alive
Content-Type: text/plain
-------------------------------
BUT:
curl -v --header 'User-Agent: Wget' http://topbraid.org/spin/owlrl >
/dev/null
-------------------------------
Host: topbraid.org
Accept: */*
User-Agent: Wget
< HTTP/1.1 200 OK
< Date: Tue, 27 Aug 2013 10:41:20 GMT
< Server: Apache
< Last-Modified: Mon, 02 Jul 2012 06:55:42 GMT
< Accept-Ranges: bytes
< Content-Length: 219311
< Content-Type: text/plain
-------------------------------
Thanks,
Holger