Feedback for Limit / Offset Based Pagination

Hi,

based on the new hydra:PartialCollectionView based pagination
I have tried to combine this with the limit / offset based pagination scheme
(that I want to keep) and here is the result based on a JSON-LD example:

"@id": "http://example.com/events/",
"@type": "Collection",
"totalItems": 12664,
"member": [
   ...
],
"view": {
   "@id": "http://example.com/events/?limit=250&offset=250",
   "@type": [ "hydra:PartialCollectionView", "ex:PartialCollectionView" ],
   "first": "/events/?limit=250",
   "previous": "/events/?limit=250&offset=0",
   "next": "/events/?limit=250&offset=500",
   "last": "/events/?limit=250&offset=12500",
   "ex:offset": 250,
   "ex:membersPerView:" {
     "@type": "IriTemplate",
     "ex:defaultLimit": "100",
     "template": "/events/{?limit,offset}",
     "mapping": [
       {
         "@type": "IriTemplateMapping",
         "variable": "limit",
         "property": "ex:PartialCollectionView#limit"
       },
       {
         "@type": "IriTemplateMapping",
         "variable": "offset",
         "property": "ex:PartialCollectionView#offset"
       }
     ]
   }
}

Unprefixed properties are from hydra:.
Custom stuff is prefixed with ex:.

So obviously I have introduced a new class with the properties ex:limit 
and ex:offset which
should carry the actual semantics of this pagination scheme.
ex:defaultLimit is to inform the client which limit is used if no limit 
is supplied by the client.

I had a quick look at other vocabs and could find something matching in 
SPIN:

http://spinrdf.org/sp#limit
http://spinrdf.org/sp#offset

So I might use them instead.

What do you think about this model?

BG, Thomas

Received on Monday, 21 December 2015 08:02:03 UTC