W3C home > Mailing lists > Public > public-hydra@w3.org > July 2014

RE: Express "go to specific page" for a collection

From: Markus Lanthaler <markus.lanthaler@gmx.net>
Date: Mon, 7 Jul 2014 20:04:18 +0200
To: <public-hydra@w3.org>
Cc: "'Philipp Zins'" <pipo@senaeh.de>
Message-ID: <04c301cf9a0d$e11fbe40$a35f3ac0$@gmx.net>
Hi Pipo,

On Monday, July 07, 2014 2:08 PM, Philipp Zins wrote:
> I wonder how one would express a "go to specific page" relation?
> Would this be appropriate?

As Jindřich already said, we discussed this already and didn't really find a compelling use case justifying such a feature at this point. Does your use case really require it? A couple more comments below.


> {
>   "@context": "http://www.w3.org/ns/hydra/context.jsonld",
>   "@id": "http://api.example.com/an-issue/comments?page=3",
>   "@type": "PagedCollection",
>   "totalItems": "4980",
>   "itemsPerPage": "10",
>   "firstPage": "/an-issue/comments?page=1",
>   "nextPage": "/an-issue/comments?page=4",
>   "previousPage": "/an-issue/comments?page=2",
>   "lastPage": "/an-issue/comments?page=498",
>   "goToPage:" {

I probably wouldn't use an "action sentence" here but more something describing the relationship between these things such as "pageTemplate"

>     "@context": "http://www.w3.org/ns/hydra/context.jsonld",
>     "@type": "IriTemplate",
>     "template": "/an-issue/comments{?page}",
>     "mapping": [
>       {
>         "@type": "IriTemplateMapping",
>         "variable": "page",
>         "property": "hydra:freetextQuery",  // Can in express something like "integerQuery" here?

You can use whatever property you like. The value is a URL, so hydra:freetextQuery actually expands to http://www.w3.org/ns/hydra/core#freetextQuery. Currently there doesn't exist a property for "page number" but you can of course define one yourself.


>         "required": true
>       }
>     ]
>   },
>   "member": [
>     ... the members of this PagedCollection ...
>   ]
> }


Keep the questions coming. We are all more than happy to help. If you can, please also share some information about the API you are building. I'm always interested in to hear how people use JSON-LD and Hydra.


Thanks,
Markus


--
Markus Lanthaler
@markuslanthaler
Received on Monday, 7 July 2014 18:04:57 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:29:42 UTC