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

Re: Pagination best practices

From: Adrian Pohl <pohl@hbz-nrw.de>
Date: Mon, 22 May 2017 12:00:48 +0200
To: public-linked-json@w3.org
Message-ID: <dcfd3852-7f4c-eb08-a840-229d761b9c14@hbz-nrw.de>
You could also use the Hydra Vocabulary, see 
https://www.hydra-cg.com/spec/latest/core/#collections

-Adrian

Am 22.05.2017 um 11:47 schrieb Amy G:
> ActivityStreams 2.0 (becoming W3C Rec tomorrow) Collections [1] and LDP 
> both have RDF paging models. LDP Paging was published as a Note in 2015 [2].
> 
> [1] https://www.w3.org/TR/activitystreams-core/#collections
> [2] https://www.w3.org/TR/ldp-paging/
> 
> On 22 May 2017 at 11:33, Martynas Jusevičius <martynas@atomgraph.com 
> <mailto:martynas@atomgraph.com>> wrote:
> 
>     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
>     <https://www.w3.org/1999/xhtml/vocab>
> 
>     On Mon, May 22, 2017 at 11:07 AM, Daniel Smedegaard Buus
>     <danielbuus@gmail.com <mailto: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
> 
> 
> 

-- 
Adrian Pohl
hbz - Hochschulbibliothekszentrum des Landes NRW
Jülicher Straße 6
50674 Köln
Telefon +49-221-40075-235
http://www.hbz-nrw.de
Received on Monday, 22 May 2017 10:01:43 UTC

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