Re: [Neo4j] Copy queries from the web admin console?
I can confirm this behaviour on Chrome If I drag to select, and before releasing, right click, I can use the context menu to copy successfully Not ideal, but certainly workable. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Re-Neo4j-Copy-queries-from-the-web-admin-console-tp3509232p3512275.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Simple paging question - Gremlin
hi folks I'm implementing paging in a gremlin query - Can anyone tell me the difference(s) between the following two techniques: g.v(293).in.drop(5).take(5) and g.v(293).in[5..9] (Both return the same, correct result set) I will be doing some performance tests today on the two, but last week when I tried them both on fairly heavy queries, the second method seemed faster (I only say seemed, because I'm hesitant to draw conclusions before I've properly measured the times) -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Simple-paging-question-Gremlin-tp3506242p3506242.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin - how to flatten a tree, and sort
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 pumped up the memory settings in the neo configs, and increased my rest timeout, and managed to get a successful response (at which point my consuming code died, I think at the deserializing point :) ), so then I tried some manual chunking (using paged results), which worked pretty well, so I think that is the route I'll need to take. Also noteworthy, I have been using Tatham and Romiko's Neo4jClient stuff so far, and was just chatting via email to Romiko earlier, and he said that their client does support chunking already (at least in parts?) - so I will get latest and see what I can see. I think my main concern or question left is around the memory usage of my java.exe process: although everything now executes, its still not terribly fast (although considering its over REST, and is doing a lot of deserializing etc, I think its acceptable). Most importantly though, I see my java.exe process still consumes a lot of memory (half an hour later, and its still sitting at a gig...) - should I be worried about this? -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-how-to-flatten-a-tree-and-sort-tp3480586p3499114.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin - how to flatten a tree, and sort
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: GC overhead limit exceeded, stacktrace : [ ] } My request (for gremlin over REST) is: script: m = [:]; g.v(id).in('R_PartOf').loop(1){m.put(it.object, it.loops); true} -1; m.sort{a,b - a.value = b.value}.keySet()._().in('R_OtherEdge'), params: { id: 284 } Any thoughts? -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-how-to-flatten-a-tree-and-sort-tp3480586p3496857.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin - how to flatten a tree, and sort
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 previous question) was to increase the heap memory for neo4j (I saw a post about this earlier), which removed the OutOfMemoryError, but now I simply get a timeout on the rest execution... -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-how-to-flatten-a-tree-and-sort-tp3480586p3498820.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin - how to flatten a tree, and sort
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 quick, and my memory usage stays low, etc (all as expected). It's only when going through the REST interface that I start getting memory and/or timeout issues... -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-how-to-flatten-a-tree-and-sort-tp3480586p3498879.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin - how to flatten a tree, and sort
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 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin - how to flatten a tree, and sort
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 info on cap, by the way: its awesome. :) -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-how-to-flatten-a-tree-and-sort-tp3480586p3486381.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin - how to flatten a tree, and sort
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, it.loops); true} gremlin m.sort{a - a.value}._() And, that sort tripped me up a few times :) -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-how-to-flatten-a-tree-and-sort-tp3480586p3486996.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlin - how to flatten a tree, and sort
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 end of all of this. I figured I needed to do a projection of sorts, and the only thing I could get working was a transform(), as follows: m.sort{a,b - a.value = b.value}._().transform(){a - a.key} Now, I remember in your first reply, you used things like keyset and as List, but I couldn't get that to work... Any thoughts on this? I imagine it's probably safe to say there's a better method to achieve this :) - A closed mouth gathers no feet... On Mon, Nov 7, 2011 at 11:00 PM, Marko Rodriguez-2 [via Neo4j Community Discussions] ml-node+s438527n3488223...@n3.nabble.com wrote: 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, it.loops); true} gremlin m.sort{a - a.value}._() And, that sort tripped me up a few times :) Everything looks good except your m.sort{}, which should be something like this: m.sort{a,b - a.value = b.value} The provided closure is a comparator. For a java.util.Map, the comparison is happening between two Map.Entry objects. Thus, your sort needs two inputs (a,b) and then the value of those Entry objects is a.value and b.value, respectively. Hope that is clear. *** Also, note that if you don't want to see output from your g.v(162)... expression, simply do -1 as it will while(expr.hasNext()) and thus, fill the map without burdensome System.out.println()s. *** Enjoy, Marko. ___ Neo4j mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=3488223i=0 https://lists.neo4j.org/mailman/listinfo/user -- If you reply to this email, your message will be added to the discussion below: http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-how-to-flatten-a-tree-and-sort-tp3480586p3488223.html To unsubscribe from Gremlin - how to flatten a tree, and sort, click herehttp://neo4j-community-discussions.438527.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3480586code=a2V2aW4udmVyc2ZlbGRAZ21haWwuY29tfDM0ODA1ODZ8LTE5MTM2MjYxMjE=. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-how-to-flatten-a-tree-and-sort-tp3480586p3489554.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user