Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Marko Rodriguez
Hi Pere, To sort you need to have all your results. Thus, in Gremlin (and hopefully you can do the mapping to the core Neo4j traverser framework), results = [] g.v(1).out('friend').out('likes') results // what my friends like results.sort{a,b - a.name = b.name} // sort resultant vertices by

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Niels Hoogeveen
Hi,You basically have two options. If your result set is not too big, you can sort it in memory, though that approach may consume too much memory if the result set is very large. In that case you can use SortedTree (see:

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Pere Urbon Bayes
Well, this is great if I want to do all the math in memory, but I expect to do the computation by the db. / purbon On 15 July 2011 16:10, Marko Rodriguez okramma...@gmail.com wrote: Hi Pere, To sort you need to have all your results. Thus, in Gremlin (and hopefully you can do the mapping

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Rick Bullotta
discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well, this is great if I want to do all the math in memory, but I expect to do the computation by the db. / purbon On 15 July 2011 16:10, Marko Rodriguez okramma...@gmail.com wrote: Hi Pere, To sort you need to have all your

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Marko Rodriguez
Hi, Ah. Then I would recommend using a persistent data structure such as the one the Neil discussed in his follow up post. Marko. http://markorodriguez.com On Jul 15, 2011, at 9:04 AM, Pere Urbon Bayes wrote: Well, this is great if I want to do all the math in memory, but I expect to do

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Rick Bullotta
...@lists.neo4j.org] On Behalf Of Pere Urbon Bayes Sent: Friday, July 15, 2011 11:14 AM To: Neo4j user discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well the graph structure is not relevant here, I think. The property I expect to be sorting is on the destination node, so

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Pere Urbon Bayes
Well in fact, I expect to order the resulting set of nodes by a property on that end nodes. But This class cold also help on some use cases I think. / purbon On 15 July 2011 16:43, Niels Hoogeveen pd_aficion...@hotmail.com wrote: Hi,You basically have two options. If your result set is not

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Pere Urbon Bayes
] Getting sorted results from a traversal Well the graph structure is not relevant here, I think. The property I expect to be sorting is on the destination node, so I can do the traversal and then expect to run the sorting. Please, tell me how the data structure can help me to deal with that order

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Pere Urbon Bayes
Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Pere Urbon Bayes Sent: Friday, July 15, 2011 11:05 AM To: Neo4j user discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well, this is great if I want to do all the math

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Rick Bullotta
. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Pere Urbon Bayes Sent: Friday, July 15, 2011 11:17 AM To: Neo4j user discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well in fact, I expect to order the resulting set

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Michael Hunger
discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well, the thing is that the database can easy deal with that, as the relational system do. / purbon On 15 July 2011 17:08, Rick Bullotta rick.bullo...@thingworx.com wrote: The DB would do it in memory too, wouldn't

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Pere Urbon Bayes
:21 AM To: Neo4j user discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well, the thing is that the database can easy deal with that, as the relational system do. / purbon On 15 July 2011 17:08, Rick Bullotta rick.bullo...@thingworx.com wrote: The DB would

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Pere Urbon Bayes
discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well, the thing is that the database can easy deal with that, as the relational system do. / purbon On 15 July 2011 17:08, Rick Bullotta rick.bullo...@thingworx.com wrote: The DB would do it in memory too, wouldn't

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Marko Rodriguez
...@lists.neo4j.org] On Behalf Of Pere Urbon Bayes Sent: Friday, July 15, 2011 11:21 AM To: Neo4j user discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well, the thing is that the database can easy deal with that, as the relational system do. / purbon On 15 July 2011

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Marko Rodriguez
[mailto:user-boun...@lists.neo4j.org] On Behalf Of Pere Urbon Bayes Sent: Friday, July 15, 2011 11:21 AM To: Neo4j user discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well, the thing is that the database can easy deal with that, as the relational system do. / purbon

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread David Montag
...@lists.neo4j.org [mailto: user-boun...@lists.neo4j.org] On Behalf Of Pere Urbon Bayes Sent: Friday, July 15, 2011 11:21 AM To: Neo4j user discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well, the thing is that the database can easy deal

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Marko Rodriguez
Hey, Isn't that pretty similar to what https://github.com/peterneubauer/graph-collectionshttps://github.com/peterneubauer/graph-collections/tree/master/src/main/java/org/neo4j/collections/sortedtree provides for Neo4j? I dunno. I haven't played with Graph Collections. But I assume so if it

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Michael Hunger
handle it. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Pere Urbon Bayes Sent: Friday, July 15, 2011 11:21 AM To: Neo4j user discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well, the thing

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Pere Urbon Bayes
Jajajaja, Marko I just need to meet you sometime! I always listen good thing about you from Peter and Achim ... I am quite not satisfied, probably I will change somethings on my project in order to fit better with that use case! - purbon On 15 July 2011 20:53, Marko Rodriguez

Re: [Neo4j] Getting sorted results from a traversal

2011-07-15 Thread Pere Urbon Bayes
...@lists.neo4j.org [mailto: user-boun...@lists.neo4j.org] On Behalf Of Pere Urbon Bayes Sent: Friday, July 15, 2011 11:21 AM To: Neo4j user discussions Subject: Re: [Neo4j] Getting sorted results from a traversal Well, the thing is that the database can easy deal