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

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