Hash vs Slash in relation to the 303 vs 200 debate (was: Is 303 really necessary - demo)

On Fri, Nov 5, 2010 at 5:28 PM, Nathan <nathan@webr3.org> wrote:
> URI resolution is essentially:
>
>  dereference( <uri>.toAbsolute() );
>
> Which gives us the simplicity and semantic indirection which we need. Use
> frags, forget HTTP, know that <uri>#frag is never going to be a document
> (unless you explicitly "say" it is).
>

On a practical level using frags can be inefficient when your linked
data output is backed by a triple store. If you use a slash URI then
generating the data for html/xml/turtle output is just a simple
"describe <uri>". For hash URIs you need to describe all the resources
with a common prefix because the fragment is not sent by the browser
with the request. That might mean a filter with a regex or string
functions which will be more inefficient. If you pick a standard
fragment such as #this, #it etc then you can revert to the simple
describe so the inefficiency only arises when there are multiple
arbitrary fragments per document URI.

The other downside of fragments is you can't say "it exists but I have
no description of it". With standard slash URIs you can 303 to a 404
to say that. You can 404 on the slash itself to say the resource does
not exist. With my proposal to use 2xx responses you can return 204 No
Content to indicate the resource exists but no description is
available.

With slashes you can use 410 on an individual resource to indicate
that it has gone forever. You can also do this with the one frag per
doc approach although you are really saying the description document
has gone and the user is left to imply the secondary resource has also
gone. With multiple frags per doc (i.e. a lot of schemas) you can't
say just one of those resources has gone forever.

In summary:

Slash with 303: hard static publishing, efficient dynamic, can ack
existence without description

Hash, one resource per doc: easy static publishing, efficient dynamic,
can't ack existence without description

Hash, many resources per doc (the typical schema case): easy static
publishing, less efficient dynamic, can't ack existence without
description

Slash with 2xx: easy static publishing, efficient dynamic, can ack
existence without description

Ian

Received on Saturday, 6 November 2010 12:34:07 UTC