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
Message from discussion cypher query to connect a where clause with the elements of an array
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:11 am
From: divyanshu das <divyanshu....@gmail.com>
Date: Fri, 9 Nov 2012 03:11:52 -0800 (PST)
Local: Fri, Nov 9 2012 6:11 am
Subject: Re: [Neo4j] cypher query to connect a where clause with the elements of an array

Ok. so finally the query the completed, and shows me the desired results if
I specify node numbers.

But it fails for node(8). I am assuming its some memory management issue.
Right now, I dont have time to get into this.

Can someone tell me, how do I pass an array or list as an argument for
start node. Something like,

start n = node(array of nodes)
Since I am already passing an array, so it will be second array. Is paasing
of two arrays allowed in the same query?

On Friday, 9 November 2012 02:12:45 UTC+5:30, divyanshu das wrote:

> the database is designed in a way that, if a node has "rel" relationship
> it'll have "prop" property too.

> has(n.prop) is just to check if starting node has "prop" property.

> On Friday, 9 November 2012 01:55:24 UTC+5:30, Wes Freeman wrote:

>> Your queries might be mixing up the "n" and "b" identifiers. I think you
>> mean:
>> "has(b.prop) and not(b.prop in {phparr})"

>> Wes

>> On Thu, Nov 8, 2012 at 3:19 PM, divyanshu das <divyan...@gmail.com>wrote:

>>> Yes, I do have indexes.

>>> this is the query I am using:- $queryTemplate = "START n = node(*) MATCH
>>> n-[:rel]->b WHERE has(n.prop) AND not(b.prop in {phparr}) RETURN b";
>>> phparr is one single array.

>>> Ideally this query should return all the list of nodes "b" , which has a
>>> "rel" relationship and b.prop is not an element of array.
>>> But it gives the error I pasted earlier

>>> If I use this query:- $queryTemplate = "START n = node(1239147) MATCH
>>> n-[:rel]->b WHERE (n.prop in {phparr}) RETURN b";

>>> I get nodes with b.prop in the array.

>>> But when I use this query with a "not" in where clause it gives no
>>> results. I have tried it with 10 nodes. everytime zero results.

>>> My db has 6 million nodes, and 1645 have property "prop"

>>> On Friday, 9 November 2012 01:21:33 UTC+5:30, Wes Freeman wrote:

>>>> It will. David is just saying (in response to the question about how to
>>>> delete in cypher, earlier in the thread) that if you have indexes on those
>>>> nodes (do you?), you should query the indexes on the particular fields that
>>>> are indexed so the indexes get cleaned up, afterward. You also need to
>>>> delete the relationships connected to those nodes at the same time (else
>>>> you'll get an error about not being able to delete nodes with
>>>> relationships), so you might end up with something like "match n-[r?]-()
>>>> ... delete n,r;"

>>>> I'm not sure what the PHP error is coming from--I'm not much of a PHP
>>>> guy, myself. Is this a single command that's failing after 10 minutes, or
>>>> are you iterating through some list of arrays and it's failing on one of
>>>> the particular arrays?

>>>> On Thu, Nov 8, 2012 at 1:42 PM, divyanshu das <divyan...@gmail.com>wrote:

>>>>> thnx for pointing this out. But I did not quite understand it. Does
>>>>> this mean, that if I replace "return" by "delete" it wont delete the nodes?

>>>>> However, right now, I  want to return those nodes first so that I can
>>>>> check if I am actually deleting the right node.

>>>>> On Friday, 9 November 2012  00:03:03 UTC+5:30, David Montag wrote:

>>>>>> Just want to jump in here. The current workaround for deleting
>>>>>> indexed nodes with Cypher requires you to know what indexes the node is
>>>>>> indexed in, and for which property keys and values it is indexed. You can
>>>>>> then delete the node, and then look it up in all indexes where it was
>>>>>> previously indexed. This will not return any results, but it will trigger
>>>>>> the necessary cleanup of the index.

>>>>>> David

>>>>>> On Wed, Nov 7, 2012 at 1:36 PM, divyanshu das <divyan...@gmail.com>wrote:

>>>>>>> Is there any other way to delete nodes in 1.6.1 without using cypher
>>>>>>> queries?

>>>>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:

>>>>>>>> It isn't a good idea to depend on node ids for long term use
>>>>>>>> (rather, use an email address or guid or similar unique id, with an index).
>>>>>>>> Ids are reused after you restart the server, I think, if they were deleted.

>>>>>>>> Wes

>>>>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:

>>>>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I
>>>>>>>>> delete the nodes, will the node ids for other users remain unchanged or
>>>>>>>>> neo4j automatically reuses the deleted ids?

>>>>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das
>>>>>>>>> wrote:

>>>>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method
>>>>>>>>>> is not available in 1.6.1. Any workaround  for this?

>>>>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:

>>>>>>>>>>> I guess that's not exactly what you asked for... how about this:

>>>>>>>>>>> http://console.neo4j.org/r/**xg5******y9u<http://console.neo4j.org/r/xg5y9u>

>>>>>>>>>>> start n=node(*)
>>>>>>>>>>> match n-[:rel]->()
>>>>>>>>>>> where has(n.arr) and not(n.prop in n.arr)
>>>>>>>>>>> return n;

>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:

>>>>>>>>>>>> You can't delete via Cypher with that version of Neo.

>>>>>>>>>>>> If you want to just find them, you could do something like (I'm
>>>>>>>>>>>> not entirely sure this worked back then, either--you might consider
>>>>>>>>>>>> upgrading):

>>>>>>>>>>>> start n=node(*)
>>>>>>>>>>>> where n.prop in n.arr
>>>>>>>>>>>> return n;

>>>>>>>>>>>> Wes

>>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <
>>>>>>>>>>>> divyan...@gmail.com> wrote:

>>>>>>>>>>>>> I have neo4j 1.6.1 and I am using php .

>>>>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.

>>>>>>>>>>>>> I want to delete all nodes from neo4j having a certain
>>>>>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the
>>>>>>>>>>>>> array "arr".

>>>>>>>>>>>>> Can somebody help me out with this?

>>>>>>>>>>>>> --

>>>>>>>>>>>  --

>>>>>>>>  --

>>>>>> --
>>>>>> David Montag <david....@**neotechnolog**y.com>
>>>>>> Neo Technology, www.neotechnology.****com<http://www.neotechnology.com/>
>>>>>> Cell: 650.556.4411
>>>>>> Skype: ddmontag

>>>>>  --

>>>>  --


 
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.