Hello,

we are trying to construct an Evaluator that will select only one node from the 
middle of a path and include it in the result. We do have a specific path we 
are looking for and the endNode is stored in 'end'. Now what we would like to 
do is have an Evaluator like this:

          import org.neo4j.graphdb.traversal.
Evaluator;

          new Evaluator(){
            @Override
            public Evaluation evaluate(org.neo4j.graphdb.Path path) {
                if(path.length() > 3) {
                    return Evaluation.EXCLUDE_AND_PRUNE;
                } else if (path.length() == 2) {
                    return Evaluation.INCLUDE_AND_CONTINUE;
                } else if (path.length() < 2){
                    return Evaluation.EXCLUDE_AND_CONTINUE;
                } else {
                    return path.endNode().getId() == end.getId() ? 
Evaluation.EXCLUDE_AND_PRUNE : Evaluation.DROP_PATH_AND_PRUNE;
                }
            }
          }

The decision on whether to accept or drop a path is based on wether we have 
reached the endNode. That's why we would like to use something like 
DROP_PATH_AND_PRUNE, which doesn't exist. What are we missing?

Any help appreciated!

Thanks,
Stephan and Dario
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to