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
cypher query to connect a where clause with the elements of an array
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
  Messages 26 - 42 of 42 - Collapse all  -  Translate all to Translated (View all originals) < Older 
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
 
divyanshu das  
View profile  
 More options Nov 9 2012, 6:15 am
From: divyanshu das <divyanshu....@gmail.com>
Date: Fri, 9 Nov 2012 03:15:57 -0800 (PST)
Local: Fri, Nov 9 2012 6:15 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

correction:- it should be node(*)  not node(8)


 
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.
Wes Freeman  
View profile  
 More options Nov 9 2012, 7:08 am
From: Wes Freeman <freeman....@gmail.com>
Date: Fri, 9 Nov 2012 07:08:22 -0500
Local: Fri, Nov 9 2012 7:08 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

Yes, you can pass in two arrays, you just name them different things in the
parameters, like:

start n=node({arr_of_nodes}) where n.prop in {phparr} ...

Wes

On Fri, Nov 9, 2012 at 6:11 AM, divyanshu das <divyanshu....@gmail.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.
Michael Hunger  
View profile  
 More options Nov 9 2012, 7:19 am
From: Michael Hunger <michael.hun...@neopersistence.com>
Date: Fri, 9 Nov 2012 13:18:53 +0100
Local: Fri, Nov 9 2012 7:18 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

You can use parameters for that

Either in java or REST

start n=node({ids}) return n

Pass an array with the ids a parameter "ids" to the query execution

Sent from mobile device

Am 09.11.2012 um 12:15 schrieb divyanshu das <divyanshu....@gmail.com>:


 
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.
divyanshu das  
View profile  
 More options Nov 10 2012, 4:50 am
From: divyanshu das <divyanshu....@gmail.com>
Date: Sat, 10 Nov 2012 01:50:36 -0800 (PST)
Local: Sat, Nov 10 2012 4:50 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

this is the query I am trying to input to return the nodes indexed which
have a particular property "prop". When I provide individual "prop" values,
I get the desired results. But I need to pass an array of values. I am
using neo4j 1.8 and neo4jphp library. Also, queries based node(*) give
error after running for sometime. Although node(*) type queries work in
neo4j-shell.

$queryTemplate = "START n = node:nodeindex('prop:{phparr}') return n";
$query = new Query($client, $queryTemplate, array('phparr'=>
$result_array));
$neo_result = $query->getResultSet();

Error:-

I have tried these formats for query:-
node:nodeindex(prop = "{phparr}")    // No error but returns zero results
node:nodeindex(prop:'{phparr}')         // Gives the above error

Any help here?


 
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.
Wes Freeman  
View profile  
 More options Nov 10 2012, 9:39 am
From: Wes Freeman <freeman....@gmail.com>
Date: Sat, 10 Nov 2012 09:38:55 -0500
Local: Sat, Nov 10 2012 9:38 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

Try node:nodeindex("prop:{phparr}")?

Wes

On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <divyanshu....@gmail.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.
divyanshu das  
View profile  
 More options Nov 10 2012, 10:54 am
From: divyanshu das <divyanshu....@gmail.com>
Date: Sat, 10 Nov 2012 21:23:16 +0530
Local: Sat, Nov 10 2012 10:53 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

no luck....
Parse error: syntax error, unexpected T_STRING in
/var/www/new-ui/app/services/users_service.php on line 106


 
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.
Wes Freeman  
View profile  
 More options Nov 10 2012, 11:01 am
From: Wes Freeman <freeman....@gmail.com>
Date: Sat, 10 Nov 2012 11:01:04 -0500
Local: Sat, Nov 10 2012 11:01 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

Just grasping here... one final attempt before I give up:

node:nodeindex(prop={phparr})

On Sat, Nov 10, 2012 at 10:53 AM, divyanshu das <divyanshu....@gmail.com>wrote:

...

read more »


 
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.
Wes Freeman  
View profile  
 More options Nov 10 2012, 11:02 am
From: Wes Freeman <freeman....@gmail.com>
Date: Sat, 10 Nov 2012 11:02:18 -0500
Local: Sat, Nov 10 2012 11:02 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

Now that I reread exactly what you're trying to do, I don't think it's
going to work.

There's no way to do an "IN" query against an index, as far as I know.

...

read more »


 
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.
divyanshu das  
View profile  
 More options Nov 10 2012, 11:09 am
From: divyanshu das <divyanshu....@gmail.com>
Date: Sat, 10 Nov 2012 21:38:27 +0530
Local: Sat, Nov 10 2012 11:08 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

damn...!!

and queries for node(*) are not working.  i am stuck then.

...

read more »


 
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.
divyanshu das  
View profile  
 More options Nov 10 2012, 1:27 pm
From: divyanshu das <divyanshu....@gmail.com>
Date: Sat, 10 Nov 2012 10:27:17 -0800 (PST)
Local: Sat, Nov 10 2012 1:27 pm
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

What is wrong in this query?

$queryTemplate = "START n = node(123) MATCH n-[r:rel]-b WHERE has(b.prop)
AND not(b.prop in {phparr}) DELETE b, r";

I need to delete all nodes having a relationship "rel" with node 123, and
"prop" not in the "phparr" array.

...

read more »


 
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 Nov 10 2012, 2:04 pm
From: Andres Taylor <andres.tay...@neotechnology.com>
Date: Sat, 10 Nov 2012 20:04:56 +0100
Local: Sat, Nov 10 2012 2:04 pm
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

What makes you say that there is something wrong with your query?

Andrés

On Sat, Nov 10, 2012 at 7:27 PM, divyanshu das <divyanshu....@gmail.com>wrote:

...

read more »


 
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.
divyanshu das  
View profile  
 More options Nov 10 2012, 2:07 pm
From: divyanshu das <divyanshu....@gmail.com>
Date: Sun, 11 Nov 2012 00:37:10 +0530
Local: Sat, Nov 10 2012 2:07 pm
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

because its giving me a error, its not deleting the nodes and relationships.

when I use RETURN, it reurns nodes.

but with DELETE, it doesnt delete them.

This is the error that I am getting:-

Fatal error: Uncaught exception 'Everyman\Neo4j\Exception' with message
'Unable to execute query [400]: Headers: Array ( [Content-Length] => 1351
[Content-Encoding] => UTF-8 [Content-Type] => application/json
[Access-Control-Allow-Origin] => * [Server] => Jetty(6.1.25) ) Body: Array
( [message] => Unable to commit transaction [exception] =>
TransactionFailureException [stacktrace] => Array ( [0] =>
org.neo4j.kernel.TopLevelTransaction.finish(TopLevelTransaction.java:134)
[1] =>
org.neo4j.cypher.internal.pipes.CommitPipe.createResults(CommitPipe.scala:4 5)
[2] =>
org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$5$$anonf un$apply$3.apply(ExecutionPlanImpl.scala:104)
[3] =>
org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$5$$anonf un$apply$3.apply(ExecutionPlanImpl.scala:104)
[4] =>
org.neo4j.cypher.PipeExecutionResult.immutableResult(PipeExecutionResult.sc ala:37)
[5] => org.ne in /var/www/new-ui/app/libs/Everyman/Neo4j/Command.php on
line 117

On Sun, Nov 11, 2012 at 12:34 AM, Andres Taylor <

...

read more »


 
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.
divyanshu das  
View profile  
 More options Nov 10 2012, 5:18 pm
From: divyanshu das <divyanshu....@gmail.com>
Date: Sat, 10 Nov 2012 14:18:29 -0800 (PST)
Local: Sat, Nov 10 2012 5:18 pm
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

@andres,

So, there was nothing wrong in the cypher query.

I dont know why, but cypher delete query does not work for neo4jphp library.
https://github.com/jadell/neo4jphp

This is how, I was able to delete:-

I used the RETURN statement, to get the Result Set.

->After that, parse that result set to get node ids and store them in an
array.
->loop through the array, and for each element i.e. ID, $id(say)
   use getNode($id) to get the node,
->for these nodes, use getRelationships($id) to get the relationships. This
returns a relationship array.
->loop through this array, use delete() to delete the relationships.
->Outside the relationship loop, use delete() for node to delete the node.

Hope that helps for someone else who is facing the same problem.

...

read more »


 
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.
Josh Adell  
View profile  
 More options Nov 10 2012, 8:43 pm
From: Josh Adell <josh.ad...@gmail.com>
Date: Sat, 10 Nov 2012 17:43:20 -0800 (PST)
Local: Sat, Nov 10 2012 8:43 pm
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

In the exception when you are using node(*) , it says: "Unable to execute
query [100]: Headers: Array ( ) Body: Array ( ) '"
The fact that the REST request received no headers or body indicates that
the request probably timed out while waiting for a response.

I tried to recreate your scenario here: https://gist.github.com/4053297
but I don't have a database of 6 million nodes to check against. The delete
worked successfully for the 1000 relationships the script creates.

Can you run the query successfully using CURL from the command line?

-- Josh

...

read more »


 
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.
Josh Adell  
View profile  
 More options Nov 10 2012, 10:29 pm
From: Josh Adell <josh.ad...@gmail.com>
Date: Sat, 10 Nov 2012 19:29:40 -0800 (PST)
Local: Sat, Nov 10 2012 10:29 pm
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

I just tried with differing amounts of nodes being deleted. Around 700k,
the query started timing out and throwing an exception.

-- Josh

...

read more »


 
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.
divyanshu das  
View profile  
 More options Nov 11 2012, 4:58 am
From: divyanshu das <divyanshu....@gmail.com>
Date: Sun, 11 Nov 2012 01:58:42 -0800 (PST)
Local: Sun, Nov 11 2012 4:58 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

Sorry for late reply, I was sleeping(Time difference :P).

According to neo4j docs and as said by Michael Hunger, while using node(*),
it loads the entire graph in memory probably what every database does.
Is there a way to increase the timeout time in neo4jphp library? The total
size of my db is 29GB now.
It doesnot work even while using curl.

...

read more »


 
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.
Josh Adell  
View profile  
 More options Nov 11 2012, 5:07 pm
From: Josh Adell <josh.ad...@gmail.com>
Date: Sun, 11 Nov 2012 14:07:22 -0800 (PST)
Local: Sun, Nov 11 2012 5:07 pm
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

Can you run it using curl, using the "--max-time=1200" option (this will
keep the connection open for at most 20 minutes waiting for a response.)

I'm currently working on allowing setting of curl options in neo4jphp. But
if you only need to run this command once, you can just do it from the
command line, and pass curl the options directly.

-- Josh

...

read more »


 
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 < Older 
« Back to Discussions « Newer topic     Older topic »