After a fast walk throw the code I found that option quite interesting and
probably the best fit till now for that problem! I hope I will be able to
provide a useful solution for those with the same problem than me...

I just tried you say I was expecting neo4j to provide me with something like
a sort command, I really realise is something not common in the graphdb
world, but something cool that can help a lot of people.

- purbon


On 15 July 2011 20:50, David Montag <david.mon...@neotechnology.com> wrote:

> Marko,
>
> Isn't that pretty similar to what
> https://github.com/peterneubauer/graph-collections<
> https://github.com/peterneubauer/graph-collections/tree/master/src/main/java/org/neo4j/collections/sortedtree
> >
> provides
> for Neo4j?
>
> David
>
> On Fri, Jul 15, 2011 at 11:30 AM, Marko Rodriguez <okramma...@gmail.com
> >wrote:
>
> > Hi,
> >
> > Pere, my last thought on this is that you might want to use something
> like
> > JDBM2.
> >
> >        http://code.google.com/p/jdbm2/
> >
> > It has a Maven2 <dependency> if you do it that way.
> >
> > JDBM2 provides you some Java collection implementations that are
> persistent
> > to disk...
> >
> > See ya,
> > Marko.
> >
> > http://markorodriguez.com
> >
> > On Jul 15, 2011, at 12:22 PM, Pere Urbon Bayes wrote:
> >
> > > Yeah! well to order in memory I can really deal with that task, for
> this
> > I
> > > really don't need cypher. DonĀ“t take it personally, I know you really
> > want
> > > to promote your language, xD!
> > >
> > > - purbon
> > >
> > > PD: See you next graphdb meetup in Berlin!
> > >
> > > On 15 July 2011 19:37, Michael Hunger <
> michael.hun...@neotechnology.com
> > >wrote:
> > >
> > >> You might also try to use cypher for your traversal which is able to
> > order
> > >> (also in memory of course).
> > >>
> > >> See the screencast I did:
> > >> http://neo4j.vidcaster.com/U2Y/introduction-to-cypher/
> > >>
> > >> It's even the same domain.
> > >>
> > >> Cheers
> > >>
> > >> Michael
> > >>
> > >> Am 15.07.2011 um 17:24 schrieb Rick Bullotta:
> > >>
> > >>> But you couldn't easy do a complex traversal with an RDBMS. ;-)
> > >>>
> > >>> I suspect that even if you could write some magic SQL to do so, you'd
> > >> almost certainly lose the benefits any optimized sorting/ordering that
> > >> indices provide, so even the RDBMS would have to post-process the
> sort.
> > >>>
> > >>> If the traversal isn't complex or randomly "deep", then Neo indexing
> +
> > >> querying might work for you the same way an RDBMS might 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 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 it?  In the case of a
> > complex
> > >>>> traversal, indexes don't really apply, since the ordering and the
> > >> traversal
> > >>>> order are unrelated, so you'd generally need to sort in memory
> anyway.
> > >>>> Whether you do it as you add elements to the traversed list of
> "stuff"
> > >> or
> > >>>> do it after the fact is another discussion, but I think in either
> > case,
> > >> it
> > >>>> needs to be done "after the fact".
> > >>>>
> > >>>>
> > >>>> -----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: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 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 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
> > >>>> name
> > >>>>>
> > >>>>> In short, once you have the result of your traversal, you can then
> > >> apply
> > >>>> a
> > >>>>> comparator to the Collection to sort it as you please --- its just
> > Java
> > >>>>> comparators.
> > >>>>>
> > >>>>> See ya,
> > >>>>> Marko.
> > >>>>>
> > >>>>> http://markorodriguez.com
> > >>>>>
> > >>>>> On Jul 15, 2011, at 8:06 AM, Pere Urbon Bayes wrote:
> > >>>>>
> > >>>>>> HI!
> > >>>>>> I am on the situation of having to traverse neo4j, and then expect
> > the
> > >>>>>> resultset returned to be ordered in a certain order. I've been
> > >>>>> researching a
> > >>>>>> bit over the traversal API, but I did not find anything related to
> > >>>> that.
> > >>>>> I
> > >>>>>> really will appreciate any tip on that!!
> > >>>>>>
> > >>>>>> BTW > I expect to be possible right?, as we have in relational the
> > >>>>> ordering,
> > >>>>>> or on redis, etc...
> > >>>>>>
> > >>>>>> /purbon
> > >>>>>>
> > >>>>>> --
> > >>>>>> Pere Urbon-Bayes
> > >>>>>> moviepilot GmbH | Mehringdamm 33 | 10961 Berlin | Germany
> > >>>>>> Telefon +49 30 616 512 -110 | Fax +49 30 616 512 -133
> > >>>>>> _______________________________________________
> > >>>>>> 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
> > >>>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>> --
> > >>>> Pere Urbon-Bayes
> > >>>> moviepilot GmbH | Mehringdamm 33 | 10961 Berlin | Germany
> > >>>> Telefon +49 30 616 512 -110 | Fax +49 30 616 512 -133
> > >>>> _______________________________________________
> > >>>> 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
> > >>>>
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> Pere Urbon-Bayes
> > >>> moviepilot GmbH | Mehringdamm 33 | 10961 Berlin | Germany
> > >>> Telefon +49 30 616 512 -110 | Fax +49 30 616 512 -133
> > >>> _______________________________________________
> > >>> 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
> > >>
> > >> _______________________________________________
> > >> Neo4j mailing list
> > >> User@lists.neo4j.org
> > >> https://lists.neo4j.org/mailman/listinfo/user
> > >>
> > >
> > >
> > >
> > > --
> > > Pere Urbon-Bayes
> > > moviepilot GmbH | Mehringdamm 33 | 10961 Berlin | Germany
> > > Telefon +49 30 616 512 -110 | Fax +49 30 616 512 -133
> > > _______________________________________________
> > > 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
> >
>
>
>
> --
> David Montag <david.mon...@neotechnology.com>
> Neo Technology, www.neotechnology.com
> Cell: 650.556.4411
> Skype: ddmontag
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Pere Urbon-Bayes
moviepilot GmbH | Mehringdamm 33 | 10961 Berlin | Germany
Telefon +49 30 616 512 -110 | Fax +49 30 616 512 -133
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to