Re: [Neo4j] [SOLVED] Traversing graph after adding node
You don't have to commit a transaction in order to see the changes in it. You can add a node and a relationship and within that same transaction find it via a traversal. And then after doing several of those commit and that's completely fine. 2011/10/24 Rubicon dj__d...@hotmail.com Realized, that I've to give the hole path to the node I'm looking fore... have: [refNode]USER---[user]HAS_OCCUPATION[occupation] For some reason the traverser Traverser usersTraverser = firstNode.traverse(Order.BREADTH_FIRST, StopEvaluator.END_OF_GRAPH, ReturnableEvaluator.ALL_BUT_START_NODE, RelTypes.HAS_OCCUPATION, Direction.OUTGOING); wouldn't find the [occupation] node. Adding additional parameters to the traverser (RelTypes.USER, Direction.OUTGOING), and implementing the ReturnableEvaluator to return currentPosition.lastRelationshipTraversed().isType(RelTypes.HAS_OCCUPATION) have done the job. Don't have to commit the transaction also. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Traversing-graph-after-adding-node-tp3448023p3448255.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [SOLVED] Traversing graph after adding node
Realized, that I've to give the hole path to the node I'm looking fore... have: [refNode]USER---[user]HAS_OCCUPATION[occupation] For some reason the traverser Traverser usersTraverser = firstNode.traverse(Order.BREADTH_FIRST, StopEvaluator.END_OF_GRAPH, ReturnableEvaluator.ALL_BUT_START_NODE, RelTypes.HAS_OCCUPATION, Direction.OUTGOING); wouldn't find the [occupation] node. Adding additional parameters to the traverser (RelTypes.USER, Direction.OUTGOING), and implementing the ReturnableEvaluator to return currentPosition.lastRelationshipTraversed().isType(RelTypes.HAS_OCCUPATION) have done the job. Don't have to commit the transaction also. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Traversing-graph-after-adding-node-tp3448023p3448255.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [SOLVED] Traversing graph after adding node
Hi there, so the problem is solved for you? If you have more questions, maybe you can post a GIST so I can have a look? 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 http://www.neo4j.org - NOSQL for the Enterprise. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. On Mon, Oct 24, 2011 at 9:12 AM, Rubicon dj__d...@hotmail.com wrote: Realized, that I've to give the hole path to the node I'm looking fore... have: [refNode]USER---[user]HAS_OCCUPATION[occupation] For some reason the traverser Traverser usersTraverser = firstNode.traverse(Order.BREADTH_FIRST, StopEvaluator.END_OF_GRAPH, ReturnableEvaluator.ALL_BUT_START_NODE, RelTypes.HAS_OCCUPATION, Direction.OUTGOING); wouldn't find the [occupation] node. Adding additional parameters to the traverser (RelTypes.USER, Direction.OUTGOING), and implementing the ReturnableEvaluator to return currentPosition.lastRelationshipTraversed().isType(RelTypes.HAS_OCCUPATION) have done the job. Don't have to commit the transaction also. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Traversing-graph-after-adding-node-tp3448023p3448255.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user