Re: Relating hydra:Classes to hydra:IriTemplates

On Sun, Jun 22, 2014 at 10:01 PM, Markus Lanthaler
<markus.lanthaler@gmx.net> wrote:
> On 17 Jun 2014 at 12:19, Jindřich Mynarz wrote:
>> I was thinking a bit more about relating hydra:Classes to
>> hydra:IriTemplates. It seems to me that the intended way how to do
>> that is by using hydra:TemplatedLink to mint a property (like
>> hydra:search is defined). Consider the following example:
>
> You still have search in mind, right? In my response below, I assume you want to tell a client that the API supports schema:Person and how to find a specific person.

Yes, as I wrote in the example: :simple-search-person
rdfs:subPropertyOf hydra:search.

Let's return to the core topic of this thread. Is the following
example relating hydra:Class to hydra:IriTemplate in a way that's
consistent with the intended use of Hydra?

:simple-search-api a hydra:ApiDocumentation ;
  hydra:supportedClass schema:Person .

schema:Person a hydra:Class ;
  :simple-search-person :simple-search-person-template .

:simple-search-person a hydra:TemplatedLink ;
  rdfs:subPropertyOf hydra:search .

:simple-search-person-template a hydra:IriTemplate ;
  hydra:template "/person{?name}" ;
  hydra:mapping [
      a hydra:IriTemplateMapping ;
      hydra:variable "name" ;
      hydra:property schema:name ;
      hydra:required true
    ] .

Or, distilled even more, is the following pattern in line with Hydra?

:A :B :C .
:A a hydra:Class .
:B a hydra:TemplatedLink .
:C a hydra:IriTemplate .

- Jindřich

-- 
Jindřich Mynarz
http://mynarz.net/#jindrich

Received on Monday, 23 June 2014 08:37:22 UTC