Re: Reconsidering template mappings

On Thu, Jul 17, 2014 at 10:32 AM, Ruben Verborgh
<ruben.verborgh@ugent.be> wrote:
> Hi Tomasz,
>
>>  But what does it mean that it maps a variable to a
>> property? Andreas wrote on GitHub "My view: The IRI of the foaf:maker
>> is the value which should be passed.". So there is a property
>> foaf:maker and it's value will be passed as the parameter. But
>> property of what subject?
>
> We had a long discussion about exactly that in the context of #30:
>
>>> The thing here is that the subject of the triple is not defined yet.
>
>>> Basically, we have the choice between:
>>> a) the subjects are the elements of the collection ("Actor")
>>> b) the subjects are "related" to the elements of the collection ("Movie starring actor")
>>> Clearly, a) is most strictly defined;
>>> and b) is so loosely defined that we basically cannot infer anything.
>
> — http://lists.w3.org/Archives/Public/public-hydra/2014Feb/0120.html
>

Actually that conversation ends in a bizarre state with an example
that search for /actors?gender=male would actually return Paris
Hilton, because somewhere in the representation another resource was
male. This is counterintuitive.

I'm sorry if I'm digging out a closed topic here, but I'd like to
understand your understanding of the template mappings.

As an API publisher I would probably want the above query to mean
"give me actors which are male". In SPARQL fo instance the relevant
pattern would be "?actor :gender {gender}", where {gender} is the
value supplied by the client. In such POV the property is already
defined (:gender) and the client supplies _values_ to search for.
Hence my suggestion that mapping should map to types and somehow give
the client ways to select them.

Also I got the impression that there is the assumption that templated
links would only be given in context of a related representation.
Let's consider once again a templated link to search for issues
created by a given user. Such a templated link could be attached to
the representation of an entry point. It is also how the UI is
commonly build. The dashboard gives the user various ways to directly
execute common actions.

{
  "template": "/issues{?author}",
  "mappings": [
    {
      "variable": "author",
      "property": "ex:author"
    }
  ]
}

Because the representation is an entrypoint, there is nowhere to look
for the ex:author property. Similarily a representation of must not
always include this property. Would this link be inaccessible in that
case, because the client is unable to choose a value for the template
parameter?

> Best,
>
> Ruben

Received on Thursday, 17 July 2014 09:47:56 UTC