Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
another content negotiation question
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Juan Sequeda  
View profile  
 More options Jul 15 2009, 9:43 am
From: Juan Sequeda <juanfeder...@gmail.com>
Date: Wed, 15 Jul 2009 15:43:52 +0200
Local: Wed, Jul 15 2009 9:43 am
Subject: another content negotiation question

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 "...."

}

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ted Thibodeau Jr  
View profile  
 More options Jul 15 2009, 10:06 am
From: Ted Thibodeau Jr <tthibod...@openlinksw.com>
Date: Wed, 15 Jul 2009 10:06:57 -0400
Local: Wed, Jul 15 2009 10:06 am
Subject: Re: another content negotiation question
Juan --

On Jul 15, 2009, at 09:43 AM, Juan Sequeda wrote:

I think that's not a content negotiation issue, but rather a resource
specification issue.

/id/ is a directory, and you're actually asking for the Directory Index.
The specific resource will typically be something like /id/index.html,
and be determined by the server.

/id is a specific resource -- though some servers may rewrite it to
/id/ if there is such a directory and no such resource -- as yours
appears to be doing.

Or have I misunderstood?

Ted

--
A: Yes.                      http://www.guckes.net/faq/attribution.html
| Q: Are you sure?
| | A: Because it reverses the logical flow of conversation.
| | | Q: Why is top posting frowned upon?

Ted Thibodeau, Jr.           //               voice +1-781-273-0900 x32
Evangelism & Support         //        mailto:tthibod...@openlinksw.com
OpenLink Software, Inc.      //              http://www.openlinksw.com/
                                  http://www.openlinksw.com/weblogs/uda/
OpenLink Blogs              http://www.openlinksw.com/weblogs/virtuoso/
                                http://www.openlinksw.com/blog/~kidehen/
     Universal Data Access and Virtual Database Technology Providers


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Juan Sequeda  
View profile  
 More options Jul 15 2009, 10:15 am
From: Juan Sequeda <juanfeder...@gmail.com>
Date: Wed, 15 Jul 2009 16:15:35 +0200
Local: Wed, Jul 15 2009 10:15 am
Subject: Re: another content negotiation question

On Wed, Jul 15, 2009 at 4:06 PM, Ted Thibodeau Jr <tthibod...@openlinksw.com

I guess that is a good way to put it.. but it "appears" to be a content
negotiation issue.

> /id/ is a directory, and you're actually asking for the Directory Index.
> The specific resource will typically be something like /id/index.html,
> and be determined by the server.

Yup. In this case, it is an index.php file

> /id is a specific resource -- though some servers may rewrite it to
> /id/ if there is such a directory and no such resource -- as yours
> appears to be doing.

The server does rewrite it if you put it in your browser. But if I do for
example

curl -v -H "Accept: application/rdf+xml" http://www.juansequeda.com/id/
curl -v -H "Accept: text/html" http://www.juansequeda.com/id/

I get RDF and HTML respectively back. That is why I say it acts like content
negotiation. However if I do

curl -v -H "Accept: application/rdf+xml" http://www.juansequeda.com/id

I get the 301 back.

I'm just wondering if this is something that is frown upon or something? I
have always seen discussion about hash uri and 303, but not about this
approach.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher St John  
View profile  
 More options Jul 15 2009, 10:16 am
From: Christopher St John <ckstj...@gmail.com>
Date: Wed, 15 Jul 2009 09:16:32 -0500
Local: Wed, Jul 15 2009 10:16 am
Subject: Re: another content negotiation question

Well, if it's not pseudo-code, there's a small bug in that the content-type
can contain a ranked list of acceptable formats, so checking for the
exact string may fail. I assume that really wasn't the point, though :-)

More on topic, I think the scenario would be:

 - Install the "I (Heart) LinkedData" browser extension
 - Surf to http://www.juansequeda.com/id
 - Hit the "I like this" button

How can the extension tell if you're talking about Juan Sequeda,
the person, vs the web page? Maybe I like your page and really
don't like you very much at all. Or the other way 'round.

The "What do HTTP URIs Identify?" writeup seems pretty
exhaustive in going through the options and the various associated
compromises (I suspect this one is 2.2 "Author Definition"[1], but
I could be wrong).

-cks

[1] http://www.w3.org/DesignIssues/HTTP-URI.html#L876

--
Christopher St. John
http://artofsystems.blogspot.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Cyganiak  
View profile  
 More options Jul 15 2009, 10:20 am
From: Richard Cyganiak <rich...@cyganiak.de>
Date: Wed, 15 Jul 2009 16:20:36 +0200
Local: Wed, Jul 15 2009 10:20 am
Subject: Re: another content negotiation question
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Juan Sequeda  
View profile  
 More options Jul 15 2009, 10:28 am
From: Juan Sequeda <juanfeder...@gmail.com>
Date: Wed, 15 Jul 2009 16:28:40 +0200
Local: Wed, Jul 15 2009 10:28 am
Subject: Re: another content negotiation question

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 <rich...@cyganiak.de>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hugh Glaser  
View profile  
 More options Jul 15 2009, 10:33 am
From: Hugh Glaser <h...@ecs.soton.ac.uk>
Date: Wed, 15 Jul 2009 15:33:34 +0100
Local: Wed, Jul 15 2009 10:33 am
Subject: Re: another content negotiation question
It is not necessarily a good way.
But if you must, a better way of doing the first line is
(as in http://www.rkbexplorer.com/blog/?p=11)
    if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/rdf+xml') !== false) {
Now others can address the 303/# issues if they feel like it...
Best
Hugh

On 15/07/2009 15:16, "Christopher St John" <ckstj...@gmail.com> wrote:

Well, if it's not pseudo-code, there's a small bug in that the content-type
can contain a ranked list of acceptable formats, so checking for the
exact string may fail. I assume that really wasn't the point, though :-)

More on topic, I think the scenario would be:

 - Install the "I (Heart) LinkedData" browser extension
 - Surf to http://www.juansequeda.com/id
 - Hit the "I like this" button

How can the extension tell if you're talking about Juan Sequeda,
the person, vs the web page? Maybe I like your page and really
don't like you very much at all. Or the other way 'round.

The "What do HTTP URIs Identify?" writeup seems pretty
exhaustive in going through the options and the various associated
compromises (I suspect this one is 2.2 "Author Definition"[1], but
I could be wrong).

-cks

[1] http://www.w3.org/DesignIssues/HTTP-URI.html#L876

--
Christopher St. John
http://artofsystems.blogspot.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »