W3C home > Mailing lists > Public > public-linked-json@w3.org > May 2017

Pagination best practices

From: Daniel Smedegaard Buus <danielbuus@gmail.com>
Date: Mon, 22 May 2017 11:07:36 +0200
Message-ID: <CAHnuAewB_KdvLyYoHPoBGtgGaG7utnp1izXB8DemdJOuFLJprA@mail.gmail.com>
To: public-linked-json@w3.org
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

Thanks :)

Received on Monday, 22 May 2017 09:09:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:49 UTC