RE: How to avoid that collections "break" relationships (ISSUE-41) (was: hydra:Link)

On Monday, March 24, 2014 6:41 PM, Gregg Kellogg wrote:
> On Mar 24, 2014, at 8:14 AM, "Markus Lanthaler" wrote:
> > I don't have a problem with the blank node per se but find the use of
> > a reverse property quite confusing in this instance. Maybe we should
> > consider creating a more explicit description of the collection
> > instead. Something along the lines of
> >
> >    "@id" "/GreggKellogg/colleagues",
> >    "managing": {
> >      "subject": "/GreggKellogg/",
> >      "property": "foaf:knows"
> >    },
> >    "member": [
> >      { "@id": "/MarkusLanthaler" }
> >    ]
> >
> > We could then even define a simple inference rule such as ?member =>
> > ?subject ?property ?member
> 
> That works for describing the collection itself, but not the reference
> to the collection. What did you have in mind here? Perhaps an
> operation?

Yeah, the collection "/GreggKellogg/colleagues" is kind of detached from
"/GreggKellog". Talking SPARQL, you would need a query like

  SELECT ?collection WHERE {
    ?collection ex:managing [
      ex:subject <http://example.com/GreggKellogg/> ;
      ex:property foaf:knows
    ]
  }

to find it. So you can't simply "follow your nose", you need to know what
you are looking for.


> >> Considered as a SPARQL query, the use of a BNode indirection is
> >> something like the following:
> >>
> >> SELECT ?member ?p ?o
> >> WHERE {
> >>  </GreggKellogg> a foaf:Person .
> >>  ?container hydra:member ?member .
> >>  ?member ?p ?o .
> >> }
> >>
> >> Which has a certain appeal to me.
> >
> > I'm not sure what you want to illustrate with this SPARQL query..
> > copy and paste error?
> 
> It's missing </GreggKellogg> foaf:knows ?member .

OK, I see what it does but not really what problem it solves. You could just
as well just query for

  </GreggKellogg> foaf:knows ?member

(perhaps filtering out blank nodes), right?


> What it's attempting to illustrate is I can get all the triples that
> where the subject has a foaf:knows relationship with the person. It
> also gets the collection which references them, although I didn't use
> it in the query results. The point is using variables here, which we
> can't do in turtle, so bnodes are the closest approximation. But, if
> I'm a lone voice in the wilderness, let's just move on.

Just because I don't particularly like it, doesn't mean it is a bad idea :-)
The thing that worries me most is that you can't "discover" the collection
anymore. You need to start to look at reverse properties and special
intermediary nodes. Just to make it clear, my proposed solution suffers
under exactly the same issues.

It's such an important issue that we need to find some workarounds or at
least some reasonable options. Yours is certainly one and has the nice
characteristic that we don't need to invent anything.

Wouldn't this be a nice use case for a property graph where you annotate the
predicate with the collection?

  subject ---[predicate]---> objects, if any
               `--> collection



--
Markus Lanthaler
@markuslanthaler

Received on Monday, 24 March 2014 20:08:41 UTC