Page MenuHomePhabricator

Clarify message on Special:EntityData
Closed, ResolvedPublic

Description

Visiting Special:EntityData in my browser doesn't achieve the expected result:

HTTP/1.1 303 See Other
Server: nginx/1.1.19
Date: Sun, 01 Mar 2015 21:21:12 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 20
Connection: keep-alive
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Vary: Accept-Encoding,X-Forwarded-Proto,Cookie
X-Powered-By: HHVM/3.3.1
X-Content-Type-Options: nosniff
Content-Encoding: gzip
Last-Modified: Sun, 01 Mar 2015 21:21:12 GMT
Location: https://www.wikidata.org/wiki/Q42
X-Varnish: 3521522207, 2385990180, 1425499468
Via: 1.1 varnish, 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
X-Cache: cp1052 miss (0), amssq60 miss (0), amssq45 frontend miss (0)
Cache-Control: private, s-maxage=0, max-age=0, must-revalidate
Set-Cookie: GeoIP=IT:Milan:45.4612:9.1878:v4; Path=/; Domain=.wikidata.org
X-Analytics: https=1

Compare:

$ curl -I https://www.wikidata.org/wiki/Special:EntityData/Q42
HTTP/1.1 303 See Other
Server: nginx/1.1.19
Date: Sun, 01 Mar 2015 21:20:15 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Vary: Accept-Encoding,X-Forwarded-Proto,Cookie
X-Powered-By: HHVM/3.3.1
X-Content-Type-Options: nosniff
Last-Modified: Sun, 01 Mar 2015 21:20:15 GMT
Location: https://www.wikidata.org/wiki/Special:EntityData/Q42.json
X-Varnish: 3521465484, 2385975013, 1425468173
Via: 1.1 varnish, 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
X-Cache: cp1052 miss (0), amssq60 miss (0), amssq45 frontend miss (0)
Cache-Control: private, s-maxage=0, max-age=0, must-revalidate
Set-Cookie: GeoIP=IT:Milan:45.4612:9.1878:v4; Path=/; Domain=.wikidata.org
X-Analytics: https=1

Event Timeline

Nemo_bis raised the priority of this task from to High.
Nemo_bis updated the task description. (Show Details)
Nemo_bis added a subscriber: Nemo_bis.
Lydia_Pintscher claimed this task.
Lydia_Pintscher added a subscriber: Lydia_Pintscher.

Special:EntityData does content negotiation. In a browser redirecting to the item is the intended action.

Why redirect? And why is this not stated in https://www.wikidata.org/wiki/Special:EntityData , which only says "This page provides a linked data interface to entity values. Please provide the entity ID in the URL, using subpage syntax."? If browsers can't be served content, the most obvious thing would be to redirect to [[Special:EntityData]] itself and to clarify the error message. Unsolicited redirection and misleading instructions can't be the expected behaviour.

Lydia_Pintscher lowered the priority of this task from High to Medium.Mar 2 2015, 1:40 PM

We can add more explanatory text to the special page. Redirecting is the right thing to do there. If you get a URL with /entity/Qxxx it redirects you to the item in a browser. This is exactly what it should do. This happens via the special page.

Lydia_Pintscher renamed this task from Special:EntityData redirects to the item page to Clarify message on Special:EntityData.Mar 2 2015, 1:40 PM
Lydia_Pintscher moved this task from incoming to ready to go on the Wikidata board.

Would "This page provides a linked data interface to entity values. Please provide the entity ID in the URL, using subpage syntax to be redirected to the Entity page." be sufficent?

@Nemo: To answer "why redirect": because a 303 redirect is Best Practice for content negotiation for linked data, compare[1]. More generally, redirecting is appropriate because serving different content (formats) from the same URL is a Bad Thing: it messes with caching and, on the conceptual level, with the semantic of URLs and links.

[1] http://linkeddata.org/conneg-303-redirect-code-samples

Nemo_bis closed this task as Resolved.EditedApr 29 2015, 7:59 PM

serving different content (formats) from the same URL is a Bad Thing

But this is exactly what I saw happening, before I knew of the 303 practice: the same [[Special:EntityData/Q42]] URL gives me either a JSON file or an HTML page.

Anyway, with the new message it's clear enough that the special page is not supposed to be used by humans, that's good enough.