Re: Question about Triple Pattern Fragment (TPF) and hydra:filter

On Tue, Oct 6, 2015 at 3:19 AM, Ruben Verborgh <ruben.verborgh@ugent.be> wrote:
>> From what i understand, hydra:search is used in more general case.
>
> What I remember is that hydra:filter is a subproperty of hydra:search.
> But _not_ in the sense that it changes the domain.
> Rather, hydra:search has a looser semantic coupling:
> it doesn't define _how_ the API uses the value to search data.
> On the other hand, hydra:filter has the specific semantics
> that it only returns data elements where the components match exactly.
>
>> It can attach to any resource.
>
> Both hydra:search and hydra:filter attach to a collection [1].
>
>> On the other hand, hydra:filter is used only on hydra:Collection [1].
>
> Same holds for hydra:search.

Oh you're right.
Sorry for my misunderstanding.
And thank you for your explanation.

>> So, just use hydra:search. It is still OK, i think.
>
> Is okay (because hydra:filter would be a subproperty of it);
> but then I wonder what the difference is with TPF?
>
Firstly, let me clarify that i don't want to change TPF.
I just want to adopt TPF into hydra:Collection.
So if there are anything incorrect against current specification of
TPF, please correct me.

The different between my API and the TPF example [1] is the selector.
My API is design to query only member of hydra:Collection.
Therefore, the triples that only have rdfs:label will not return in
the response.
The triples that will return in the response must
- it has rdfs:label and
- it is member of current collection.

To make your understand, what I think:
I will show the implementation of TPF server by SPARQL query.
######1) The TPF example (triple pattern)#####
CONSTRUCT { ?s  rdfs:label   ?label }
WHERE {
      ?s   rdfs:label   ?label .
}
######2) My API (graph pattern)##########
CONSTRUCT { ?member  rdfs:label   ?label }
WHERE {
      <http://example.org/collection>  hydra:member  ?member .
      ?member   rdfs:label   ?label .
}

>From what I understand, LDF [2] want to support this type of selector
( (2) My API graph pattern).
However, I cannot find any example about how to achieve this through
hydra vocabulary.

Therefore, I decide to use hydra:filter to fix this sentence in the
server implementation:
<http://example.org/collection>  hydra:member  ?member .
Then the client only assign the property of member, that is rdfs:label.

The server will have assumption that hydra:filter or hydra:search in
the hydra:Collection is used only to filter the members of collection.
Not the collection itself or another triples that is not the member of
collection.

[1] http://www.hydra-cg.com/spec/latest/triple-pattern-fragments/
[2] http://www.hydra-cg.com/spec/latest/linked-data-fragments/

Best,
Wasin

Received on Tuesday, 6 October 2015 01:17:13 UTC