W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > December 2007

Re: wrong content type for sparql test suite files

From: Arjohn Kampman <arjohn.kampman@aduna-software.com>
Date: Wed, 19 Dec 2007 09:39:52 +0100
Message-ID: <4768D8D8.90509@aduna-software.com>
To: Eric Prud'hommeaux <eric@w3.org>
CC: 'RDF Data Access Working Group' <public-rdf-dawg-comments@w3.org>

Eric Prud'hommeaux wrote:
> * Arjohn Kampman <arjohn.kampman@aduna-software.com> [2007-12-12 20:36+0100]
>> Dear WG,
>>
>> The w3c server reports incorrect content types for the test suite files,
>> which causes my revised compliance test to fail. This is what w3.org
>> currently reports:
>>
>> .rq  --> text/plain
>> .ttl --> text/rdf+n3; qs=0.89
>> .srx --> text/plain
>>
>> I guess that the content type for .rq files is OK, but the other two are
>> not. Turtle files should either have application/turtle or
>> application/x-turtle, SPARQL result files should have
>> application/sparql-results+xml.
>>
>> So far, everything's OK for my compliance test as the turtle files are
>> happily parsed by the N3 parser. However, things go wrong with the i18n
>> tests. Turtle files in this directory are reported as
>> text/plain; charset=utf-8 instead.
> 
> of course, this media type is wrong, but out of curiousity, what mechanically went wrong when you GOT 

Our compliance test tool tries to determine the file type based on MIME
type or, if that fails, file extension. The MIME type text/plain is
resolved to N-Triples. The N-Tripes parser, of course, fails to parse
the turtle files.

>> Would it be possible to fix the the reported MIME type? Please at least
>> consider to change the type for the i18n Turtle files to be in
>> accordance with the rest of the Turtle files.
> 
> There was a broken .htaccess (courtesy of me, no doubt) in i18n:
> [[
> <Files ~ ".*.ttl">
> ForceType "text/plain; charset=utf-8"
> </Files>
> <Files ~ ".*.rq">
> ForceType "application/sparql-query; charset=utf-8"
> </Files>
> ]]
> 
> I created one for data-rq that appears to fix things:
> [[
> <Files ~ ".*\.srx$">
> ForceType 'application/sparql-results+xml'
> </Files>
> <Files ~ ".*\.ttl$">
> ForceType 'application/x-turtle'
> </Files>
> <Files ~ ".*\.rq$">
> ForceType 'application/sparql-query'
> </Files>
> ]]
> 
> and it appears to:
> [[
> $ for U in http://www.w3.org/2001/sw/DataAccess/tests/data-r2/{algebra/two-nested-opt.{ttl,rq,srx},i18n/kanji{.ttl,-01{.rq,-results.ttl}}}; do echo -n $U && (HEAD $U | grep ^Content-Type: | sed s/^Content-Type://1); done
> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/algebra/two-nested-opt.ttl application/x-turtle
> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/algebra/two-nested-opt.rq application/sparql-query
> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/algebra/two-nested-opt.srx application/sparql-results+xml
> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/i18n/kanji.ttl application/x-turtle
> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/i18n/kanji-01.rq application/sparql-query
> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/i18n/kanji-01-results.ttl application/x-turtle
> ]]

I just verified that this fixes my problems. Thanks a lot!

> Note that the media type for turtle is not yet registered and is subject
> to much text/ debate:
>   http://lists.w3.org/Archives/Public/www-archive/2007Dec/thread#msg65
>   http://www.alvestrand.no/pipermail/ietf-types/2007-December/thread.html#1949
>   http://www.alvestrand.no/pipermail/ietf-types/2007-December/thread.html#1945
> so it may change underneath you (as expected for x- media types).

I was expecting that. I'll just add another MIME type for Turtle to the
code when the time comes.

Great to see that Turtle has been submitted to W3C now, BTW. I hadn't
seen that before.


-- 
Arjohn Kampman, Senior Software Engineer
Aduna - Guided Exploration
www.aduna-software.com
Received on Wednesday, 19 December 2007 08:40:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:52 GMT