RE: hydra:Link (ISSUE-41)

On Wednesday, March 19, 2014 10:44 PM, Gregg Kellogg wrote:
> Vering in to N3 syntax (and changing vocabularies), for the moment, an
> alternative way of referencing a collection could be through a BNode:
> 
>     </GreggKellogg> a foaf:Person;
>       foaf:knows [is hydra:member of </GreggKellogg/colleagues>]
>
> Alternatively, if we mint a hydra:isMemberOf property as the inverse of
> hydra:member:
> 
>    </GreggKellogg> a foaf:Person;
>       foaf:knows [hydra:isMemberOf </GreggKellogg/colleagues>]
> 
> (JSON-LD and RDFa both have nice support for reversed properties, so
> creating such a property probably isn't necessary.
> 
> This ends up using the BNode as an existential quantifier for any
> member of the colleagues collection, so doesn't create anything which
> would be inconsistent. Dereferencing the is member of relation gets a
> collection (or possibly, paged collection), which doesn't assert that
> it is, itself, a colleague. After pulling in the collection, and
> performing RDFS entailment, you'd get the following:
> 
> </GreggKellogg> a foaf:Person;
>   foaf:knows
>     [a foaf:Person; is hydra:member of </GreggKellogg/colleagues>],
>     </MarkusLanthaler> .
> 
> <MarkusLanthaler> a foaf:Person .

Hmm... I think this is a bit too clever and still creates a triple that you
don't want.


> These statements are entirely consistent, and the BNode is rather more
> easily ignored than a collection IRI.

This is a case where we should look at LDP [1], as Paul suggested some time
ago. LDP allow you to describe a "DirectContainer" (I find the naming quite
confusing) as follows:

    </GreggKellogg> a foaf:Person ;
        foaf:knows </MarkusLanthaler> .

    </GreggKellogg/friends> a ldp:DirectContainer;
        dcterms:title "Gregg's friends";
        ldp:membershipResource </GreggKellogg>;
        ldp:hasMemberRelation foaf:knows;
        ldp:contains </MarkusLanthaler> .

The problem I have with LDP is that it hardcodes the complete interaction
model. It's also kind of tricky to "find" such a container. You have to
traverse the graph along non-materialized, reverse properties which is not
exactly straightforward IMHO.


> In JSON-LD, it could look like the following:
> 
>     {
>       "@context": {
>         "foaf": "http://xmlns.com/foaf/0.1/",
>         "hydra": "<http://www.w3.org/ns/hydra/",
>         "memberOf": {"@reverse": "hydra:member"}
>       },
>       "@id" "GreggKellogg",
>       "foaf:knows": {"memberOf": "GreggKellogg/colleagues"}
>     }
> 
> It does mean that saying foaf:knows is a hydra:Link isn't sufficient,
> but saying hydra:isMemberOf is a hydra:Link would be, and wouldn't need
> to be asserted on any other property for an API to be able to perform
> reasonable dereferencing.

While I don't really like the specific blank node solution you are
proposing, I find the principle quite interesting. We could avoid the blank
node, and thus a triple we don't want, entirely but just including a member
of collection directly:

    {
      "@context": {
        "foaf": "http://xmlns.com/foaf/0.1/",
        "hydra": "http://www.w3.org/ns/hydra/core",
        "memberOf": { "@reverse": "hydra:member" }
      },
      "@id" "GreggKellogg",
      "foaf:knows": {
        "@id": "MarkusLanthaler,
        "memberOf": "GreggKellogg/colleagues"
      }
    }

WDYT?



--
Markus Lanthaler
@markuslanthaler

Received on Friday, 21 March 2014 14:59:14 UTC