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

2010-11-07 Thread Ian Davis
On Sat, Nov 6, 2010 at 11:31 PM, Toby Inkster t...@g5n.co.uk wrote:
 Not necessarily. If you take your ex:isDescribedBy predicate and add
 that to a triple store where the non-Information-Resource resources are
 identified using hash URIs, then the SPARQL query is just:

        DESCRIBE uri ?res
        WHERE { ?res ex:isDescribedBy uri . }

 which needn't be very slow.

I've done this myself but using foaf:primaryTopic and foaf:topic to
link a document URI to all the resources that are needed to render it.



 The other downside of fragments is you can't say it exists but I have
 no description of it.

 #foo a rdfs:Resource .

In which case you do have a description of it :) But point taken, this
tautology would be enough.

Cheers,

Ian



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

2010-11-06 Thread Ian Davis
On Fri, Nov 5, 2010 at 5:28 PM, Nathan nat...@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



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

2010-11-06 Thread Toby Inkster
On Sat, 6 Nov 2010 12:33:34 +
Ian Davis li...@iandavis.com wrote:

 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.

Not necessarily. If you take your ex:isDescribedBy predicate and add
that to a triple store where the non-Information-Resource resources are
identified using hash URIs, then the SPARQL query is just:

DESCRIBE uri ?res
WHERE { ?res ex:isDescribedBy uri . }

which needn't be very slow.

 The other downside of fragments is you can't say it exists but I have
 no description of it.

#foo a rdfs:Resource .

-- 
Toby A Inkster
mailto:m...@tobyinkster.co.uk
http://tobyinkster.co.uk