Re: Pagination best practices

JSON-LD is just an RDF serialization. You'll need properties in your RDF.

Something close to a convention is to use xhv:prev/xhv:next for Prev/Next
URIs: https://www.w3.org/1999/xhtml/vocab

On Mon, May 22, 2017 at 11:07 AM, Daniel Smedegaard Buus <
danielbuus@gmail.com> wrote:

> Hi guys :)
>
> I've been fiddling with JSON-LD for an API I'm building for a couple of
> weeks. I'm at the point where I'd like to add pagination to lists of stuff,
> but I find it a bit confusing googling for it.
>
> It's also not entirely clear to me where and how I should define the
> pagination properties. For instance, you can query my API for /users, and
> it'll return a document with a @context of "my:User" and a @graph with the
> first page of users found.
>
> Ideally, it'd be great to have something like a 'pagination' property on
> the same level as @context and @graph, which would contain IRIs for more
> pages, the total number of users in the database, and so on. But it's not
> apparent to me where I'd define that. It feels like it shouldn't be in my
> User context, as I'd then have to add it to every user in the @graph...
>
> How are you guys handling this in the most elegant and JSON-LD compliant
> way?
>
> Thanks :)
>
> Daniel
>

Received on Monday, 22 May 2017 09:34:23 UTC