Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Need some FILTER help
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Bolton  
View profile  
 More options Aug 17 2012, 6:37 pm
From: Chris Bolton <iknewthis...@yahoo.com>
Date: Fri, 17 Aug 2012 15:37:42 -0700 (PDT)
Local: Fri, Aug 17 2012 6:37 pm
Subject: Need some FILTER help

I've got a query that returns two collection (friends and outer). Is it possible to filter friends with outer?
Here is my query:
START n=node(127) MATCH(n)-[:friends]->(x) WITH n, collect(distinct x) as friends MATCH(n)-[:outer_only_friends]->(y) RETURN friends, collect(distinct y) as outer
I'm thinking of something like this:
START n=node(127) MATCH(n)-[:friends]->(x) WITH n, collect(distinct x) as friends MATCH(n)-[:outer_only_friends]->(y) WITH n, collect(distinct y) as outer, friends RETURN collect(friends + outer) as stuff filter(outer in coll:friends)
At this point, this doesn't work. Is there a way to generate two collections and filter one by the other? Any help would be appreciated even if it's just some example of filter in use or a brief explanation. I'm a little confused on the syntax.
Thanks.
Chris 


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andres Taylor  
View profile  
 More options Aug 18 2012, 4:21 am
From: Andres Taylor <andres.tay...@neotechnology.com>
Date: Sat, 18 Aug 2012 10:21:25 +0200
Local: Sat, Aug 18 2012 4:21 am
Subject: Re: [Neo4j] Need some FILTER help

On Sat, Aug 18, 2012 at 12:37 AM, Chris Bolton <iknewthis...@yahoo.com>wrote:

The first part of your return shouldn't be too difficult - you can
concatenate two collections with the plus symbol:

RETURN friends + outer as stuff

The last part I don't understand - filter(outer in coll:friends)

What is that trying to achieve?

Andrés


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile   Translate to Translated (View Original)
 More options Aug 18 2012, 3:11 am
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Sat, 18 Aug 2012 09:11:19 +0200
Local: Sat, Aug 18 2012 3:11 am
Subject: Re: [Neo4j] Need some FILTER help

Chris,

this should work but it doesn't really make sense to me (the use-case).

> START n=node(127)
> MATCH(n)-[:friends]->(x)
> WITH n, collect(distinct x) as friends
> MATCH(n)-[:outer_only_friends]->(y)
> WITH n, collect(distinct y) as outer, friends
> RETURN  filter(x in outer + friends : x in  friends)

PS: You gained quite a lot of cypher knowledge these past weeks, would it be possible for you to write up a blog post explaining the different things, so that others can benefit from that too? That would be awesome.

Am 18.08.2012 um 00:37 schrieb Chris Bolton:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Bolton  
View profile   Translate to Translated (View Original)
 More options Aug 18 2012, 5:06 pm
From: Chris Bolton <iknewthis...@yahoo.com>
Date: Sat, 18 Aug 2012 14:06:01 -0700 (PDT)
Local: Sat, Aug 18 2012 5:06 pm
Subject: Re: [Neo4j] Need some FILTER help

I will work on putting together a blog post. I appreciate everyone's help in getting me this far.

I know the use case looks goofy. This is just a smaller example of my ultimate use case. Hopefully when I build it in console it will come out clearer.

Chris

--- On Sat, 8/18/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Need some FILTER help
To: neo4j@googlegroups.com
Date: Saturday, August 18, 2012, 12:11 AM

Chris,
this should work but it doesn't really make sense to me (the use-case).

START n=node(127) MATCH(n)-[:friends]->(x) WITH n, collect(distinct x) as friends MATCH(n)-[:outer_only_friends]->(y) WITH n, collect(distinct y) as outer, friendsRETURN  filter(x in outer + friends : x in  friends)

PS: You gained quite a lot of cypher knowledge these past weeks, would it be possible for you to write up a blog post explaining the different things, so that others can benefit from that too? That would be awesome.
Am 18.08.2012 um 00:37 schrieb Chris Bolton:
I've got a query that returns two collection (friends and outer). Is it possible to filter friends with outer?
Here is my query:
START n=node(127) MATCH(n)-[:friends]->(x) WITH n, collect(distinct x) as friends MATCH(n)-[:outer_only_friends]->(y) RETURN friends, collect(distinct y) as outer
I'm thinking of something like
 this:
START n=node(127) MATCH(n)-[:friends]->(x) WITH n, collect(distinct x) as friends MATCH(n)-[:outer_only_friends]->(y) WITH n, collect(distinct y) as outer, friends RETURN collect(friends + outer) as stuff filter(outer in coll:friends)
At this point, this doesn't work. Is there a way to generate two collections and filter one by the other? Any help would be appreciated even if it's just some example of filter in use or a brief explanation. I'm a little confused on the syntax.
Thanks.
Chris 

--

 

 

--

 

 


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »