Re: Another thing on property paths...

Thanks for the explanations which resolve most of my confusion.
I also read up earlier minutes on that (which I should've earlier, admittedly, apologies here.)

Summing up:

1) 
"
Definition: ZeroLengthPath

A zero length path matches all subjects and all objects in the graph, 
          and also any IRIs explictly given as endpoints of the path pattern.
"

could be made clearer in wording, adding "to themselves" in the end or alike.

2) 
As for the definition of nodes(G)  http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#defn_evalZeroPath,
I suggest adding
 
"where nodes(G) is the set of RDFTerms occurring as either subjects of objects in G"

after the definition (which I assume is the intention of nodes(G)).

3) 
I see in the 2010-06-15 minutes:

PROPOSED: Zero-length paths are defined to match all subjects and objects in the graph plus any IRI literal that is the subject or object of the triple pattern.

I didn't see this resolved or further discussed, but it was the tentative consensus recorded in the minutes of that meeting. 
One part of my confusion in the earlier emails with Andy (apart from editorial/formulation issues)  was that latter part here
"plus any IRI literal that is the subject or object of the triple pattern"
I would be grateful if anyone could help me again with a particular use case/the rationale for that as I couldn't find it explicitly in the mails/minutes... 

Axel



On 17 Dec 2010, at 14:19, Andy Seaborne wrote:

> 
> 
> On 17/12/10 09:53, Axel Polleres wrote:
> > Independent from Jorge's remarks on the comments list, I have had another
> > question on PropertyPaths, particulary about ZeroLengthPath:
> >
> >
> > Admittedly, find the e.g. the zeroLengthPath operator quite unintiuitive at the moment,
> > linking *ALL* nodes with each other...
> 
> It does not.
> 
> eval(D(G), ZeroLengthPath(vx:var, path, vy:var))) =
>    { {(vx, term), (vy, term)} | term in nodes(G) }
>    card[] = 1
> 
> NB: same *term*
> 
> Nodes are linked to themselves only by {0}
> 
> > that means that e.g.
> >
> > ?X knows* ?Y
> >
> > for not only the transitively linked pairs of resources via the knows property,
> > ALL pairs of nodes in the graph... Actually, I isn't a more standard way of treating 0-length paths just as
> > reflexive, i.e. only linking each node reflexively with itself?
> >
> > I would at least find this more intuitive and returning less noisy results, i.e. "what I can reach from one node
> > in 0 steps is just the node itself" sounds intuitive to me. Am I mistaken here? If yes, why?
> > At least, I don't understand why we *need* to return the pairs of all nodes here?
> >
> > Example:
> >
> > alice knows bob .
> > bob knows charly .
> >
> > Pattern:
> > ?X knows* ?Y
> 
> > Result ALL:
> 
> Where did these result come from?  I see no reason for many of them.
> 
> They include the property -
> 
> [[
> A zero length path matches all subjects and all objects in the graph
> ]]
> 
> excludes IRIs that are only properties
> 
> 
> 
> ?X foaf:knows* ?Y
>    ==
> { ?X foaf:knows{0} ?Y } UNION { ?X foaf:knows+ ?Y }
> 
> { ?X foaf:knows{0} ?Y }
> 
> ---------------------------------------------------
> | X                      | Y                      |
> ===================================================
> | <http://example.org/a> | <http://example.org/a> |
> | <http://example.org/b> | <http://example.org/b> |
> | <http://example.org/c> | <http://example.org/c> |
> ---------------------------------------------------
> 
> { ?X foaf:knows+ ?Y }
> 
> ---------------------------------------------------
> | X                      | Y                      |
> ===================================================
> | <http://example.org/a> | <http://example.org/b> |
> | <http://example.org/a> | <http://example.org/c> |
> | <http://example.org/b> | <http://example.org/c> |
> ---------------------------------------------------
> 
> so ?X foaf:knows* ?Y
> 
> ---------------------------------------------------
> | X                      | Y                      |
> ===================================================
> | <http://example.org/a> | <http://example.org/a> |
> | <http://example.org/a> | <http://example.org/b> |
> | <http://example.org/a> | <http://example.org/c> |
> | <http://example.org/b> | <http://example.org/b> |
> | <http://example.org/b> | <http://example.org/c> |
> | <http://example.org/c> | <http://example.org/c> |
> ---------------------------------------------------
> 
> which gets me:
> 
>    ?X ?Y  Reason:
>    -----
>    a  a   {0}
>    a  b   +
>    a  c   +
>    a  k   ?? property
>    b  b   {0}
>    b  a   ?????
>    b  c   +
>    b  k   ?? property
>    c  c   {0}
>    c  a   ?????
>    c  b   ?????
>    c  k   ?? property
>    k  k   ?? property
>    k  a   ?? property
>    k  b   ?? property
>    b  c   +
>    a  b   + <--- repeat why?
>    b  c   + <--- repeat why?
>    a  c   + <--- repeat why?
> 
> Result REFLEXIVE:
>    ?X ?Y
>    -----
>    a  a
>    b  b
>    c  c
>    k  k   ?? property
>    a  b
>    b  c
>    a  c
> >
> > (a = alice, b = bob, c = chalry, k = knows)
> >
> > Can someony explain to me why the reflexive only version of ZeroLengthPath wouldn't work with the rest?
> 
> 
> 
> >
> > Axel
> 

Received on Monday, 20 December 2010 00:25:51 UTC