rethink paging (was: relate a Collection and a PagedCollection)

Dear all,

I have created issue 42 to rethink paging:
https://github.com/HydraCG/Specifications/issues/42
Below is the full text of my suggestion:

Introduce Page as a result page of a collection:

    // The collection itself
    {
      "@context": "http://www.w3.org/ns/hydra/context.jsonld",
      "@id": "http://api.example.com/an-issue/comments",
      "@type": "Collection",
      "firstPage": "/an-issue/comments?page=1",
      "hasPage": "/an-issue/comments?page=4",
      "lastPage": "/an-issue/comments?page=498",
    }

    // A page of the collection
    {
      "@context": "http://www.w3.org/ns/hydra/context.jsonld",
      "@id": "http://api.example.com/an-issue/comments?page=3",
      "@type": "Page",
      "previousPage": "/an-issue/comments?page=2",
      "nextPage": "/an-issue/comments?page=4",
      "pageOf": "http://api.example.com/an-issue/comments",
    }

Note the redefinition of the properties:
- firstPage relates a Collection to a Page
- lastPage relates a Collection to a Page
- nextPage relates a Page to a Page
- firstPage relates a Page to a Page

And the introduction of two new properties:
- hasPage relates relates a Collection to a Page
- pageOf relates relates a Page to a Collection

Additionally, we might redefine the type PagedCollection to apply to those collections that are available in a paged way.

Best,

Ruben

Received on Thursday, 17 April 2014 14:10:29 UTC