Express "go to specific page" for a collection

Hi everyone,

"Example 14" in the docs shows a more complex example for a collection. It
looks like this:

{
  "@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",
  "member": [
    ... the members of this PagedCollection ...
  ]
}


I wonder how one would express a "go to specific page" relation? Would this
be appropriate?

{
  "@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:" {

  "@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?
      "required": true
    }
  ]
}

"member": [ ... the members of this PagedCollection ... ] }


Thank you,
Pipo

Received on Monday, 7 July 2014 11:18:29 UTC