W3C home > Mailing lists > Public > public-vocabs@w3.org > March 2014

Re: How to avoid that collections "break" relationships

From: Ruben Verborgh <ruben.verborgh@ugent.be>
Date: Mon, 31 Mar 2014 10:34:19 +0200
Cc: Pat Hayes <phayes@ihmc.us>, public-hydra@w3.org, "Peter F. Patel-Schneider" <pfpschneider@gmail.com>, public-lod@w3.org, W3C Web Schemas Task Force <public-vocabs@w3.org>, Dan Brickley <danbri@danbri.org>
Message-Id: <BA984C38-0C32-4C5B-B312-EDF805680E8F@ugent.be>
To: Markus Lanthaler <markus.lanthaler@gmx.net>
Dear all,

Sorry for hacking the discussion, but I think we should keep the discussion goal-focused.
So let's therefore see what we want to achieve:
1. Having a way for clients to find out the members of a specific collection
2. Not breaking the RDF model while doing so
A solution that satisfies 1 and 2 with minimal effort is good enough for Hydra;
the rest can be discussed more deeply in other places.

The easiest solution I could come up with that satisfies the above criteria is the following.
Suppose a client needs to find Markus' friends, and the server use foaf:knows for that
(which has the restrictive range foaf:Person, disallowing a collection).
If the representation contains all of Markus' friends, then it could look like:

    </people/markus> foaf:knows </people/Anna>.
    </people/markus> foaf:knows </people/Bert>.
    </people/markus> foaf:knows </people/Carl>.

Now, more interestingly, if the list of Markus' friends is available
as a separate resource /people/markus/friends, then it could look like:

    </people/markus> foaf:knows [ hydra:memberOf </people/markus/friends> ].

So we say that a blank node is one of Markus' friends, and where it can be found.
This satisfies 1, because the client can follow the link and find all friends there.
This satisfies 2, because the blank node is an actual person, not a collection.
And that is all we need for hypermedia clients to work.

Yes, I know this does not add a whole bunch of extensive semantics
we might need for specific case X, but:
  a) that's not necessary in general; a Hydra client has all it needs;
  b) this solution is extensible to allow for that.
If you like, you can add details about /people/markus/friends,
say that they all have a foaf:knows relationship to /people/markus etc.

Summarized: look at the minimum client needs, implement that;
only thing we need is a blank node and a memberOf predicate.
Hydra clients work; the model is happy too.

Best,

Ruben

PS The only case this slightly breaks the model is if Markus has no friends yet;
then you say Markus knows somebody while he actually doesn't.
But saying something doesn't exists is a problem in RDF anyway.
The easy way: just don't include any foaf:knows triple (or ignore slight breakage).

If you insist to include _something_, we'd need to do have an explicit empty list:
    </people/markus> foaf:knowsList ().
    foaf:knowsList hydra:listPropertyOf foaf:knows.
But then we'd be stuck with twice as many properties, which is not ideal either.
Received on Monday, 31 March 2014 08:34:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:29:38 UTC