I am using below query to get all possible paths between two nodes:
START a=node:node_auto_index(name="A") , m=node:node_auto_index(name="M") MATCH p =a-[*]-m WHERE ALL(r in RELS(p) WHERE (r.value >= 200 OR r.value=0) )RETURN p ORDER BY length (p) desc limit 20
This query returns the results with loops as well i.e. paths contains loop. How can I restrict this to return only simple paths.
On Tuesday, 9 October 2012 18:15:25 UTC+8, Rehan wrote:
> Hi,
> I am using below query to get all possible paths between two nodes:
> START a=node:node_auto_index(name="A") , m=node:node_auto_index(name="M") MATCH p > =a-[*]-m WHERE ALL(r in RELS(p) WHERE (r.value >= 200 OR r.value=0) )RETURN p ORDER BY length > (p) desc limit 20
> This query returns the results with loops as well i.e. paths contains > loop. How can I restrict this to return only simple paths.
On Tue, Oct 9, 2012 at 12:20 PM, Rehan <rehan.az...@gmail.com> wrote:
> UpDate:
> My Nodes have multiple relationships of same type with each other.
> On Tuesday, 9 October 2012 18:15:25 UTC+8, Rehan wrote:
>> Hi,
>> I am using below query to get all possible paths between two nodes:
>> START a=node:node_auto_index(name="A") , m=node:node_auto_index(name="M")
>> MATCH p=a-[*]-m WHERE ALL(r in RELS(p) WHERE (r.value >= 200 OR r.value=0)
>> ) RETURN p ORDER BY length(p) desc limit 20
>> This query returns the results with loops as well i.e. paths contains
>> loop. How can I restrict this to return only simple paths.
> On Tue, Oct 9, 2012 at 12:20 PM, Rehan <rehan.az...@gmail.com> wrote:
> > UpDate:
> > My Nodes have multiple relationships of same type with each other.
> > On Tuesday, 9 October 2012 18:15:25 UTC+8, Rehan wrote:
> >> Hi,
> >> I am using below query to get all possible paths between two nodes:
> >> START a=node:node_auto_index(name="A") ,
> m=node:node_auto_index(name="M")
> >> MATCH p=a-[*]-m WHERE ALL(r in RELS(p) WHERE (r.value >= 200 OR
> r.value=0)
> >> ) RETURN p ORDER BY length(p) desc limit 20
> >> This query returns the results with loops as well i.e. paths contains
> >> loop. How can I restrict this to return only simple paths.
>> On Tue, Oct 9, 2012 at 12:20 PM, Rehan <rehan.az...@gmail.com> wrote:
>> > UpDate:
>> > My Nodes have multiple relationships of same type with each other.
>> > On Tuesday, 9 October 2012 18:15:25 UTC+8, Rehan wrote:
>> >> Hi,
>> >> I am using below query to get all possible paths between two nodes:
>> >> START a=node:node_auto_index(name="A") ,
>> m=node:node_auto_index(name="M")
>> >> MATCH p=a-[*]-m WHERE ALL(r in RELS(p) WHERE (r.value >= 200 OR
>> r.value=0)
>> >> ) RETURN p ORDER BY length(p) desc limit 20
>> >> This query returns the results with loops as well i.e. paths contains
>> >> loop. How can I restrict this to return only simple paths.
>>> On Tue, Oct 9, 2012 at 12:20 PM, Rehan <rehan...@gmail.com <javascript:>> >>> wrote: >>> > UpDate:
>>> > My Nodes have multiple relationships of same type with each other.
>>> > On Tuesday, 9 October 2012 18:15:25 UTC+8, Rehan wrote:
>>> >> Hi,
>>> >> I am using below query to get all possible paths between two nodes:
>>> >> START a=node:node_auto_index(name="A") , >>> m=node:node_auto_index(name="M") >>> >> MATCH p=a-[*]-m WHERE ALL(r in RELS(p) WHERE (r.value >= 200 OR >>> r.value=0) >>> >> ) RETURN p ORDER BY length(p) desc limit 20
>>> >> This query returns the results with loops as well i.e. paths contains >>> >> loop. How can I restrict this to return only simple paths.
>>>> On Tue, Oct 9, 2012 at 12:20 PM, Rehan <rehan...@gmail.com> wrote:
>>>> > UpDate:
>>>> > My Nodes have multiple relationships of same type with each other.
>>>> > On Tuesday, 9 October 2012 18:15:25 UTC+8, Rehan wrote:
>>>> >> Hi,
>>>> >> I am using below query to get all possible paths between two nodes:
>>>> >> START a=node:node_auto_index(name="**A") ,
>>>> m=node:node_auto_index(name="**M")
>>>> >> MATCH p=a-[*]-m WHERE ALL(r in RELS(p) WHERE (r.value >= 200 OR
>>>> r.value=0)
>>>> >> ) RETURN p ORDER BY length(p) desc limit 20
>>>> >> This query returns the results with loops as well i.e. paths contains
>>>> >> loop. How can I restrict this to return only simple paths.
>>>>> On Tue, Oct 9, 2012 at 12:20 PM, Rehan <rehan...@gmail.com> wrote: >>>>> > UpDate:
>>>>> > My Nodes have multiple relationships of same type with each other.
>>>>> > On Tuesday, 9 October 2012 18:15:25 UTC+8, Rehan wrote:
>>>>> >> Hi,
>>>>> >> I am using below query to get all possible paths between two nodes:
>>>>> >> START a=node:node_auto_index(name="**A") , >>>>> m=node:node_auto_index(name="**M") >>>>> >> MATCH p=a-[*]-m WHERE ALL(r in RELS(p) WHERE (r.value >= 200 OR >>>>> r.value=0) >>>>> >> ) RETURN p ORDER BY length(p) desc limit 20
>>>>> >> This query returns the results with loops as well i.e. paths >>>>> contains >>>>> >> loop. How can I restrict this to return only simple paths.
>>>>>> On Tue, Oct 9, 2012 at 12:20 PM, Rehan <rehan...@gmail.com> wrote:
>>>>>> > UpDate:
>>>>>> > My Nodes have multiple relationships of same type with each other.
>>>>>> > On Tuesday, 9 October 2012 18:15:25 UTC+8, Rehan wrote:
>>>>>> >> Hi,
>>>>>> >> I am using below query to get all possible paths between two nodes:
>>>>>> >> START a=node:node_auto_index(name="**A**") ,
>>>>>> m=node:node_auto_index(name="**M**")
>>>>>> >> MATCH p=a-[*]-m WHERE ALL(r in RELS(p) WHERE (r.value >= 200 OR
>>>>>> r.value=0)
>>>>>> >> ) RETURN p ORDER BY length(p) desc limit 20
>>>>>> >> This query returns the results with loops as well i.e. paths
>>>>>> contains
>>>>>> >> loop. How can I restrict this to return only simple paths.
On Thu, Oct 11, 2012 at 10:11 PM, Wes Freeman <freeman....@gmail.com> wrote:
> Probably. The question is, how do you know which path you don't want to
> include?
> On Thu, Oct 11, 2012 at 9:46 PM, Rehan <rehan.az...@gmail.com> wrote:
>> Hi Wes,
>> Thank you .
>> One more query is it possible to build a query which should not include a
>> given path .
>> Thanks and Best Regards,
>> Rehan
>> On Thursday, 11 October 2012 17:07:34 UTC+8, Wes Freeman wrote:
>>> You could add that in to the WHERE clause with an AND, just like you had
>>> it in the original query.
>>> Wes
>>> On Wed, Oct 10, 2012 at 11:43 PM, Rehan <rehan...@gmail.com> wrote:
>>>> Thanks WES, what if we want to add a filter on relationship as well.
>>>> i.e. property with value <=200.
>>>> On Wednesday, 10 October 2012 15:54:44 UTC+8, Wes Freeman wrote:
>>>>> This is a bit of an abomination--there should be a better way--but you
>>>>> might be able to use it to get simple paths:
>>>>>>> On Tue, Oct 9, 2012 at 12:20 PM, Rehan <rehan...@gmail.com> wrote:
>>>>>>> > UpDate:
>>>>>>> > My Nodes have multiple relationships of same type with each other.
>>>>>>> > On Tuesday, 9 October 2012 18:15:25 UTC+8, Rehan wrote:
>>>>>>> >> Hi,
>>>>>>> >> I am using below query to get all possible paths between two
>>>>>>> nodes:
>>>>>>> >> START a=node:node_auto_index(name="**A**") ,
>>>>>>> m=node:node_auto_index(name="**M**")
>>>>>>> >> MATCH p=a-[*]-m WHERE ALL(r in RELS(p) WHERE (r.value >= 200 OR
>>>>>>> r.value=0)
>>>>>>> >> ) RETURN p ORDER BY length(p) desc limit 20
>>>>>>> >> This query returns the results with loops as well i.e. paths
>>>>>>> contains
>>>>>>> >> loop. How can I restrict this to return only simple paths.