If that is a very frequent operation, you could introduce an intermediate node that depicts the root of the tree which is fixed (and probably anonymous) and have that node have a single relationship to the parent which can be easily replaced.
Cheers Michael Am 11.08.2011 um 21:06 schrieb Carl Nordenfelt: > It's the relationship itself (or to be exact it is the end node of all > relationships to a specific node that I would like to change). The > relationship is one to many. Actually it is a parent child relationship (one > parent have multiple children) and I would like to reassign the parent for > all children of a specific parent. > > //Carl > > On Thu, Aug 11, 2011 at 8:53 PM, Rick Bullotta > <[email protected]>wrote: > >> A couple questions: >> >> - What are you changing? The properties of the relationship(s) or the >> relationships themselves? >> - Are you relationships many-to-many, one-to-many, or one-to-one? >> >> >> >> -----Original Message----- >> From: [email protected] [mailto:[email protected]] >> On Behalf Of cnordenfelt >> Sent: Thursday, August 11, 2011 1:55 PM >> To: [email protected] >> Subject: Re: [Neo4j] Change multiple relations in one operation >> >> Thanks >> For now I'm just prototyping and the case might be that there are several >> millions of relationshids that has to be changed in one transaction. >> However, it is a very uncommon operation and it might also be that the >> graph >> design should be changed to limit the number of relationships? >> >> //Carl >> >> On Thu, Aug 11, 2011 at 6:04 PM, Peter Neubauer [via Neo4j Community >> Discussions] <[email protected]> wrote: >> >>> Carl, >>> this is what you can do. Relationships are immutable, that is, once >>> created you have to delete them and create new ones in order to change >>> endpoints. Not much choice there. What is the size of your >>> reassignments and the number of relationships in one transaction? >>> >>> Cheers, >>> >>> /peter neubauer >>> >>> GTalk: neubauer.peter >>> Skype peter.neubauer >>> Phone +46 704 106975 >>> LinkedIn http://www.linkedin.com/in/neubauer >>> Twitter http://twitter.com/peterneubauer >>> >>> <a href="http://www.neo4j.org ">http://www.neo4j.org - >> Your >>> high performance graph database. >>> http://startupbootcamp.org/ - Ă–resund - Innovation happens HERE. >>> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. >>> >>> >>> >>> On Thu, Aug 11, 2011 at 4:47 PM, cnordenfelt <[hidden email]< >> http://user/SendEmail.jtp?type=node&node=3246384&i=0>> >>> wrote: >>> >>>> Hi >>>> I have started to digg into neo4j and have not found a nice way to >> change >>> >>>> many relationships from one node to another. For example, I have n1 >> with >>> a >>>> relationship to m1, m2 and m3. Now I would like to change the >>> relationship >>>> to point from n2 to m1, m2 and m3 instead. I could of course fetch all >>>> relationships from n1 and change each relationship individually to n2 >> but >>> >>>> this will make me iterate over all relationships, which could be quite >>> many. >>>> Is there any way to replace a node with another or to "reassign" >> multiple >>> >>>> relationships with one operation? >>>> >>>> I'm currently using the Java API. >>>> >>>> Thanks >>>> Carl >>>> >>>> -- >>>> View this message in context: >>> >> http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246141.html >>>> Sent from the Neo4j Community Discussions mailing list archive at >>> Nabble.com. >>>> _______________________________________________ >>>> Neo4j mailing list >>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=3246384&i=1> >>>> https://lists.neo4j.org/mailman/listinfo/user >>>> >>> _______________________________________________ >>> Neo4j mailing list >>> [hidden email] <http://user/SendEmail.jtp?type=node&node=3246384&i=2> >>> https://lists.neo4j.org/mailman/listinfo/user >>> >>> >>> ------------------------------ >>> If you reply to this email, your message will be added to the discussion >>> below: >>> >>> >> http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246384.html >>> To unsubscribe from Change multiple relations in one operation, click >>> here< >> http://neo4j-community-discussions.438527.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3246141&code=Y2FybC5ub3JkZW5mZWx0QGdtYWlsLmNvbXwzMjQ2MTQxfDQwNDcxMjI= >>> . >>> >>> >> >> >> -- >> View this message in context: >> http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246722.html >> Sent from the Neo4j Community Discussions mailing list archive at >> Nabble.com. >> _______________________________________________ >> Neo4j mailing list >> [email protected] >> https://lists.neo4j.org/mailman/listinfo/user >> _______________________________________________ >> Neo4j mailing list >> [email protected] >> https://lists.neo4j.org/mailman/listinfo/user >> > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

