Re: Feedback for Limit / Offset Based Pagination

Hi Thomas,

> 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"
>       }
>     ]
>   }
> }
I would put "ex:membersPerView" outside of the "view" since it doesn't 
say anything about that specific partial view/page. But I'm not 100% 
sure on this one.
Then I would not have "defaultLimit" but just include the actual 
"limit", also in the default case. I would put the "limit" also in the 
"view" just as your "offset".
I think the syntax "ex:PartialCollectionView#offset" is not really 
valid, but that's just a minor thing.

Looking forward to hear other's opinions.

Cheers
Maik

>
> 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 09:56:04 UTC