2011/3/28 Brendan Cheng <ccp...@gmail.com> > Hi, > > I setup a traversal description with Uniqueness.NODE_PATH and the side > effect is duplicated nodes output. > How to filter the duplicated output in nodes and relationship under > your Transversal Framework? > > You are getting duplicated end nodes, but the paths are unique (as the uniqueness you've chosen suggests). You could solve it by adding an evaluator which filters duplicate end nodes for you:
new Evaluator() { Set<Long> ids = new HashSet<Long>(); public Evaluation evaluate( Path path ) { return Evaluation.ofIncludes( ids.add( path.endNode().getId() ) ); } } > Also, this link isn't working > > http://components.neo4j.org/neo4j-kernel/apidocs/org/neo4j/kernel/Traversal.html#returnAllButStartNode() Where did you get that link? The correct is http://components.neo4j.org/neo4j-kernel/snapshot/apidocs/org/neo4j/kernel/Traversal.html#returnAllButStartNode(with the added /snapshot) > > > Regards, > > Brendan > _______________________________________________ > 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