[PP] Duplicates with :p*

Summary:

1/ Proposal to have an explicit :p* operator
    instead of :p* = :p{0} UNION :p+

2/ path-* would return only one node for a possible path
    That does not path-* duplicate free if there are
    multiple ways to the same end.
      c.f. literals and aggregation example
      c.f. BGPs and projection.

Details still to be worked on.


Currently,

   :p* = :p{0} UNION :p+

This is a source of duplicates because :p{0} may include a node and then 
:p+ will also include it if the path loops back to the start.

Defining
  :p+ = :p/:p*

would also lead to duplicates because of the hidden projection in the 
"/" so two operators are needed.

Example 1:

:a :p :b .
:b :p :c .
:c :p :a .

which is:

      :c
     /  \
    / \
  :a --> :b

Paths:
P1)  :a :p* ?X
P2)  :a :p+ ?Y

we want:
P1) => ?X = :a :b :c
P2) => ?Y = :a :b :c

Example 2:

:a :p :b .
:b :p :c .
:c :p :b .

         :c
         / \
      \ /
  :a --> :b

we want
P1) => ?X = :a :b :c
P2) => ?Y =    :b :c


It should be possible to have the same algorithm, with different 
starting conditions, for :p+ and :p*.

     Andy

Received on Thursday, 10 February 2011 16:09:23 UTC