Express "go to specific page" for a collection

Hi everyone,

I'm evaluating some specifications for a real world Hypermedia API and
really like JSON-LD with Hydra so far. Anyway I'll probably encounter some
problems here and there as it seems Hydra is still relatively unknown as it
seems (?). So... without further ado here is my first usage question:

"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 12:07:58 UTC