W3C home > Mailing lists > Public > public-lod@w3.org > February 2013

Re: Content negotiation for Turtle files

From: Chris Beer <chris@codex.net.au>
Date: Wed, 6 Feb 2013 20:56:55 +1100
Message-ID: <a3630338dfd2ba98a53537309dae259c.squirrel@webmail.codex.net.au>
To: "Ivan Herman" <ivan@w3.org>
Cc: "Bernard Vatant" <bernard.vatant@mondeca.com>, "Linking Open Data" <public-lod@w3.org>
Bernard, Ivan

(At last! Something I can speak semi-authoritatively on ;P )

@ Bernard - no - there is no reason to go back if you do not want to, and
every reason to serve both formats plus more.

Your comment about UA's complaining about a content negotiation issue is
key to what you're trying to do here. I'd like to provide some clear
guidance or suggestions back, but first, if possible, can you please post
the http request headers for the four (and any others you have) user
agents you've used to attempt to request your rdf+xml files and which have
either choked or accepted the .ttl file. Extra points if you can also post
the server's response headers.

@ Ivan - while I wince a little at the trick - the question comes down to
the same thing - what is the http response header that is sent back to the
client - would be interested to see if in fact what you're doing ISN'T a
"trick" but in fact a compliant way to approach this.

Personally I think you shouldn't actually need to resort to using .var
(which is Apache specific) when what is essentially a content negotiation
issue can simply be configured properly at the server level and thus a
single approach could be used by IIS, Apache, nginx etc.

Look forward to the responses (excuse the pun)

Cheers

Chris

--------------

Chris Beer
Manager - Online Services
Department of Regional Australia, Local Government, Arts and Sport

> Bernard,
>
> (forget my W3C hat, I am not authoritative on Apache tricks, for
> example...)
>
> When I put up a vocabulary onto www.w3.org/ns/, for example, I publish it
> both in ttl and rdf/xml. Actually, we also publish the file in HTML+RDFa
> (which very often is the master copy and I convert it into ttl and rdf/xml
> before publishing). Additionally, we put there a .var file. This is the
> .var file for the http://www.w3.org/ns/r2rml:
>
> r2rml.var
> ---------
> URI: r2rml
>
> URI: r2rml.html
> Content-Type: text/html
>
> URI: r2rml.rdf
> Content-Type: application/rdf+xml; qs=0.4
>
> URI: r2rml.ttl
> Content-Type: text/turtle; qs=0.5
>
> that seems to work well, at least I have not heard complaints:-)
>
> One can do a further trick by adding to .htaccess entries to convert, say,
> r2rml.html to r2rml.ttl on the fly; I did not do that to reduce the load
> on our servers.
>
> There is somewhere a flag in the apache configuration allowing apache to
> handle these .var files; I am not sure it is there by default.
>
> I hope this helps
>
> Ivan
>
>
>
>
>
> On Feb 6, 2013, at 24:49 , Bernard Vatant <bernard.vatant@mondeca.com>
> wrote:
>
>> Hello all
>>
>> Back in 2006, I thought had understood with the help of folks around
>> here, how to configure my server for content negotiation at lingvoj.org.
>> Both vocabulary and instances were published in RDF/XML.
>>
>> I updated the ontology last week, and since after years of happy living
>> with RDF/XML people eventually convinced that it was a bad, prehistoric
>> and ugly syntax, I decided to be trendy and published the new version in
>> Turtle at http://www.lingvoj.org/ontology_v2.0.ttl
>>
>> The vocabulary URI is still the same : http://www.lingvoj.org/ontology,
>> and the namespace  http://www.lingvoj.org/ontology# (cool URI don't
>> change)
>>
>> Then I turned to Vapour to test this new publication, and found out that
>> to be happy with the vocabulary URI it has to find some answer when
>> requesting application/rdf+xml. But since I have no more RDF/XML file
>> for this version, what should I do?
>> I turned to best practices document at
>> http://www.w3.org/TR/swbp-vocab-pub, but it does not provide examples
>> with Turtle, only RDF/XML.
>>
>> So I blindly put the following in the .htaccess : AddType
>> application/rdf+xml .ttl
>> I found it a completely stupid and dirty trick ... but amazigly it makes
>> Vapour happy.
>>
>> But now Firefox chokes on http://www.lingvoj.org/ontology_v2.0.ttl
>> because it seems to expect a XML file. Chrome has not this issue.
>> The LOV-Bot says there is a content negotiation issue and can't get the
>> file. So does Parrot.
>>
>> I feel dumb, but I'm certainly not the only one, I've stumbled upon a
>> certain number of vocabularies published in Turtle for which the conneg
>> does not seem to be perfectly clear either.
>>
>> What do I miss, folks? Should I forget about it, and switch back to good
>> ol' RDF/XML?
>>
>> Bernard
>>
>> --
>> Bernard Vatant
>> Vocabularies & Data Engineering
>> Tel :  + 33 (0)9 71 48 84 59
>> Skype : bernard.vatant
>> Blog : the wheel and the hub
>> --------------------------------------------------------
>> Mondeca
>> 3 cité Nollez 75018 Paris, France
>> www.mondeca.com
>> Follow us on Twitter : @mondecanews
>> ----------------------------------------------------------
>>
>> Meet us at Documation in Paris, March 20-21
>>
>>
>
>
> ----
> Ivan Herman, W3C Semantic Web Activity Lead
> Home: http://www.w3.org/People/Ivan/
> mobile: +31-641044153
> FOAF: http://www.ivan-herman.net/foaf.rdf
>
>
>
>
>
>
Received on Wednesday, 6 February 2013 09:57:23 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 31 March 2013 14:24:46 UTC