Aseem, If you can provide a nice suggestion on how exactly it would look, maybe I can implement it if the others agree?
/peter Sent from my phone. On Aug 25, 2011 7:19 PM, "Aseem Kishore" <[email protected]> wrote: > Thanks Peter, we'll look into Gremlin. =) > > But I'll push back a bit and say it would still ask for a feature like this > to be a first-class feature of the REST API. If my app is e.g. in Python, > it's not super API-friendly for me to have to write Java-ish code to achieve > what I want. > > I'd get it if what I was asking for was an uncommon edge case request. But > for quite a while, this has been the one biggest pain point of Neo4j for us: > how to return a meaningful subset of traverse results instead of all > results. Having a paged traverser doesn't help at all if you can neither > specify the order nor know what the default ordering is based on (I asked a > while back and was told it's unspecified). (And again, by "order" here I > mean beyond just "breadth first".) > > I'm all for simple, minimalistic and elegant APIs. I'm also all for being > scenario-driven, and solving problems rather than building arbitrary > features. So perhaps one solution here would be to introduce a new built-in > "best first" order that's just like Djikstra's shortest-path API: you just > specify a "cost" property (or function) for nodes and/or relationships. This > would definitely solve our problem, and, I suspect, most people's problems > in this regard. It wouldn't be a bulky feature that doesn't fit in (it would > compliment Djikstra's very nicely), and it wouldn't require writing a > complex Gremlin script to achieve this (I would think) common requirement. > > I'll get off the soapbox now. ;) Thanks for your consideration! > > Aseem > > On Thu, Aug 25, 2011 at 9:01 AM, Peter Neubauer < > [email protected]> wrote: > >> See the other mail for a pointer :) >> >> Cheers, >> >> /peter neubauer >> >> GTalk: neubauer.peter >> Skype peter.neubauer >> Phone +46 704 106975 >> LinkedIn http://www.linkedin.com/in/neubauer >> Twitter http://twitter.com/peterneubauer >> >> http://www.neo4j.org - Your high performance graph database. >> http://startupbootcamp.org/ - Ă–resund - Innovation happens HERE. >> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. >> >> >> On Thu, Aug 25, 2011 at 1:00 AM, Matt Luongo <[email protected]> wrote: >> >> > +1, we could really use that. Client-side sorting sucks. >> > >> > -- >> > Matt Luongo >> > Co-Founder, Scholr.ly >> > >> > >> > >> > On Wed, Aug 24, 2011 at 4:43 PM, Aseem Kishore <[email protected] >> > >wrote: >> > >> > > I've just spent a bunch of time reading into how one can control the >> > > ordering of a traverse beyond simple "breadth first" or "depth first". >> > More >> > > precisely, even when breadth first, how one can control *which* >> neighbors >> > > are traversed first. >> > > >> > > (It matters less in which order they're traversed vs. which order >> they're >> > > returned if you're returning all results, since you can just sort on >> the >> > > client. But it matters a lot if you want to use the paged traverser, >> > since >> > > you're then only returning the first results.) >> > > >> > > I've learned that this is doable from Java by writing your own >> > > BranchSelector implementation: >> > > >> > > http://components.neo4j.org/neo4j/1.4.1/apidocs/ >> > > >> > > I've found the built-in implementations, e.g. the pre-order >> breadth-first >> > > and depth-first: >> > > >> > > >> > > >> > >> https://github.com/neo4j/community/blob/master/kernel/src/main/java/org/neo4j/kernel/PreorderBreadthFirstSelector.java >> > > >> > > >> > > >> > >> https://github.com/neo4j/community/blob/master/kernel/src/main/java/org/neo4j/kernel/PreorderDepthFirstSelector.java >> > > >> > > To achieve a custom "best first", Igor Dovgiy for example shared that >> he >> > > modeled his implementation of the breadth-first selector, except just >> > using >> > > a PriorityQueue instead of a regular Queue. >> > > >> > > My question is: is there any way to specify this sort of thing over the >> > > REST >> > > API instead of having to write a plugin? If not, does that sound like a >> > > reasonable feature request? >> > > >> > > I really just want something simple: nodes ordered by some "timestamp" >> > > property. It's killing us that we can't do this today. We might just >> have >> > > to >> > > look into writing this as a plugin... >> > > >> > > Thanks! >> > > >> > > Aseem >> > > _______________________________________________ >> > > Neo4j mailing list >> > > [email protected] >> > > https://lists.neo4j.org/mailman/listinfo/user >> > > >> > _______________________________________________ >> > Neo4j mailing list >> > [email protected] >> > https://lists.neo4j.org/mailman/listinfo/user >> > >> _______________________________________________ >> Neo4j mailing list >> [email protected] >> https://lists.neo4j.org/mailman/listinfo/user >> > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

