Thank for the response. So I was doing exactly what Mattias suggested, but I thought that this might not be the most optimal way. Though, since I got a validation I would stick to that method.
On Fri, Jul 22, 2011 at 11:37 AM, sulabh choudhury <[email protected]>wrote: > Hi, > > I am trying to create a traverser and I am stuck. > So my code takes in a startNode, 2 relationshiptypes and 2 directions. > It will starting from startNode go to nodes with rel1 in dir1 and from all > those nodes to rel2,dir2. > The code below (in SCALA) works fine and I get the expected nodes. > > The issue is, along with the nodes I also need to get properties from the > relationships. So all my relationshiptypes have certain properties (key, > value), what I want is to get a particular property from rel1 and rel2. How > do I do that? > > > def traverser(node: Node, rel1: RelationshipType, rel2: RelationshipType, > dir1: Direction, dir2: Direction) = { > > val q1 = node.traverse(Order.BREADTH_FIRST, StopEvaluator.DEPTH_ONE, > ReturnableEvaluator.ALL_BUT_START_NODE, rel1, dir1).iterator() > > while(q1.hasNext){ > val n = q1.next() > val q2 = > n.traverse(Order.BREADTH_FIRST,StopEvaluator.DEPTH_ONE,ReturnableEvaluator.ALL_BUT_START_NODE, > rel2, dir2).iterator() > while(q2.hasNext) > println(q2.next) > } > } > > -- -- Thanks and Regards, Sulabh Choudhury _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

