W3C home > Mailing lists > Public > public-lod@w3.org > July 2009

Re: another content negotiation question

From: Juan Sequeda <juanfederico@gmail.com>
Date: Wed, 15 Jul 2009 16:28:40 +0200
Message-ID: <f914914c0907150728k5f62f2c8h284271a9048dd0c7@mail.gmail.com>
To: Richard Cyganiak <richard@cyganiak.de>
Cc: public-lod <public-lod@w3.org>
The content part was just to make my point.. of a simple if statement.

But now it's crystal clear. It's much complicated... that I wish. And that
is sad.

Thanks

<end of thread>

Juan Sequeda, Ph.D Student
Dept. of Computer Sciences
The University of Texas at Austin
www.juansequeda.com
www.semanticwebaustin.org


On Wed, Jul 15, 2009 at 4:20 PM, Richard Cyganiak <richard@cyganiak.de>wrote:

> Hi Juan,
>
> On 15 Jul 2009, at 15:43, Juan Sequeda wrote:
>
>> and the objective is not to start another long philosophical thread :P and
>> it may be a very dumb question
>>
>> What are the drawbacks of this simple solution.
>>
>> in PHP for example:
>>
>> if($_SERVER['HTTP_ACCEPT'] == "application/rdf+xml" ){
>>   header('Content-type: application/rdf+xml');
>>   echo "......."
>> }
>> else{
>>   echo "...."
>> }
>>
>
> A typical Accept header sent by an RDF client can look like this:
>
> text/html;q=0.3, application/xhtml+xml;q=0.3, text/plain;q=0.1,
> text/rdf+n3, text/n3, application/n3, application/x-turtle,
> application/turtle, text/turtle, application/rdf+xml, text/rdf,
> text/rdf+xml, application/rdf, application/xml;q=0.2, text/xml;q=0.2
>
> A typical Accept header sent by a Web browser can look like this:
>
>
> application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
>
> As you can see, your code above will not work. You really need a proper
> implementation of content negotiation rather than such simplistic hacks.
>
> Vapour just checks some very simple cases. A green light from Vapour does
> not necessarily mean that your content negotiation works with any real
> client. (Unfortunately! I wish it was better at validating conneg.)
>
> (The former header is from the any23 library in default configuration. The
> latter is from Safari. Note that modern RDF clients can consume several RDF
> syntaxes, including RDFa.)
>
> About the "/id/" vs. "/id" thing. This behaviour is more or less hardcoded
> in Apache and similar web servers. After you follow the 301 redirect at
> "/id", you get the same 200 at "/id/". Essentially this means that "/id/"
> and "/id" identify the same resource, and that resource is a document.
>
> Best,
> Richard
>
>
>
>
>> I did this at http://www.juansequeda.com/id/
>>
>> However, there is a difference when it is /id and /id/. When I dereference
>> http://www.juansequeda.com/id I get a 301 (Moved Permanently) but with
>> http://www.juansequeda.com/id/ I get 200 (and everything validated by
>> Vapour!).
>>
>> As this ever been discussed? I can obviously see the drawback of having
>> /id/
>> vs /id .
>>
>> Comments?
>>
>> Juan Sequeda, Ph.D Student
>> Dept. of Computer Sciences
>> The University of Texas at Austin
>> www.juansequeda.com
>> www.semanticwebaustin.org
>>
>
>
Received on Wednesday, 15 July 2009 14:29:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:20:50 UTC