Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-11 Thread Kevin Versfeld
hi Michael/Peter Peter: yes, that about sums it up. Webadmin console is fine, but REST not so much. Michael: my final set is a little over 100K nodes, and while I am still playing around as part of a technical proof of concept, I think I will need this data more or less in its entirety. I

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-11 Thread Peter Neubauer
Hi there, I wanted to look into more efficient ways to send back big responses, but had not time. Basically, throwing in more memory is what you have to do right now, or get Cypher or Gremlin to return more effective representations like only the properties you need, which cuts down the amount of

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-10 Thread Kevin Versfeld
hi again I've been trying that query out (slightly modified now to return all nodes of a different kind, but attached to a node in the first set), on a data set of around 100K, and I'm getting an OutOfMemoryError: { message : GC overhead limit exceeded, exception : java.lang.OutOfMemoryError:

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-10 Thread Marko Rodriguez
Hi, I've been trying that query out (slightly modified now to return all nodes of a different kind, but attached to a node in the first set), on a data set of around 100K, and I'm getting an OutOfMemoryError: { message : GC overhead limit exceeded, exception : java.lang.OutOfMemoryError:

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-10 Thread Kevin Versfeld
hi, thanks for the quick reply. I need to add some more info (some I left out, some I discovered later) This only happens when I use that gremlin over REST. Executing the gremlin in the webadmin console is pretty quick, and I don't see any memory spikes or anything. What I did (after posting the

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-10 Thread Kevin Versfeld
furthermore, I tried a simple query, that returns about the same number of rows (still around 100K), and increased the timeout of my REST call (to several minutes) - and got my OutOfMemoryError again :) latest query is just g.v(293).in('R_Bought'). Running it through the webadmin console is

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-10 Thread Marko A. Rodriguez
Hi Kevin, That is unfortunate. Peter is the man to track down such things in Neo4j REST. Hopefully it's something obvious. Glad the REPL and WebAdmin is speedy. Good luck, Marko. http://markorodriguez.com On Nov 10, 2011, at 10:42 PM, Kevin Versfeld kevin.versf...@gmail.com wrote:

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-10 Thread Peter Neubauer
Kevin, So the webadmin console is displaying the 100k nodes ok, men but rest barfs? On Nov 11, 2011 6:42 AM, Kevin Versfeld kevin.versf...@gmail.com wrote: furthermore, I tried a simple query, that returns about the same number of rows (still around 100K), and increased the timeout of my REST

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-10 Thread Michael Hunger
Kevin, how large is the dataset that is build up? I'm not sure but the REST Plugin and the Webadmin use different implementations where webadmin streams the results with ajax and the REST plugin builds up a full string result. Do you need all of the data? Or would it be possible to page it?

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-08 Thread Kevin Versfeld
Perfect, thanks! (Seems so obvious now... *sigh*) At least I now have the easier query done, and can get on to the tricky ones *nervous* -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-how-to-flatten-a-tree-and-sort-tp3480586p3489600.html

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-07 Thread Kevin Versfeld
hi again I suspect I'm missing something small, but when I run the following in the webadmin console, I don't get any output? m = [:]; g.v(162).in('R_PartOf').loop(1){m.put(it.object, it.loops); true}.cap.next().sort{a, b - a.value = b.value}.keySet [] (m is empty too...) Thanks for the

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-07 Thread Kevin Versfeld
hi again I've played around a bit more, and this is the query that currently works best for me... would anyone mind reviewing it for me please? Feels a little like I'm getting the right answer, but the wrong way gremlin m = [:]; gremlin g.v(162).in('R_PartOf').loop(1){m.put(it.object,

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-07 Thread Marko Rodriguez
Hey, I've played around a bit more, and this is the query that currently works best for me... would anyone mind reviewing it for me please? Feels a little like I'm getting the right answer, but the wrong way gremlin m = [:]; gremlin g.v(162).in('R_PartOf').loop(1){m.put(it.object,

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-07 Thread Kevin Versfeld
Great! Thanks Marko, this has been very helpful. I did realise my mistake on the sort: when I tried it the way you suggested originally, I also had a few other things wrong, and obviously did not apply a methodical approach to solving it. One last question: I need to just return the nodes, at the

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-06 Thread Tatham Oddie
Marko, And I'm saying nasty with a South African accent so you know its dirty. Thanks to working with Romiko, I'm getting an eerily clear mental image of that. -- Tatham ___ Neo4j mailing list User@lists.neo4j.org

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-04 Thread Marko Rodriguez
Hi, I would do it like this: m = [:] g.v(162).in('R_PartOf').loop(1){m.put(it.object, it.loops); true} -1 m.sort{a, b - a.value = b.value}.keySet as List In short, fill up a Map (m) with key being the vertex and value being the number of hops (or times through the loop). Then sort the map by

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-04 Thread Peter Neubauer
Can you do it on one line? ;) Great stuff. 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              - NOSQL for the

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-04 Thread Marko Rodriguez
Sure: m = [:]; g.v(162).in('R_PartOf').loop(1){m.put(it.object, it.loops); true}.cap.next().sort{a, b - a.value = b.value}.keySet [] Marko. http://markorodriguez.com On Nov 4, 2011, at 12:17 PM, Peter Neubauer wrote: Can you do it on one line? ;) Great stuff. Cheers, /peter

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-04 Thread baldric
Thanks! I will still need to try this out, but the idea (in your first response) kind of feels more or less like what I knew I needed. I have so many questions now based on the responses so far - it feels like I'm just scratching the surface! Firstly, could you explain the differences between map,

Re: [Neo4j] Gremlin - how to flatten a tree, and sort

2011-11-04 Thread Marko Rodriguez
Hi, Thanks! I will still need to try this out, but the idea (in your first response) kind of feels more or less like what I knew I needed. I have so many questions now based on the responses so far - it feels like I'm just scratching the surface! Once you get it, you can get nasty with