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] Property loading in Neo4J 1.4
Properties on nodes/relationships are stored as a non-indexed linked list on disk so if you're accessing one property on a node/relationship neo4j has to load that chain (i.e. all properties, not necessarily their values though) for that node/relationship if it hasn't already done that (i.e. if its properties are already in cache or not). 2011/11/6 Rick Bullotta rick.bullo...@thingworx.com If a node is accessed, are *all* of its properties loaded into memory? Thanks, Rick ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Wrong Gremlin results through REST interface
Jeroen, that would indeed help a lot. I'll find it. Michael Am 07.11.2011 um 12:34 schrieb Jeroen van Dijk: Hi Michael, I would like to provide a better example, but my Groovy is quite poor so it I'll take me some time. However I think the problem isn't in the JSON conversion. Because that would mean the results I get would be the same, but with a different score right? The thing is that I get different Vertices back through the REST interface than I do locally. To me that means things already fail during the Gremlin evaluation. I will try to come up with a more isolated example. If it helps I could give you access to my dataset on Heroku (or through a Zip file). thanks, Jeroen On Mon, Nov 7, 2011 at 11:34 AM, Michael Hunger michael.hun...@neotechnology.com wrote: Jeroen, can you narrow it down to a simpler operation, like just a division? Perhaps in the conversion from the division result (be it Float, Double, BigDecimal) to JSON something goes awry. In the GremlinPlugin the code for that is: } else if (result instanceof Double || result instanceof Float) { return ValueRepresentation.number(((Number) result).doubleValue()); } I'm not sure what datatype groovy creates as result of your operation, perhaps you can determine that as well. If we have a simple gremlin / groovy calculation that yields the wrong results, we can easily inspect and fix the plugin. Thanks a lot Michael Am 07.11.2011 um 11:12 schrieb Jeroen van Dijk: Hi all, I'm using Gremlin to perform a recommendation query. Locally in the gremlin shell I get amazingly useful results. However when I use the webadmin gremlin console I get different results, both locally and in the Heroku addon environment. I get the same wrong results when I use the rest interface, so I assume something is incorrect in the Gremlin REST interface. In all these cases the data is the same or on the same database. The gremlin query is below (it is own of my first so probably not the most efficient). It returns the top 10 list of most similar items according to the Jaccard similarity index (= (Intersection(A, B) / Union(A, B) ): node = g.v(14260); m = [:].withDefault{0.0}; a_total = node.inE().count(); node.in().out('owns').sideEffect{union = a_total + it.inE().count()}.groupCount(m) { it }{ it += (1/(union)) } -1; m.sort{a,b - b.value = a.value}[0..9] When I do the following locally everything is fine: gremlin g = new Neo4jGraph('/usr/local/Cellar/neo4j/community-1.4/libexec/data/graph.db') ==neo4jgraph[EmbeddedGraphDatabase [/usr/local/Cellar/neo4j/community-1.4/libexec/data/graph.db]] gremlin node = g.v(14260); m = [:].withDefault{0.0}; a_total = node.inE().count(); node.in().out('owns').sideEffect{union = a_total + it.inE().count()}.groupCount(m) { it }{ it += (1/(union)) } -1; m.sort{a,b - b.value = a.value}[0..9] ==v[14260]=0.500013 ==v[12974]=0.1014492752 ==v[12349]=0.0952380952 ==v[12082]=0.083332 ==v[15434]=0.0810810810 ==v[11237]=0.0810810810 ==v[17672]=0.0769230768 ==v[18338]=0.0769230768 ==v[12852]=0.0769230768 ==v[11969]=0.075 gremlin However when I repeat this using the webadmin console interface I get the following results: gremlin node = g.v(14260); m = [:].withDefault{0.0}; a_total = node.inE().count(); node.in().out('owns').sideEffect{union = a_total + it.inE().count()}.groupCount(m) { it }{ it += (1/(union)) } -1; m.sort{a,b - b.value = a.value}[0..9] == v[14260]=31.0 == v[9204]=30.0 == v[8958]=29.0 == v[15763]=22.0 == v[13906]=22.0 == v[18477]=21.0 == v[9081]=20.0 == v[9019]=19.0 == v[9074]=18.0 == v[9066]=18.0 The values of a Jaccard Index should never be above 1 so something is clearly wrong. Any ideas? Thanks, Jeroen ___ 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 ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Wrong Gremlin results through REST interface
Ok i think I found an example that is independent of my data (adapted from http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html) Locally: gremlin m = [:];g.v(33).bothE().label.groupCount(m) -1;m ==follows=11 ==owns=48 gremlin m = [:];g.v(33).bothE().label.groupCount(m) { it }{ it += 0.1 } -1;m ==follows=1.1 ==owns=4.8 REST/webadmin console: gremlin m = [:];g.v(33).bothE().label.groupCount(m) { it }{ it += 0.1 } -1;m == follows=11 == owns=48 gremlin m = [:];g.v(33).bothE().label.groupCount(m) { it }{ it += 10 } -1;m == follows=11 == owns=48 gremlin It seems like the closure block is not evaluated (to me as a Groovy/Gremlin/Neo4j noob) Michael, I will send you a link to my database in private. Thanks, Jeroen On Mon, Nov 7, 2011 at 12:41 PM, Michael Hunger michael.hun...@neotechnology.com wrote: Jeroen, that would indeed help a lot. I'll find it. Michael Am 07.11.2011 um 12:34 schrieb Jeroen van Dijk: Hi Michael, I would like to provide a better example, but my Groovy is quite poor so it I'll take me some time. However I think the problem isn't in the JSON conversion. Because that would mean the results I get would be the same, but with a different score right? The thing is that I get different Vertices back through the REST interface than I do locally. To me that means things already fail during the Gremlin evaluation. I will try to come up with a more isolated example. If it helps I could give you access to my dataset on Heroku (or through a Zip file). thanks, Jeroen On Mon, Nov 7, 2011 at 11:34 AM, Michael Hunger michael.hun...@neotechnology.com wrote: Jeroen, can you narrow it down to a simpler operation, like just a division? Perhaps in the conversion from the division result (be it Float, Double, BigDecimal) to JSON something goes awry. In the GremlinPlugin the code for that is: } else if (result instanceof Double || result instanceof Float) { return ValueRepresentation.number(((Number) result).doubleValue()); } I'm not sure what datatype groovy creates as result of your operation, perhaps you can determine that as well. If we have a simple gremlin / groovy calculation that yields the wrong results, we can easily inspect and fix the plugin. Thanks a lot Michael Am 07.11.2011 um 11:12 schrieb Jeroen van Dijk: Hi all, I'm using Gremlin to perform a recommendation query. Locally in the gremlin shell I get amazingly useful results. However when I use the webadmin gremlin console I get different results, both locally and in the Heroku addon environment. I get the same wrong results when I use the rest interface, so I assume something is incorrect in the Gremlin REST interface. In all these cases the data is the same or on the same database. The gremlin query is below (it is own of my first so probably not the most efficient). It returns the top 10 list of most similar items according to the Jaccard similarity index (= (Intersection(A, B) / Union(A, B) ): node = g.v(14260); m = [:].withDefault{0.0}; a_total = node.inE().count(); node.in().out('owns').sideEffect{union = a_total + it.inE().count()}.groupCount(m) { it }{ it += (1/(union)) } -1; m.sort{a,b - b.value = a.value}[0..9] When I do the following locally everything is fine: gremlin g = new Neo4jGraph('/usr/local/Cellar/neo4j/community-1.4/libexec/data/graph.db') ==neo4jgraph[EmbeddedGraphDatabase [/usr/local/Cellar/neo4j/community-1.4/libexec/data/graph.db]] gremlin node = g.v(14260); m = [:].withDefault{0.0}; a_total = node.inE().count(); node.in().out('owns').sideEffect{union = a_total + it.inE().count()}.groupCount(m) { it }{ it += (1/(union)) } -1; m.sort{a,b - b.value = a.value}[0..9] ==v[14260]=0.500013 ==v[12974]=0.1014492752 ==v[12349]=0.0952380952 ==v[12082]=0.083332 ==v[15434]=0.0810810810 ==v[11237]=0.0810810810 ==v[17672]=0.0769230768 ==v[18338]=0.0769230768 ==v[12852]=0.0769230768 ==v[11969]=0.075 gremlin However when I repeat this using the webadmin console interface I get the following results: gremlin node = g.v(14260); m = [:].withDefault{0.0}; a_total = node.inE().count(); node.in().out('owns').sideEffect{union = a_total + it.inE().count()}.groupCount(m) { it }{ it += (1/(union)) } -1; m.sort{a,b - b.value = a.value}[0..9] == v[14260]=31.0 == v[9204]=30.0 == v[8958]=29.0 == v[15763]=22.0 == v[13906]=22.0 == v[18477]=21.0 == v[9081]=20.0 == v[9019]=19.0 == v[9074]=18.0 == v[9066]=18.0 The values of a Jaccard Index should never be above 1 so something is clearly wrong. Any ideas? Thanks, Jeroen ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list
Re: [Neo4j] Wrong Gremlin results through REST interface
Jeroen, could you try to use the alternative syntax: ... groupCount(m) { it : it += 0.1 } ... It seems to be a problem with evaluation of the string in the javax.ScriptEngine for Groovy Here is the output from my web-console: • gremlin m = [:];g.v(33).bothE().label.groupCount(m) { it }{ it += 0.1 } -1;m • == follows=11 • == owns=48 • gremlin m = [:];g.v(33).bothE().label.groupCount(m) { it : it += 0.1 } -1;m • == follows=1.1 • == owns=4.8 Michael Am 07.11.2011 um 12:55 schrieb Jeroen van Dijk: Ok i think I found an example that is independent of my data (adapted from http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html) Locally: gremlin m = [:];g.v(33).bothE().label.groupCount(m) -1;m ==follows=11 ==owns=48 gremlin m = [:];g.v(33).bothE().label.groupCount(m) { it }{ it += 0.1 } -1;m ==follows=1.1 ==owns=4.8 REST/webadmin console: gremlin m = [:];g.v(33).bothE().label.groupCount(m) { it }{ it += 0.1 } -1;m == follows=11 == owns=48 gremlin m = [:];g.v(33).bothE().label.groupCount(m) { it }{ it += 10 } -1;m == follows=11 == owns=48 gremlin It seems like the closure block is not evaluated (to me as a Groovy/Gremlin/Neo4j noob) Michael, I will send you a link to my database in private. Thanks, Jeroen On Mon, Nov 7, 2011 at 12:41 PM, Michael Hunger michael.hun...@neotechnology.com wrote: Jeroen, that would indeed help a lot. I'll find it. Michael Am 07.11.2011 um 12:34 schrieb Jeroen van Dijk: Hi Michael, I would like to provide a better example, but my Groovy is quite poor so it I'll take me some time. However I think the problem isn't in the JSON conversion. Because that would mean the results I get would be the same, but with a different score right? The thing is that I get different Vertices back through the REST interface than I do locally. To me that means things already fail during the Gremlin evaluation. I will try to come up with a more isolated example. If it helps I could give you access to my dataset on Heroku (or through a Zip file). thanks, Jeroen On Mon, Nov 7, 2011 at 11:34 AM, Michael Hunger michael.hun...@neotechnology.com wrote: Jeroen, can you narrow it down to a simpler operation, like just a division? Perhaps in the conversion from the division result (be it Float, Double, BigDecimal) to JSON something goes awry. In the GremlinPlugin the code for that is: } else if (result instanceof Double || result instanceof Float) { return ValueRepresentation.number(((Number) result).doubleValue()); } I'm not sure what datatype groovy creates as result of your operation, perhaps you can determine that as well. If we have a simple gremlin / groovy calculation that yields the wrong results, we can easily inspect and fix the plugin. Thanks a lot Michael Am 07.11.2011 um 11:12 schrieb Jeroen van Dijk: Hi all, I'm using Gremlin to perform a recommendation query. Locally in the gremlin shell I get amazingly useful results. However when I use the webadmin gremlin console I get different results, both locally and in the Heroku addon environment. I get the same wrong results when I use the rest interface, so I assume something is incorrect in the Gremlin REST interface. In all these cases the data is the same or on the same database. The gremlin query is below (it is own of my first so probably not the most efficient). It returns the top 10 list of most similar items according to the Jaccard similarity index (= (Intersection(A, B) / Union(A, B) ): node = g.v(14260); m = [:].withDefault{0.0}; a_total = node.inE().count(); node.in().out('owns').sideEffect{union = a_total + it.inE().count()}.groupCount(m) { it }{ it += (1/(union)) } -1; m.sort{a,b - b.value = a.value}[0..9] When I do the following locally everything is fine: gremlin g = new Neo4jGraph('/usr/local/Cellar/neo4j/community-1.4/libexec/data/graph.db') ==neo4jgraph[EmbeddedGraphDatabase [/usr/local/Cellar/neo4j/community-1.4/libexec/data/graph.db]] gremlin node = g.v(14260); m = [:].withDefault{0.0}; a_total = node.inE().count(); node.in().out('owns').sideEffect{union = a_total + it.inE().count()}.groupCount(m) { it }{ it += (1/(union)) } -1; m.sort{a,b - b.value = a.value}[0..9] ==v[14260]=0.500013 ==v[12974]=0.1014492752 ==v[12349]=0.0952380952 ==v[12082]=0.083332 ==v[15434]=0.0810810810 ==v[11237]=0.0810810810 ==v[17672]=0.0769230768 ==v[18338]=0.0769230768 ==v[12852]=0.0769230768 ==v[11969]=0.075 gremlin However when I repeat this using the webadmin console interface I get the following results: gremlin node = g.v(14260); m = [:].withDefault{0.0}; a_total = node.inE().count(); node.in().out('owns').sideEffect{union = a_total + it.inE().count()}.groupCount(m) { it }{ it += (1/(union)) } -1; m.sort{a,b - b.value = a.value}[0..9] == v[14260]=31.0 == v[9204]=30.0
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
[Neo4j] version conflicts
Hi, I'm just getting started with Neo4j, spatial, gremlin and Neoclipse. I can successfully run (via eclipse) an import of 'map.osm' file using OSMImporter by linking to libraries that come with the spatial distribution. When I try to use gremlin or neoclipse to attach to the data I get a db version error. I'm wondering if there is a repository that I can download from ( or build ) where all these components are in sync. Or maybe someone has a suggestion for how I can proceed. both gremlin and neoclipse report a version problem, here is gremlins output: Caused by: org.neo4j.kernel.impl.nioneo.store.IllegalStoreVersionException: Store version [NeoStore v0.A.0]. Please make sure you are not running old Neo4j kernel on a store that has been created by newer version of Neo4j. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/version-conflicts-tp3488028p3488028.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] version conflicts
i managed to get this working by taking the neo4j- jars from my gremlin installation and use those in the dependency folder of spatial, but I'm still not sure in what way I can fix the dependencies. It seems like the spatial distribution is has a newer kernel, though they both seem to be 1.5 -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/version-conflicts-tp3488028p3488122.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
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 User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Neoclipse not showing all nodes
Hello everyone, I'm still pretty new to Neo4J en Neoclipse, but I'm a bit confused about the visualisation of Neoclipse. The situation: I created about 500 nodes. Once all nodes were created, I sorted them using the Index on date. I looped over the sorted nodes and created a straight-line relation like this: Node 5 Node 2 Node 1 Node 3 Node 4 etc... So the nodes are in a different order then they were created. Although, when I want to visualise them, it only shows me Node 2 Node 1 Node 3 All others are ignored. First i checked if there was a relation missing, but that's not the problem. I connected all the nodes with a single node (the IS-A-NODE relation) and there I can see that all the relations are correct. Why does Neoclipse only shows the nodes connected to my first node, and ignores all others? I also tried to create 5 nodes, and create relations in the correct order: Node 1 - Node 2 - Node 3 etc... Neoclipse is only showing: Node 1 - Node 2 How can I make Neoclipse showing everything, without creating relations for all the nodes to 1 general node. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neoclipse-not-showing-all-nodes-tp3488227p3488227.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] Batch Throughput
Ooops!! Hadn't set configuration params for 1.5! Much faster now :-) * * *Nigel Small* Phone: +44 7814 638 246 Blog: http://nigelsmall.name/ GTalk: ni...@nigelsmall.name MSN: nasm...@live.co.uk Skype: technige Twitter: @technige https://twitter.com/#!/technige LinkedIn: http://uk.linkedin.com/in/nigelsmall On 7 November 2011 21:18, Nigel Small ni...@nigelsmall.name wrote: Hello Neoforgers... Does anyone have any stats for the rate at which batch jobs are executed? I am working with a py2neo/GEOFF user to look at memory usage and performance for some very large jobs (working towards millions of entities) and am currently running a test which attempts to create around 21,000 nodes in a single batch. From what I can tell, the POST payload is pretty quick to create but the whole process slows down considerably on submission. Watching the dashboard shows nodes steadily being created but not at the rate I'd hope for. Any thoughts? * * *Nigel Small* Phone: +44 7814 638 246 Blog: http://nigelsmall.name/ GTalk: ni...@nigelsmall.name MSN: nasm...@live.co.uk Skype: technige Twitter: @technige https://twitter.com/#!/technige LinkedIn: http://uk.linkedin.com/in/nigelsmall ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] SDG 2.0.0.M1 cross-store does not work properly
Hi Michael thanks a lot for your hints, below test which expose the problem. It seems as follows: after deserialization entity state is null. Maybe this is acceptable behavior - meaning entities are not supposed to be serializable, or it is an issue which should be fixed? I added this test case to WorldRepositoryTest in spring-data-neo4j-hello-worlds-aspects project: @Test public void testSerialization() throws Exception { World myWorld = new World( mine, 0 ).persist(); EntityStateNode entityState = myWorld.getEntityState(); assertNotNull(entityState); IterableWorld foundWorlds = galaxy.findAll(); World mine = foundWorlds.iterator().next(); byte[] serializedWorld = SerializationUtils.serialize(mine); World deserializedWorld = (World) SerializationUtils.deserialize(serializedWorld); assertNotNull(deserializedWorld); EntityStateNode deserializedEntityState = deserializedWorld.getEntityState(); assertNotNull(deserializedEntityState); //Test fails at this assertion template.save(deserializedWorld);//This invocation leads to NPE since entityState is null assertEquals(myWorld.getName(),deserializedWorld.getName()); } Running similar operation in project with no aspectj doesn't lead to this problem. Thanks a lot for your feedback. Greets from Berlin, Marcin -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/SDG-2-0-0-M1-cross-store-does-not-work-properly-tp3481372p3488532.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] HelloWorldTest.java:21: package org.neo4j.visualization.asciidoc does not exist
Ditto -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/HelloWorldTest-java-21-package-org-neo4j-visualization-asciidoc-does-not-exist-tp3462047p3488556.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 Java Example
Is there a simple example of using neo4j in java? One that along the lines of HelloWorld? I looked at http://docs.neo4j.org/chunked/snapshot/server-java-rest-client-example.html, but it apparently requires some code for jetty, and I looked at http://docs.neo4j.org/chunked/milestone/server-java-rest-client-example.html, but it also requires additional libraries apparently. I had no problem getting neo4j up and running (I guess, cannot verify), but finding an example that compiles is proving difficult. Is there a simple one-file example of Neo4j usage? Thanks for any help. Mike Hampton Senior Software Engineer Intelligent Software Solutionshttp://www.issinc.com/ 5450 Tech Center Drive Colorado Springs, CO 80919-2341 Office: 719.234.0655 US Cell: 719.440.4889 Yahoo IM: javamike9 AOL IM: javamike9 Gmail: mike.hampton.issinc@gmail.commailto:mike.hampton.issinc@gmail.com Skype: mike.hampton.issinc.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Simple Java Example
Hi Mike, Neo4j's default APIs are all Java. Have a look at the Neo4j tutorial here: https://github.com/jimwebber/neo4j-tutorial It will take you from the core API right the way through indexing, traversers, Cypher, and into the REST API should you want to go that far up the stack. And it's already configured to use the latest milestone - you should be up and running in a few minutes once you've cloned the git repository. Jim ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Neo4j Events This Week
Hey there, Here are this week's events coming up. Remember, check back to http://plancast.com/neo4j for updates! * London Tutorial | Ian Robinson and Jim Webber's Neo4j Tutorial * Thursday, 3 November 2011 This intensive Neo4J tutorial provides a mixture of theory and hands-on practical sessions to demonstrate the capabilities of graph data and the Neo4j database. http://skillsmatter.com/course/nosql/neo4j-tutorial * Conference Sponsorship | Øredev Developer Conference * 07-11 November 2011 Neo4j will be hosting a room, and sponsoring the first 20 attendees with an Øredev Open ticket. All you have to do is register http://oredev.org/2011/oredev-open, and click the Neo4j box http://oredev.org/2011/oredev-open *Malmö Meetup | Ruby neo4j graph goodness w/ Andreas Ronge * Tuesday, 8 November 2011 We are meeting with the Malmo Ruby guys and see some good examples of what you can build with Neo4j http://www.meetup.com/malmo-ruby/events/35429252/ *Malmö Conference Talk | REST in Practice *Wednesday, 9 November 2011 Jim Webber presents: In this talk we'll show how to implement business workflows and common patterns like event-driven computing. We'll see how many common-sense distributed systems principles and best practices are inverted as we design to increase surface area, scale, improve availability and compose services. oredev.org/2011/sessions/rest-in-practice *Malmö Conference Talk | Test-Driven REST * Wednesday, 9 November 2011 Ian Robinson presents: REST's hypermedia constraint is all about getting things done - that is, making changes to the state of an application to achieve a particular goal. Put simply, in a web-based hypermedia system, clients apply HTTP's uniform interface to operate links and forms in pursuit of their application goals. In this session I'll discuss the implementation of machine-to-machine interactions in a hypermedia-driven distributed system. I'll look at how we can develop and test discrete parts of a workflow, and build adaptable clients that can be guided on the fly to complete their application goals. I'll conclude by introducing you to a hands-on tutorial that you can complete using the new Microsoft Web APIs. oredev.org/2011/sessions/test-driven-rest *Malmö Conference Talk | Event Sourcing Explained * Thursday, 10 November 2011 Rickard Öberg presents: Your business wants to use data from your application, but in a way that you didn't anticipate from the beginning. Now what do you do? If you are using EventSourcing, you're in luck, and this session will describe how thistechnique can help you deal with these types of situations, and more. oredev.org/2011/sessions/event-sourcing-explained *Malmö Conference Talk | From Småland's Woods to Silicon Valley * Thursday, 10 November 2011 Peter Neubauer presents: A company is like a baby. And it takes as long to allow it to grow. Don't fool yourself and be prepared for a journey from Påskallavik to Menlo Park. It takes a village to raise a child, and a community to grow a company. http://oredev.org/2011/sessions/from-smalands-woods-to-silicon-valley-a-modern-wilhelm-moberg-story * Webinar | Introduction to Spring Data Neo4j * Thursday, 10 November 2011 The Spring Data project makes it easier to build Spring-powered applications that use new data access technologies such as non-relational NOSQL databases, cloud based data services, for instance graph databases. This webinar is designed for enterprise developers that are working with Spring and need to understand how they would integrate a NOSQL graph database. bit.ly/uiKS6x *Webinar | Introduction to Spring Data Neo4j (Europe timezone)* Thursday, 10 November 2011 @16:00 CET The Spring Data project makes it easier to build Spring-powered applications that use new data access technologies such as non-relational NOSQL databases, cloud based data services, for instance graph databases. This webinar is designed for enterprise developers that are working with Spring and need to understand how they would integrate a NOSQL graph database. bit.ly/uiKS6x *Allison Sparrow* * **Marketing Manager | Neo Technology* +19499036091 | @ayeeson http://twitter.com/#%21/ayeeson ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlig Plugin - Paramerterised Queries + Enumeration - Neo4j 1.5M02
Hi Guys, I can confirm that the gremlin query works in the Console but not in the REST API. Console Working: gremlin g.v(0).outE[[label:'HOSTS']].inV{ it['UniqueId'] == 11761 }.drop(0).take(100)._() == v[756] I will log a bug issue on this: https://github.com/neo4j/gremlin-plugin/issues/3 Thank you From: mystory-develop...@barnardos.org.au [mailto:mystory-develop...@barnardos.org.au] On Behalf Of Romiko Derbynew Sent: Monday, 7 November 2011 10:48 AM To: Neo4j user discussions Cc: Tatham Oddie; mystory-develop...@barnardos.org.au Subject: [mystory-developers] Gremlig Plugin - Paramerterised Queries + Enumeration - Neo4j 1.5M02 Hi Guys, I have found a new bug in the Neo4j 1.5M02 release, or perhaps a different way of querying needs to be done. If I do a HTTP POST with this 127.255.0.0:20001/db/data/ext/GremlinPlugin/graphdb/execute_script HTTP POST Content[1] = {Accept=application/xml, text/json, text/x-json, text/javascript, text/xml, application/json} Content [2] = { script: g.v(p0).outE[[label:p1]].inV{ it[p2] == null }.drop(p3).take(p4)._(), params: { p0: 0, p1: HOSTS, p2: UniqueId, p3: 0, p4: 100 } } The Response from the above HTTP POST is this: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: com.tinkerpop.pipes.util.FluentPipeline.inV() is applicable for argument types: (Script10$_run_closure1) values: [Script10$_run_closure1@303a6f8]\nPossible solutions: inV(), in([Ljava.lang.String;), inE([Ljava.lang.String;), V(), id(), find() This used to work with Neo4j 1.5M01 release. Has the code changed between the releases on how parameterized queries are now constructed in Gremlin? Romiko Derbynew Readify | Senior Consultant Suite 408 Life.Lab Building | 198 Harbour Esplanade | Docklands | VIC 3008 | Australia M: +61 400 090 251 | E: romiko.derby...@readify.net | W: www.readify.net | Blog: romikoderbynew.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] How to install neo4j spatial neo4j-enterprise
Hi, My OS is ubuntu 11.04.I have downloaded 'neo4j-enterprise-1.5.M02' and 'neo4j-spatial-be288f2'.When I executed the command 'mvn clean install',it did not work,then I executed 'mvn install -Dmaven.test.skip=true',it worked very well,then I unziped 'neo4j-spatial-0.7-SNAPSHOT-server-plugin.zip' to neo4j-enterprise- 1.5.M02/plugins. In 'neo4j-enterprise-1.5.M02/bin',I executed ./neo4j start,then the server started.then I excuted the curl: curl http://localhost:7474/db/data/{relationship_index:; http://localhost:7474/db/data/index/relationship,node:; http://localhost:7474/db/data/node,relationship_types:; http://localhost:7474/db/data/relationship/types,extensions_info:; http://localhost:7474/db/data/ext,node_index:; http://localhost:7474/db/data/index/node,reference_node:; http://localhost:7474/db/data/node/0 ,extensions:{SpatialPlugin:{addSimplePointLayer: http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer ,addNodeToLayer: http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addNodeToLayer}}} After that ,I got the following message: html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/relationship_index: http://localhost:7474/db/data/index/relationship. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/node:http://localhost:7474/db/data/node. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/relationship_types: http://localhost:7474/db/data/relationship/types. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/extensions_info: http://localhost:7474/db/data/ext. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/node_index: http://localhost:7474/db/data/index/node. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/reference_node: http://localhost:7474/db/data/node/0. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/extensions:SpatialPlugin:addSimplePointLayer: http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/extensions:SpatialPlugin:addNodeToLayer: http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addNodeToLayer. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html Now I don't know which step is wrong? please help me. zhao ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Gremlig Plugin - Paramerterised Queries + Enumeration - Neo4j 1.5M02
Hey, I can confirm that the gremlin query works in the Console but not in the REST API. Console Working: gremlin g.v(0).outE[[label:'HOSTS']].inV{ it['UniqueId'] == 11761 }.drop(0).take(100)._() == v[756] I will log a bug issue on this: https://github.com/neo4j/gremlin-plugin/issues/3 I notice you are using an old version of Gremlin. I believe you are using 1.1 or less? If you move to 1.2+, the faster representation of your query is: g.v(0).out('HOSTS').filter{it.getProperty('UniqueId') == 11761} Enjoy, Marko. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Get an invitation to http://addons.heroku.com/neo4j
I am new to Neo4j and would really wanna try it out. Where can I get an invitation to http://addons.heroku.com/neo4j ? Thanks. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Get-an-invitation-to-http-addons-heroku-com-neo4j-tp3489005p3489005.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] Gremlig Plugin - Paramerterised Queries + Enumeration - Neo4j 1.5M02
Thanks guys, will look into it asap. On Nov 8, 2011 3:03 AM, Marko Rodriguez okramma...@gmail.com wrote: Hey, I can confirm that the gremlin query works in the Console but not in the REST API. Console Working: gremlin g.v(0).outE[[label:'HOSTS']].inV{ it['UniqueId'] == 11761 }.drop(0).take(100)._() == v[756] I will log a bug issue on this: https://github.com/neo4j/gremlin-plugin/issues/3 I notice you are using an old version of Gremlin. I believe you are using 1.1 or less? If you move to 1.2+, the faster representation of your query is: g.v(0).out('HOSTS').filter{it.getProperty('UniqueId') == 11761} Enjoy, Marko. ___ 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
Re: [Neo4j] HelloWorldTest.java:21: package org.neo4j.visualization.asciidoc does not exist
Mike, This class is part of neo4j-GraphViz. How are you setting up your classpath? On Nov 8, 2011 12:02 AM, mike.hampton mike.hamp...@issinc.com wrote: Ditto -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/HelloWorldTest-java-21-package-org-neo4j-visualization-asciidoc-does-not-exist-tp3462047p3488556.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 mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] version conflicts
Are you running Gremlin standalone? Both Gremlin and Neoclipse might not be updated yet. Release of 1.5 is imminent, so I hope these issues are gone by this week if you can wait some days? On Nov 7, 2011 8:48 PM, grimace macegh...@gmail.com wrote: Hi, I'm just getting started with Neo4j, spatial, gremlin and Neoclipse. I can successfully run (via eclipse) an import of 'map.osm' file using OSMImporter by linking to libraries that come with the spatial distribution. When I try to use gremlin or neoclipse to attach to the data I get a db version error. I'm wondering if there is a repository that I can download from ( or build ) where all these components are in sync. Or maybe someone has a suggestion for how I can proceed. both gremlin and neoclipse report a version problem, here is gremlins output: Caused by: org.neo4j.kernel.impl.nioneo.store.IllegalStoreVersionException: Store version [NeoStore v0.A.0]. Please make sure you are not running old Neo4j kernel on a store that has been created by newer version of Neo4j. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/version-conflicts-tp3488028p3488028.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 mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] How to install neo4j spatial neo4j-enterprise
Hi there, Could you please try again with a neo4j 1.5 snapshot build and report back? On Nov 8, 2011 3:01 AM, chen zhao dreamthinkin...@gmail.com wrote: Hi, My OS is ubuntu 11.04.I have downloaded 'neo4j-enterprise-1.5.M02' and 'neo4j-spatial-be288f2'.When I executed the command 'mvn clean install',it did not work,then I executed 'mvn install -Dmaven.test.skip=true',it worked very well,then I unziped 'neo4j-spatial-0.7-SNAPSHOT-server-plugin.zip' to neo4j-enterprise- 1.5.M02/plugins. In 'neo4j-enterprise-1.5.M02/bin',I executed ./neo4j start,then the server started.then I excuted the curl: curl http://localhost:7474/db/data/{relationship_index:; http://localhost:7474/db/data/index/relationship,node:; http://localhost:7474/db/data/node,relationship_types:; http://localhost:7474/db/data/relationship/types,extensions_info:; http://localhost:7474/db/data/ext,node_index:; http://localhost:7474/db/data/index/node,reference_node:; http://localhost:7474/db/data/node/0 ,extensions:{SpatialPlugin:{addSimplePointLayer: http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer ,addNodeToLayer: http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addNodeToLayer}}} After that ,I got the following message: html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/relationship_index: http://localhost:7474/db/data/index/relationship. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/node:http://localhost:7474/db/data/node. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/relationship_types: http://localhost:7474/db/data/relationship/types. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/extensions_info: http://localhost:7474/db/data/ext. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/node_index: http://localhost:7474/db/data/index/node. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/reference_node: http://localhost:7474/db/data/node/0. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/extensions:SpatialPlugin:addSimplePointLayer: http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer . Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 404 Not Found/title /head bodyh2HTTP ERROR 404/h2 pProblem accessing /db/data/extensions:SpatialPlugin:addNodeToLayer: http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addNodeToLayer. Reason: preNot Found/pre/phr /ismallPowered by Jetty:///small/ibr/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ br/ /body /html Now I don't know which step is wrong? please help me. zhao ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list
Re: [Neo4j] Batch Throughput
Nice! On Nov 7, 2011 10:44 PM, Nigel Small ni...@nigelsmall.name wrote: Ooops!! Hadn't set configuration params for 1.5! Much faster now :-) * * *Nigel Small* Phone: +44 7814 638 246 Blog: http://nigelsmall.name/ GTalk: ni...@nigelsmall.name MSN: nasm...@live.co.uk Skype: technige Twitter: @technige https://twitter.com/#!/technige LinkedIn: http://uk.linkedin.com/in/nigelsmall On 7 November 2011 21:18, Nigel Small ni...@nigelsmall.name wrote: Hello Neoforgers... Does anyone have any stats for the rate at which batch jobs are executed? I am working with a py2neo/GEOFF user to look at memory usage and performance for some very large jobs (working towards millions of entities) and am currently running a test which attempts to create around 21,000 nodes in a single batch. From what I can tell, the POST payload is pretty quick to create but the whole process slows down considerably on submission. Watching the dashboard shows nodes steadily being created but not at the rate I'd hope for. Any thoughts? * * *Nigel Small* Phone: +44 7814 638 246 Blog: http://nigelsmall.name/ GTalk: ni...@nigelsmall.name MSN: nasm...@live.co.uk Skype: technige Twitter: @technige https://twitter.com/#!/technige LinkedIn: http://uk.linkedin.com/in/nigelsmall ___ 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
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