Thanks. On Sun, Feb 20, 2011 at 2:24 PM, Tobias Ivarsson <tobias.ivars...@neotechnology.com> wrote: > On Sun, Feb 20, 2011 at 10:48 AM, Alfredas Chmieliauskas < > al.fre...@gmail.com> wrote: > >> Dear all, >> >> could somebody point me to more documentation on the new traversal >> framework (besides http://wiki.neo4j.org/content/Traversal_Framework)? >> Also the new Evaluator and how to use it? >> > > That page, along with the examples pages is the best there is: > * http://components.neo4j.org/neo4j-examples/snapshot/traversal.html > * http://wiki.neo4j.org/content/Traversal_HowTo >
I think that some of the examples are deprecated in the new release. > >> >> If we have a graph described in the pipes Co-Developers example >> (https://github.com/tinkerpop/pipes/wiki/Using-Pipes-to-Traverse-Graphs). >> Would this traversal return the co-developers? >> >> Traversal.description() >> .depthFirst() >> .relationships(RelationshipTypes.CREATED, Direction.OUTGOING) >> .relationships(RelationshipTypes.CREATED, Direction.INCOMING) >> .traverse(developer).nodes() >> > > No, unfortunately it wouldn't. Relationship type specifications in > TraversalDescriptions are not ordered, what you have written is just a > different spelling of: > > Traversal.description() > .depthFirst() > .relationships(RelationshipTypes.CREATED, Direction.BOTH) > .traverse(developer).nodes() > So this would be one way of finding co-developers using traversal: Traversal.description() .depthFirst() .relationships(RelationshipTypes.CREATED) .evaluator(new Evaluator() { @Override public Evaluation evaluate(Path path) { if (path.length() > 1) { // co-developer return Evaluation.INCLUDE_AND_CONTINUE; } else { // project return Evaluation.EXCLUDE_AND_CONTINUE; } } }); I can imagine a few more ways to do that. I wonder if there are any guidelines on whats the better way to do it (performance considerations). Alfredas _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user