resources described on multiple pages

Hello,

I've been discussing how to best model/serve things like a guestbook
with many entries (too many to fit on one page).


The requirements:
- As backend there is a triple-store
- For all resources both clients and preferring RDF as well as clients 
preferring HTML should get useful responses


The idea:

The backend graph contains the description of the individual entries and
relates the to the guestbook <http://example.org/guestbook>:

<http://example.org/guestbook> rdf:type ex:Guestbook;
ex:entry <http://example.org/guestbook/entry1000038>;
....
ex:entry <http://example.org/guestbook/entry1>.
<http://example.org/guestbook/entry1000038> dc:date "2009-02-03";
dc:title "I was here".
<http://example.org/guestbook/entry1> dc:date "2006-12-13";
dc:title "starting the guestbook".


The requests with HTML preference:

A request to <http://example.org/guestbook> returns a 302 response
redirecting to <http://example.org/guestbook?from=1&till=10>.
A request to <http://example.org/guestbook?from=1&till=10> returns a 200
response presenting the most recent 10 guest-book entries, and a link to
the next page.


The requests with RDF preference:

A request to <http://example.org/guestbook> returns a 200 response with
a serialization of the context (= MSG aka symmetric CBD) of the resource
<http://example.org/guestbook> --> This is a subset of the backend
graph, the size of the returned graph increases by one triple for each
additional entry

Analogously a request to <http://example.org/guestbook/entry1000038>
returns the context of <http://example.org/guestbook/entry1000038>.

A request to <http://example.org/guestbook?from=1&till=10> return a 200
response with the context of the resource
<http://example.org/guestbook?from=1&till=10>, all these triples are not
in the backend graph, but generated on the fly, a response could look as
follows:

<http://example.org/guestbook?from=1&till=10> rdf:type ex:GuestbookPage;
ex:pageOf <http://example.org/guestbook>;
ex:pageEntry <http://example.org/guestbook/entry1000038>;
...
ex:pageEntry <http://example.org/guestbook/entry1000028>;
ex:nextPage <http://example.org/guestbook?from=11&till=21>.


I would welcome any comments on this solution approach. On uncertainty
is it its ok for one resource to return 200 and 302 responses depending
on the Accept-Header.

Cheers,
Reto

Received on Tuesday, 3 February 2009 10:36:03 UTC