On 10/21/13 4:52 PM, Daniel Kinzler wrote:
Am 21.10.2013 16:48, schrieb Kingsley Idehen:
Can someone not change 302 to 303 re: RewriteRule ^/entity/(.*)$
https://www.wikidata.org/wiki/Special:EntityData/$1 [R=302,QSA] ?

The thing is that we intended this to be an internal apache rewrite, not a HTTP
redirect at all. Because Special:EntityData itself implements the content
negotiation that triggers a 303 when appropriate.

So, currently we get a 302 from /entity/Q$1 to /wiki/Special:EntityData/$1 (the
generic document URI), which then applies content negotiation and sends a 303
pointing to e.g. /wiki/Special:EntityData/$1.ttl (the URL of a specific
serialization, e.g. in turtle).

What I want is to remove the initial 302 completely using an internal rewrite,
not replace it with another 303 - since I don't think that's semantically
correct. This did not work when tried, for reasons unknown to me. Someone
suggester that the wrong options where set for the rewrite rule, who knows.

Kingsley, do you think having two 303s (from /entity/Q$1 to
/wiki/Special:EntityData/$1 and another one to wiki/Special:EntityData/$1.xxx)
would be appropriate or at least better than what we have now?

Yes.

303 is what you want. Also note that 303's can now be cached re. newer HTTP spec guidelines. Thus, this is your simplest fix.

Now, if you are concerned about the 303 traffic, you can use a different pattern (again based on newer HTTP spec guidelines) where your server returns a 200 OK on the entity URI and then returns the actual description document URL in the "Location:" response header, as exemplified below:

curl -I http://dbpedia.org/resource/Linked_Data
*HTTP/1.1 303 See Other*
Date: Mon, 21 Oct 2013 21:34:42 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Connection: keep-alive
Server: Virtuoso/07.00.3204 (Linux) i686-generic-linux-glibc212-64 VDB
Accept-Ranges: bytes
*Location: http://dbpedia.org/page/Linked_Data**
*
and

curl -I http://dbpedia.org/resource/Linked_Data
*HTTP/1.1 200 OK*
Date: Mon, 21 Oct 2013 21:34:42 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Connection: keep-alive
Server: Virtuoso/07.00.3204 (Linux) i686-generic-linux-glibc212-64 VDB
Accept-Ranges: bytes
*Location: http://dbpedia.org/page/Linked_Data*

Meanings: the client requested a document denoted <http://dbpedia.org/resource/Linked_Data> and the server confirms that there is a document associated with said URI (albeit not in a direct denotation oriented relationship) via 200 OK, and then returns the actual document location via "Location:" header.


The only problem with this last solution is that its new and I doubt most existing Linked Data clients support the pattern.


Kingsley

-- daniel

_______________________________________________
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


--

Regards,

Kingsley Idehen 
Founder & CEO
OpenLink Software
Company Web: http://www.openlinksw.com
Personal Weblog: http://www.openlinksw.com/blog/~kidehen
Twitter/Identi.ca handle: @kidehen
Google+ Profile: https://plus.google.com/112399767740508618350/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen




Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l

Reply via email to