Trying to understand how templated links work

Does anyone know of any examples of Template Links as described in the
vocabulary and what is the relationship between a TemplateLink and an
IRITemplate.

https://www.hydra-cg.com/spec/latest/core/#templated-links

I'm most likely exposing my lack of knowledge about how RDF works here. I
see that the range of a TemplatedLink is an IRITemplate.

But I'm trying to understand how I would represent this in an API response.

e.g. take the example of the entrypoint for the event-api demo.

Let's say that the "events" URL actually needed to be a template with a
query parameter filtering how many events are returned.

How would you represent that?

This is the original API response:

{

    "@context": "/hydra/event-api/contexts/EntryPoint.jsonld",
    "@id": "/hydra/event-api/",
    "@type": "EntryPoint",
    "events": "/hydra/event-api/events/"
}


How would you represent it as a TemplatedLink? Like this?

{

    "@context": "/hydra/event-api/contexts/EntryPoint.jsonld",
    "@id": "/hydra/event-api/",
    "@type": "EntryPoint",
    "events": {

        "@type": "IriTemplate",
        "template": "/hydra/event-api/events{?pageSize}"
        "mapping": ...
    }

}

Or something completely different?
How would something like this be integrated with the concept of
supported operations/operations?

Thanks
Martin

Received on Wednesday, 5 April 2017 12:24:09 UTC