Re: relate a Collection and a PagedCollection

Hi Gregg,

> My thought was that the API would define results as being a type of Collection. Based on server-specific logic, it could then return a PagedCollection via redirect if necessary. After getting the first page back, the client would have sufficient information to page through the collection.

This is indeed a way in which it could work in practice.
But I'd still explicitly want to describe how they are related.

I'll show you my specific use case: I'm adding page support to Linked Data Fragments.
I want to say that <http://data.linkeddatafragments.org/dbpedia>
is the first page of the dataset <http://data.linkeddatafragments.org/dbpedia#dataset>.

I have been working on this for some time,
and I can't help but wonder whether PagedCollection is really the correct term/concept.
Maybe the following could be easier:
    <dataset> hydra:firstPage <page1>.
    <dataset> hydra:lastPage <page34>.
    <page1> hydra:nextPage <page2>.
    <page2> hydra:previousPage <page1>.
    <page1> hydra:pageOf <dataset>.
So there is one collection; each of them has pages.
Note the relations firstPage and lastPage would be between a collection and a page;
nextPage and previousPage are between pages (not a collection and a page).
This would make the Hydra properties equivalent to the IANA rels first, last, next, prev.

Currently, the above would have to be expressed as:
    <page2> hydra:firstPage <page1>.
    <page2> hydra:lastPage <page34>.
    <page1> hydra:nextPage <page2>.
    <page2> hydra:previousPage <page1>.
Note how I cannot relate the dataset to its pages.

The concept PagedCollection seems somehow wrong:
“A PagedCollection is a subclass of Collection with the only difference
that its members are sorted and only a subset of all members are returned in a single PagedCollection.”
It would feel more natural if PagedCollection was the whole thing (the collection of all pages/items)
and that the members are Pages themselves. Markus?

Are there examples in the wild of Hydra paging?

Best,

Ruben

Received on Tuesday, 15 April 2014 17:37:10 UTC