Hi, Welcome to the mailing list.
On Thu, Nov 12, 2009 at 9:28 PM, Andrew Nelder <[email protected]> wrote: > Hi, > > I would like to try playing around with and expanding upon the neo4j.py > wrapper; however, I've run into a few issues. > > (1) I can't seem to find a way to return helpful information about a node > (ie. it's depth). Does anyone have a working example or even an > explanation > of how to obtain the depth (and perhaps other node information) during a > traversal? I've been playing with the examples and documention on the > neo4j.py website, but it's not been extremely helpful. > The depth is available under the depth attribute in the nodes yielded from traversals. Just as it is in the traversal predicate methods[1]. The depth attribute is the only traversal attribute that is available on yielded nodes, inside the predicate methods the attributes last_relationship, is_start, previous_node, and returned_count are also available. > (2) Is there a better way to initialize the traversal? It uses lazy > imports, so Python seems to crap out when the code is run because neo4j > doesn't have properties like (Traversal) until NeoService is called. > Yes, this is a problem. I have not gotten around to fixing it yet, but it is on my TODO list for the next release. My plan is to have these available before NeoService is started, but until then the way you've done it is a pretty good work around. Over all I am not very satisfied with how traversals are defined for the python bindings. The current API is good enough to not be removed in the next version. But if anyone has any better suggestions on how to write traversals I would very much like to hear about it. Cheers, Tobias [1] See the Traversals section of http://components.neo4j.org/neo4j.py/index.html -- Tobias Ivarsson <[email protected]> Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 _______________________________________________ Neo mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

