Re: Feedback for Limit / Offset Based Pagination

As for the SPIN vocab, sp:offset would imply that the view is sp:Query or in 
general SPARQL query (as SPIN is an RDF notation of SPARQL) - I think it's 
not what you would like to achieve at the end. Unfortunately, we haven't 
decide to provide these kind of candies in the Hydra as I'm also strugling 
with lack of them and had to introduce extension in my work.

As for the ex:membersPerView - I don't see a use case here. I'd either stick 
to hypermedia controls like first/next etc. or provide a complex operation 
and it's templated link / Iri template somwhere not really bound to the view 
itself (API documentation or a standalone resource in the payload).

Regards

-----Oryginalna wiadomość----- 
From: Maik Riechert
Sent: Monday, December 21, 2015 10:55 AM
To: Thomas Hoppe ; public-hydra@w3.org
Subject: 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 19:11:36 UTC