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
Filtering nodes by number of children?
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
  8 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
 
Thomas  
View profile  
 More options May 4 2012, 10:24 am
From: Thomas <thomas.zast...@googlemail.com>
Date: Fri, 4 May 2012 07:24:51 -0700 (PDT)
Local: Fri, May 4 2012 10:24 am
Subject: Filtering nodes by number of children?
Hello,

is it possible in Cypher to get back nodes which have a given number
of children?  For example, I want to get all nodes which have exactly
5 children.

I tried it this way:

start n=node(*) match n-[r?]->m where count(m)=5 return n;

But this produces the Exception:

Exception in thread "main" Can't use aggregate functions in the WHERE
clause. Move it to the HAVING clause.

I can't find any information about a "HAVING" clause in the docs?

Thanks for information ;-)


 
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  
 More options May 4 2012, 12:00 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Fri, 4 May 2012 18:00:09 +0200
Local: Fri, May 4 2012 12:00 pm
Subject: Re: [Neo4j] Filtering nodes by number of children?
cypher 1.8 has with which can also function as where (query piping)

start n=node(*) match n-->m with n, count(*) as children where children = 2 return n, children

see here: http://tinyurl.com/cqodxah

Am 04.05.2012 um 16:24 schrieb Thomas:


 
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 May 4 2012, 12:47 pm
From: Andres Taylor <andres.tay...@neotechnology.com>
Date: Fri, 4 May 2012 18:47:13 +0200
Local: Fri, May 4 2012 12:47 pm
Subject: Re: [Neo4j] Filtering nodes by number of children?

Ooops. Missed that. HAVING was planned and then scrapped. Michael's
suggestion is the correct solution.

Andrés

On Fri, May 4, 2012 at 4:24 PM, Thomas <thomas.zast...@googlemail.com>wrote:


 
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.
Thomas  
View profile  
 More options May 5 2012, 12:16 pm
From: Thomas <thomas.zast...@googlemail.com>
Date: Sat, 5 May 2012 09:16:37 -0700 (PDT)
Local: Sat, May 5 2012 12:16 pm
Subject: Re: Filtering nodes by number of children?
Thanks for your replies.

I tried the command and get the error:

"start n=node(*) match n-->m with n, count(*) as children where
children = 20, return n, children"
                             ^
at
org.neo4j.cypher.internal.parser.v1_7.CypherParserImpl.parse(CypherParserIm pl.scala:
66)

I downloaded the latest stable release and the libs are showing up:

neo4j-cypher-1.7.jar
neo4j-cypher-1.8.M01.jar

So, I need to download the 1.8 snapshot?

And thanks for this wonderful piece of software ;-)

On 4 Mai, 18:47, Andres Taylor <andres.tay...@neotechnology.com>
wrote:


 
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.
Thomas  
View profile  
 More options May 5 2012, 12:18 pm
From: Thomas <thomas.zast...@googlemail.com>
Date: Sat, 5 May 2012 09:18:53 -0700 (PDT)
Local: Sat, May 5 2012 12:18 pm
Subject: Re: Filtering nodes by number of children?
Thanks for your replies.
I tried the command and get the error:

"start n=node(*) match n-->m with n, count(*) as children where
children = 20, return n, children"
                             ^
at
org.neo4j.cypher.internal.parser.v1_7.CypherParserImpl.parse(CypherParserIm pl.scala:
66)

I downloaded the latest stable release and the libs are showing up:

neo4j-cypher-1.7.jar
neo4j-cypher-1.8.M01.jar

So, I need to download the 1.8 snapshot?
And thanks for this wonderful piece of software ;-)

On 4 Mai, 18:47, Andres Taylor <andres.tay...@neotechnology.com>
wrote:

On 4 Mai, 18:47, Andres Taylor <andres.tay...@neotechnology.com>
wrote:


 
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.
Peter Neubauer  
View profile  
 More options May 5 2012, 12:28 pm
From: Peter Neubauer <neubauer.pe...@gmail.com>
Date: Sat, 5 May 2012 18:28:14 +0200
Local: Sat, May 5 2012 12:28 pm
Subject: Re: [Neo4j] Re: Filtering nodes by number of children?

Syntax error, remove the comma after the 20?
On May 5, 2012 6:16 PM, "Thomas" <thomas.zast...@googlemail.com> wrote:


 
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 May 6 2012, 4:34 am
From: Andres Taylor <andres.tay...@neotechnology.com>
Date: Sun, 6 May 2012 10:34:14 +0200
Local: Sun, May 6 2012 4:34 am
Subject: Re: [Neo4j] Re: Filtering nodes by number of children?

Something's wrong in your setup. You are using Cypher 1.7, judging by the
stack trace you provided. Can you try doing a clean install and copying the
database over?

Andrés

On Sat, May 5, 2012 at 6:16 PM, Thomas <thomas.zast...@googlemail.com>wrote:


 
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.
Thomas  
View profile  
 More options May 7 2012, 9:09 am
From: Thomas <thomas.zast...@googlemail.com>
Date: Mon, 7 May 2012 06:09:07 -0700 (PDT)
Local: Mon, May 7 2012 9:09 am
Subject: Re: [Neo4j] Re: Filtering nodes by number of children?

Dear all,

Thank you very much. It is an complete new installation of the stable
version, I will try the unstable version ;-)

(And yes of course, the comma was a typo ...)

Am Sonntag, 6. Mai 2012 10:34:14 UTC+2 schrieb Andres Taylor:


 
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 »