Already though of that :) behold: PipeBuilder.fromNode(startNode).into(otherNode(A)) .into(traverse(myTraversalDescription)) .into(traverse(myOtherTraversalDescription)) .into(otherNode(B));
Or whatever. You can even use other "from", f.ex: fromNode, fromNodes, fromPath, fromPaths a.s.o. Something like that? 2011/3/15 Craig Taverner <cr...@amanzi.com> > I like the pipes idea. What I would like to see is nested traversers. The > pipe example below seems to imply single hops at each step, but it would be > nicer to allow each step to traverse until it reached a certain criteria, > at > which point a different traversal would take over. > > In the old and current API's it seems to do this you need to create a > traversal, iterate over it, and create a new traversal inside the loop. > > We created a Ruby DSL for nested traversals a year or so ago that looks a > bit like: > > > chart 'Distribution analysis' do > self.domain_axis='categories' > self.range_axis='values' > select 'First dataset',:categories=>'name',:values=>'value' do > from { > from { > traverse(:outgoing,:CHILD,1) > where {type=='gis' and name=='network.csv'} > } > traverse(:outgoing,:AGGREGATION,1) > where {name=='azimuth' and get_property(:select)=='max' and > distribute=='auto'} > } > traverse(:outgoing,:CHILD,:all) > end > end > > This is quite a complex example, but the key points are the from method > which defines where to start a traversal, and the traverse method which > defines the traversal itself, with the where method which is like the old > ReturnableEvaluator. > > Will the new pipes provide something like this? > > On Tue, Mar 15, 2011 at 9:19 AM, Massimo Lusetti <mluse...@gmail.com> > wrote: > > > On Tue, Mar 15, 2011 at 9:11 AM, Mattias Persson > > <matt...@neotechnology.com> wrote: > > > > > I'm positive that some nice API will enter the kernel at some point, > > f.ex. > > > I'm experimenting with an API like this: > > > > > > for(Node node : > > > > > > PipeBuilder.fromNode(startNode).into(otherNode(A)).into(otherNode(B)).nodes()) > > > { > > > // node will be (3) from the example above > > > } > > > > > > > > > I hope I didn't confuse you with all this :) > > > > Nope, the opposite. Thanks for the clarification and that kind of API > > would be a killer feature IMHO. > > > > It will be even more pleasant to work with neo4j... > > > > Cheers > > -- > > Massimo > > http://meridio.blogspot.com > > _______________________________________________ > > Neo4j mailing list > > User@lists.neo4j.org > > https://lists.neo4j.org/mailman/listinfo/user > > > _______________________________________________ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user