[Neo] precedence of evaluators
mattias at neotechnology.com
Mon Jul 6 11:51:50 CEST 2009
I see your point there and the use of such an evaluator where only
zero or one node would be returned. That is definately a good utility
class to have. Either as a MixedEvaluator or maybe a
ReturnableEvaluatorAsStopEvaluator wrappers to accomplish this.
2009/7/3 Rob Challen <rjchallen at gmail.com>:
> Generally I am looking to traverse up a tree looking to see if there is a
> parent with a particular property. The evaluators return that single parent
> if it exists, and stop there. It is basically to return me the nearest
> neighbour that has a given property. In these situations the two evaluator
> types always return true at the same time. So in my most recent case I am
> parsing XMI into a graph and want to answer the question is a given UML
> class in a particular UML package by traversing up the containment
> It seems to most usually happen to me when I am using a traverser to perform
> a logical test where the returned nodes are not important but the fact that
> something has been found is. I guess also that in certain circumstances I
> wanted to use the same logic for returnable evaluators as I had written for
> stop evaluators in different contexts, so the "node with property X = value
> Y" evaluator gets reused both as a returnable and stop evaluator depending
> on what I am trying to do at the time.
> On Thu, Jul 2, 2009 at 10:26 PM, Johan Svensson <johan at neotechnology.com>wrote:
>> Hi Rob,
>> On Thu, Jul 2, 2009 at 12:43 PM, Rob Challen<rjchallen at gmail.com> wrote:
>> > Having lots of fun experimenting with Neo. Nice job.
>> Great to hear!
>> > Its not clear from the traverser documentation what behaviour I should
>> > expect from a traverser if both stop evaluator and returnable evaluator
>> > return true. Should it be returned or not? ...
>> The current position should be returned. If that is not clear in the
>> documentation we need to improve it.
>> > ... My random testing suggests that
>> > it is and you can reuse the same logic for a StopEvaluator and a
>> > ReturnableEvaluator if you need a single result, like this code for a
>> > subsumption test on a tree:
>> I'm not quite sure I understand what it is you are trying to do. Could
>> you elaborate a bit on the actual problem you're trying to solve? A
>> common super interface for StopEvaluator and ReturanbleEvaluator does
>> not exist today since we see them as two separate functions.
>> Neo mailing list
>> User at lists.neo4j.org
> Neo mailing list
> User at lists.neo4j.org
Mattias Persson, [mattias at neotechnology.com]
Neo Technology, www.neotechnology.com
More information about the User