On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
> 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:
>>>>>>>>>>>> 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?
> 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:
>>>>>>>>>>>> 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?
> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>> 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:
>>>>>>>>>>>>> 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? >>>>>>>>>>>>>>> --
>>>>>>>>>>> --
>>>>>>>>> --
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
On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger wrote:
> 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 <divyan...@gmail.com<javascript:> > >:
> correction:- it should be node(*) not node(8)
> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>> 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:
>>>>>>>>>>>>> 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?
> 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.
> 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?
> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger wrote:
>> 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 <divyan...@gmail.com>:
>> correction:- it should be node(*) not node(8)
>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>>> 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:
>>>>>>>>>>>>>> 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?
On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freeman....@gmail.com> wrote:
> Try node:nodeindex("prop:{phparr}")?
> Wes
> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <divyanshu....@gmail.com>wrote:
>> 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.
>> 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?
>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger wrote:
>>> 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 <divyan...@gmail.com>:
>>> correction:- it should be node(*) not node(8)
>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>>>> 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:
>>>>>>>>>>>>>>> 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?
> no luck....
> Parse error: syntax error, unexpected T_STRING in
> /var/www/new-ui/app/services/users_service.php on line 106
> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freeman....@gmail.com>wrote:
>> Try node:nodeindex("prop:{phparr}")?
>> Wes
>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <divyanshu....@gmail.com>wrote:
>>> 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.
>>> 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?
>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger wrote:
>>>> 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 <divyan...@gmail.com>:
>>>> correction:- it should be node(*) not node(8)
>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>>>>> 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:
>>>>>>>>>>>>>>>> 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?
On Sat, Nov 10, 2012 at 11:01 AM, Wes Freeman <freeman....@gmail.com> wrote:
> 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:
>> no luck....
>> Parse error: syntax error, unexpected T_STRING in
>> /var/www/new-ui/app/services/users_service.php on line 106
>> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freeman....@gmail.com>wrote:
>>> Try node:nodeindex("prop:{phparr}")?
>>> Wes
>>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <divyanshu....@gmail.com>wrote:
>>>> 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.
>>>> 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?
>>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger wrote:
>>>>> 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 <divyan...@gmail.com>:
>>>>> correction:- it should be node(*) not node(8)
>>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>>>>>> 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:
>>>>>>>>>>>>>>>>> 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?
On Sat, Nov 10, 2012 at 9:32 PM, Wes Freeman <freeman....@gmail.com> wrote:
> 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.
> On Sat, Nov 10, 2012 at 11:01 AM, Wes Freeman <freeman....@gmail.com>wrote:
>> 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:
>>> no luck....
>>> Parse error: syntax error, unexpected T_STRING in
>>> /var/www/new-ui/app/services/users_service.php on line 106
>>> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freeman....@gmail.com>wrote:
>>>> Try node:nodeindex("prop:{phparr}")?
>>>> Wes
>>>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <divyanshu....@gmail.com
>>>> > wrote:
>>>>> 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.
>>>>> 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?
>>>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger wrote:
>>>>>> 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 <divyan...@gmail.com>:
>>>>>> correction:- it should be node(*) not node(8)
>>>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>>>>>>> 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:
>>>>>>>>>>>>>>>>>> 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
On Saturday, 10 November 2012 21:39:16 UTC+5:30, divyanshu das wrote:
> damn...!!
> and queries for node(*) are not working. i am stuck then.
> On Sat, Nov 10, 2012 at 9:32 PM, Wes Freeman <freeman....@gmail.com>wrote:
>> 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.
>> On Sat, Nov 10, 2012 at 11:01 AM, Wes Freeman <freeman....@gmail.com>wrote:
>>> 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:
>>>> no luck.... >>>> Parse error: syntax error, unexpected T_STRING in >>>> /var/www/new-ui/app/services/users_service.php on line 106
>>>> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freeman....@gmail.com>wrote:
>>>>> Try node:nodeindex("prop:{phparr}")?
>>>>> Wes
>>>>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das < >>>>> divyanshu....@gmail.com> wrote:
>>>>>> 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.
>>>>>> 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?
>>>>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger wrote:
>>>>>>> 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 <divyan...@gmail.com>:
>>>>>>> correction:- it should be node(*) not node(8)
>>>>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>>>>>>>> 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:
>>>>>>>>>>>>>>>>>>> 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;
> $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.
> On Saturday, 10 November 2012 21:39:16 UTC+5:30, divyanshu das wrote:
>> damn...!!
>> and queries for node(*) are not working. i am stuck then.
>> On Sat, Nov 10, 2012 at 9:32 PM, Wes Freeman <freeman....@gmail.com>wrote:
>>> 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.
>>> On Sat, Nov 10, 2012 at 11:01 AM, Wes Freeman <freeman....@gmail.com>wrote:
>>>> 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:
>>>>> no luck....
>>>>> Parse error: syntax error, unexpected T_STRING in
>>>>> /var/www/new-ui/app/services/**users_service.php on line 106
>>>>> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freeman....@gmail.com>wrote:
>>>>>> Try node:nodeindex("prop:{phparr}"**)?
>>>>>> Wes
>>>>>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <
>>>>>> divyanshu....@gmail.com> wrote:
>>>>>>> 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.
>>>>>>> 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?
>>>>>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger wrote:
>>>>>>>> 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 <divyan...@gmail.com>:
>>>>>>>> correction:- it should be node(*) not node(8)
>>>>>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>>>>>>>>> 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:
>>>>>>>>>>>>>>>>>>>> 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 <
andres.tay...@neotechnology.com> wrote:
> 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:
>> 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.
>> On Saturday, 10 November 2012 21:39:16 UTC+5:30, divyanshu das wrote:
>>> damn...!!
>>> and queries for node(*) are not working. i am stuck then.
>>> On Sat, Nov 10, 2012 at 9:32 PM, Wes Freeman <freeman....@gmail.com>wrote:
>>>> 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.
>>>> On Sat, Nov 10, 2012 at 11:01 AM, Wes Freeman <freeman....@gmail.com>wrote:
>>>>> 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:
>>>>>> no luck....
>>>>>> Parse error: syntax error, unexpected T_STRING in
>>>>>> /var/www/new-ui/app/services/**users_service.php on line 106
>>>>>> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freeman....@gmail.com>wrote:
>>>>>>> Try node:nodeindex("prop:{phparr}"**)?
>>>>>>> Wes
>>>>>>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <
>>>>>>> divyanshu....@gmail.com> wrote:
>>>>>>>> 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.
>>>>>>>> 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?
>>>>>>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger wrote:
>>>>>>>>> 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 <divyan...@gmail.com
>>>>>>>>> >:
>>>>>>>>> correction:- it should be node(*) not node(8)
>>>>>>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>>>>>>>>>> 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
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.
> On Sun, Nov 11, 2012 at 12:34 AM, Andres Taylor <
> andres.tay...@neotechnology.com> wrote:
>> 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:
>>> 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.
>>> On Saturday, 10 November 2012 21:39:16 UTC+5:30, divyanshu das wrote:
>>>> damn...!!
>>>> and queries for node(*) are not working. i am stuck then.
>>>> On Sat, Nov 10, 2012 at 9:32 PM, Wes Freeman <freeman....@gmail.com>wrote:
>>>>> 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.
>>>>> On Sat, Nov 10, 2012 at 11:01 AM, Wes Freeman <freeman....@gmail.com>wrote:
>>>>>> 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:
>>>>>>> no luck....
>>>>>>> Parse error: syntax error, unexpected T_STRING in >>>>>>> /var/www/new-ui/app/services/**users_service.php on line 106
>>>>>>> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freeman....@gmail.com>wrote:
>>>>>>>> Try node:nodeindex("prop:{phparr}"**)?
>>>>>>>> Wes
>>>>>>>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <
>>>>>>>> divyanshu....@gmail.com> wrote:
>>>>>>>>> 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.
>>>>>>>>> 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?
>>>>>>>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger wrote:
>>>>>>>>>> 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 <divyan...@gmail.com
>>>>>>>>>> >:
>>>>>>>>>> correction:- it should be node(*) not node(8)
>>>>>>>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das wrote:
>>>>>>>>>>> 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:
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?
> 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.
> On Sunday, 11 November 2012 00:37:56 UTC+5:30, divyanshu das wrote:
>> because its giving me a error, its not deleting the nodes and >> relationships.
>> On Sun, Nov 11, 2012 at 12:34 AM, Andres Taylor <
>> andres...@neotechnology.com <javascript:>> wrote:
>>> 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 <divyan...@gmail.com<javascript:>
>>> > wrote:
>>>> 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.
>>>> On Saturday, 10 November 2012 21:39:16 UTC+5:30, divyanshu das wrote:
>>>>> damn...!!
>>>>> and queries for node(*) are not working. i am stuck then.
>>>>> On Sat, Nov 10, 2012 at 9:32 PM, Wes Freeman <freem...@gmail.com<javascript:>
>>>>> > wrote:
>>>>>> 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.
>>>>>> On Sat, Nov 10, 2012 at 11:01 AM, Wes Freeman <freem...@gmail.com<javascript:>
>>>>>> > wrote:
>>>>>>> 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 <divyan...@gmail.com<javascript:>
>>>>>>> > wrote:
>>>>>>>> no luck....
>>>>>>>> Parse error: syntax error, unexpected T_STRING in >>>>>>>> /var/www/new-ui/app/services/**users_service.php on line 106
>>>>>>>> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freem...@gmail.com<javascript:>
>>>>>>>> > wrote:
>>>>>>>>> Try node:nodeindex("prop:{phparr}"**)?
>>>>>>>>> Wes
>>>>>>>>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <
>>>>>>>>> divyan...@gmail.com <javascript:>> wrote:
>>>>>>>>>> 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.
>>>>>>>>>> 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?
>>>>>>>>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger >>>>>>>>>> wrote:
>>>>>>>>>>> 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 <
>>>>>>>>>>> divyan...@gmail.com>:
>>>>>>>>>>> correction:- it should be node(*) not node(8)
>>>>>>>>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das >>>>>>>>>>> wrote:
>>>>>>>>>>>> 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
On Saturday, November 10, 2012 8:43:20 PM UTC-5, Josh Adell wrote:
> 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
> On Saturday, November 10, 2012 5:18:29 PM UTC-5, divyanshu das wrote:
>> @andres,
>> So, there was nothing wrong in the cypher query.
>> 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.
>> On Sunday, 11 November 2012 00:37:56 UTC+5:30, divyanshu das wrote:
>>> because its giving me a error, its not deleting the nodes and >>> relationships.
>>> On Sun, Nov 11, 2012 at 12:34 AM, Andres Taylor <
>>> andres...@neotechnology.com> wrote:
>>>> 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 <divyan...@gmail.com>wrote:
>>>>> 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.
>>>>> On Saturday, 10 November 2012 21:39:16 UTC+5:30, divyanshu das wrote:
>>>>>> damn...!!
>>>>>> and queries for node(*) are not working. i am stuck then.
>>>>>> On Sat, Nov 10, 2012 at 9:32 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>> 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.
>>>>>>> On Sat, Nov 10, 2012 at 11:01 AM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>> 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 <
>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>> no luck....
>>>>>>>>> Parse error: syntax error, unexpected T_STRING in >>>>>>>>> /var/www/new-ui/app/services/**users_service.php on line 106
>>>>>>>>> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>> Try node:nodeindex("prop:{phparr}"**)?
>>>>>>>>>> Wes
>>>>>>>>>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <
>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>> 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.
>>>>>>>>>>> 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?
>>>>>>>>>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger >>>>>>>>>>> wrote:
>>>>>>>>>>>> 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 <
>>>>>>>>>>>> divyan...@gmail.com>:
>>>>>>>>>>>> correction:- it should be node(*) not node(8)
>>>>>>>>>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das >>>>>>>>>>>> wrote:
>>>>>>>>>>>>> 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
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.
On Sunday, 11 November 2012 08:59:40 UTC+5:30, Josh Adell wrote:
> I just tried with differing amounts of nodes being deleted. Around 700k, > the query started timing out and throwing an exception.
> -- Josh
> On Saturday, November 10, 2012 8:43:20 PM UTC-5, Josh Adell wrote:
>> 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
>> On Saturday, November 10, 2012 5:18:29 PM UTC-5, divyanshu das wrote:
>>> @andres,
>>> So, there was nothing wrong in the cypher query.
>>> 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.
>>> On Sunday, 11 November 2012 00:37:56 UTC+5:30, divyanshu das wrote:
>>>> because its giving me a error, its not deleting the nodes and >>>> relationships.
>>>> On Sun, Nov 11, 2012 at 12:34 AM, Andres Taylor <
>>>> andres...@neotechnology.com> wrote:
>>>>> 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 <divyan...@gmail.com>wrote:
>>>>>> 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.
>>>>>> On Saturday, 10 November 2012 21:39:16 UTC+5:30, divyanshu das wrote:
>>>>>>> damn...!!
>>>>>>> and queries for node(*) are not working. i am stuck then.
>>>>>>> On Sat, Nov 10, 2012 at 9:32 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>> 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.
>>>>>>>> On Sat, Nov 10, 2012 at 11:01 AM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>> 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 <
>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>> no luck....
>>>>>>>>>> Parse error: syntax error, unexpected T_STRING in >>>>>>>>>> /var/www/new-ui/app/services/**users_service.php on line 106
>>>>>>>>>> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <
>>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>>> 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.
>>>>>>>>>>>> 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?
>>>>>>>>>>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger >>>>>>>>>>>> wrote:
>>>>>>>>>>>>> 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 <
>>>>>>>>>>>>> divyan...@gmail.com>:
>>>>>>>>>>>>> correction:- it should be node(*) not node(8)
>>>>>>>>>>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das >>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>> 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.
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.
On Sunday, November 11, 2012 4:58:42 AM UTC-5, divyanshu das wrote:
> 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.
> On Sunday, 11 November 2012 08:59:40 UTC+5:30, Josh Adell wrote:
>> I just tried with differing amounts of nodes being deleted. Around 700k, >> the query started timing out and throwing an exception.
>> -- Josh
>> On Saturday, November 10, 2012 8:43:20 PM UTC-5, Josh Adell wrote:
>>> 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
>>> On Saturday, November 10, 2012 5:18:29 PM UTC-5, divyanshu das wrote:
>>>> @andres,
>>>> So, there was nothing wrong in the cypher query.
>>>> 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.
>>>> On Sunday, 11 November 2012 00:37:56 UTC+5:30, divyanshu das wrote:
>>>>> because its giving me a error, its not deleting the nodes and >>>>> relationships.
>>>>> On Sun, Nov 11, 2012 at 12:34 AM, Andres Taylor <
>>>>> andres...@neotechnology.com> wrote:
>>>>>> 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 <divyan...@gmail.com>wrote:
>>>>>>> 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.
>>>>>>> On Saturday, 10 November 2012 21:39:16 UTC+5:30, divyanshu das wrote:
>>>>>>>> damn...!!
>>>>>>>> and queries for node(*) are not working. i am stuck then.
>>>>>>>> On Sat, Nov 10, 2012 at 9:32 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>> 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.
>>>>>>>>> On Sat, Nov 10, 2012 at 11:01 AM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>> 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 <
>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>> no luck....
>>>>>>>>>>> Parse error: syntax error, unexpected T_STRING in >>>>>>>>>>> /var/www/new-ui/app/services/**users_service.php on line 106
>>>>>>>>>>> On Sat, Nov 10, 2012 at 8:08 PM, Wes Freeman <freem...@gmail.com
>>>>>>>>>>> > wrote:
>>>>>>>>>>>> On Sat, Nov 10, 2012 at 4:50 AM, divyanshu das <
>>>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>>>> 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.
>>>>>>>>>>>>> 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?
>>>>>>>>>>>>> On Friday, 9 November 2012 17:49:17 UTC+5:30, Michael Hunger >>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>> 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 <
>>>>>>>>>>>>>> divyan...@gmail.com>:
>>>>>>>>>>>>>> correction:- it should be node(*) not node(8)
>>>>>>>>>>>>>> On Friday, 9 November 2012 16:41:52 UTC+5:30, divyanshu das >>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>> 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