2009/2/13 Adam Rabung <adamrab...@gmail.com>:
> Hello,
> First - I am new to Neo, but very interested.  After years of solving
> problems w/ a relational model, neo is a breath of fresh air.  So far, the
> API has been a breeze.
Hi, glad to hear that!
>
> I recently ran into a problem where traversals were simply stopping sooner
> than I expected.  Being a "neophyte", I suspected I had chosen the wrong
> StopEvaluator, Directions, etc for my traversal.  Even after opening up the
> traversal parameters completely, I was still getting only a small section of
> the graph.  I came to realize the true problem was my custom StopEvaluator:
> node.getProperty("label");
> In my case, not all nodes have a label property.  This call was causing a
> NotFoundException, which is caught and swallowed by
> AbstractTraverser.traverseToNextNode.  From the comments, it looks like
> NotFoundException is legitimately possible if multiple threads are
> performing a traversal.  The consequence is any problem accessing Node
> properties inside of a StopEvaluator results in a silent traversal failure -
> it looks like the nodes just aren't there.
That's something we should look into. I'd say the best way would be
for that exception to be propagated up so that your application could
know about it, I'm not 100% sure how such thing work at the moment.
And another thing: in your case it'd probably be best to use the
node.getProperty( "label", null ) method which, instead of throwing
NotFoundException will return null if the "label" property isn't
there... in case you haven't already seen that method.
>
> Since NotFoundException has such a distinct and unrelated meaning for
> AbstractTraverser, maybe a PropertyNotFoundException could be used for
> indicating a problem accessing Node properties?
>
> Thanks,
> Adam
> _______________________________________________
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>

-- 
Mattias Persson, [matt...@neotechnology.com]
Neo Technology, www.neotechnology.com
_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to