Re: [Neo4j] [bug?] Unicode node property not returned correctly from bulk REST index search
Cool. Thanks. On Tue, Nov 1, 2011 at 10:00 AM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nuo, this is recreated now, but I had no time to fix it yet, just FYI. https://github.com/neo4j/community/issues/69 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 Enterprise. http://startupbootcamp.org/- Öresund - Innovation happens HERE. On Fri, Oct 21, 2011 at 1:26 AM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Thanks Nuo, submitted as a bug at https://github.com/neo4j/community/issues/69 Feel free to track it - hope to get to it next week. 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 Enterprise. http://startupbootcamp.org/- Öresund - Innovation happens HERE. On Fri, Oct 21, 2011 at 10:07 AM, Nuo Yan yan@gmail.com wrote: Hey Peter, using the example of my original email, this is the corresponding json body I post when I created the node: {\uid\:\12345\,\name\:\\\u4f8b\\u5b50\} A single GET query returns the name data (as raw json) as: \name\ : \\xE4\xBE\x8B\xE5\xAD\x90\\n which after JSON parse becomes the correct one: name = 例子 When sending the same request as a POST to /batch, the server returns the following raw json: \name\ : \\xEF\xBF\xA4\xEF\xBE\xBE\xEF\xBE\x8B\xEF\xBF\xA5\xEF\xBE\xAD\xEF\xBE\x90\\n which after JSON parse becomes the busted result: name=¦ᄒヒ¥ᆳミ On Thu, Oct 20, 2011 at 11:28 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Guys, Do you have a JSON string you would use to set properties on a node? Can then update a test with it and check. On Oct 21, 2011 7:27 AM, Nuo Yan yan@gmail.com wrote: Yea, I'm pretty sure it's not a client parse issue. The data is correct in the database, and a single GET query returns the right data, only when doing the same request as a part of the bulk request, it returns busted data. It can be reproduced using curl and as well as rest client. I'm using 1.4.2 stable. Anyone from the neo4j team has any insight on this? On Thu, Oct 20, 2011 at 7:59 PM, Rick Bullotta rick.bullo...@thingworx.comwrote: I doubt it, since a GET works fine. It's probably an encoding issue somewhere in the batch processing pipeline. -Original Message- From: user-boun...@lists.neo4j.org [mailto: user-boun...@lists.neo4j.org] On Behalf Of Daniel Fitzpatrick Sent: Thursday, October 20, 2011 10:37 PM To: Neo4j user discussions Subject: Re: [Neo4j] [bug?] Unicode node property not returned correctly from bulk REST index search Possibly an issue with the client code not understanding unicode. Is there something you could use as a baseline to rule the database out eg maybe the web admin? On Oct 20, 2011 7:48 PM, Nuo Yan yan@gmail.com wrote: I have nodes with data properties with unicode (Chinese/Japanese) characters such as: {uid = 12345, name = 例子} I index such nodes with their id, so that by doing this (where users_index is the index, uid is the key, 12345 is the value): GET to /index/node/users_index/uid/12345 I can get back the right result: {indexed= http://localhost:7474/db/data/index/node/users_node/uid/12345/6638 , outgoing_relationships= http://localhost:7474/db/data/node/6638/relationships/out;, * data={uid=12345, name=例子}, * traverse= http://localhost:7474/db/data/node/6638/traverse/{returnType} , all_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/all/{-list||types} , property= http://localhost:7474/db/data/node/6638/properties/{key} , self=http://localhost:7474/db/data/node/6638;, properties= http://localhost:7474/db/data/node/6638/properties;, outgoing_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/out/{-list||types} , incoming_relationships= http://localhost:7474/db/data/node/6638/relationships/in;, extensions={}, create_relationship= http://localhost:7474/db/data/node/6638/relationships;, paged_traverse= http://localhost:7474/db/data/node/6638/paged/traverse/{returnType}{?pageSize,leaseTime} , all_relationships= http://localhost:7474/db/data/node/6638/relationships/all;, incoming_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/in/{-list||types
Re: [Neo4j] 1.5M02 failed to start on reboot
Have you checked logs? What was the failure you saw? In an non-clean shutdown, the next time it starts it would try to recover the indicies. It takes time, and if the timeout value you set (for starting the service) is less than the time needed for the recovery, the server would have trouble starting. You can look at the logs (neo4j log and the message logs in your graph dir) to see if this is the case. However, if it is the case, I'm still wondering how this can be acceptable in a production environment. For example, if the neo4j server failed and we have to start a new server with a snapshot of old data, chances are the old data snapshot is not going to be from a clean shut down. It sounds unacceptable to me to have hours of down time just because neo4j needs to recover the indicies. Any insights/best practices from experts? On Wed, Oct 26, 2011 at 10:58 AM, KanTube mich...@mkanner.com wrote: I encountered a odd error. I installed several windows updates (it was Tuesday :) ) and then proceeded to reboot my servers (three in total). on one server the Neo4j service did not restart. I then deleted the data directory and the service started correctly. I then moved the data from another server to this server and it started correctly again. Seems like original data file became corrupted during the shutdown. I have the data files if you think this is something you want to investigate (it is a very small data set) setup win7 x64 (vm running in Fusion) Neo4j 1.5M02 -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/1-5M02-failed-to-start-on-reboot-tp3455296p3455296.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] Gremlin help
For the record, in case someone else has similar need, I came up with the following query that does what I described in the last email below (still on gremlin 1.2 so still using Commit Manager): manager = TransactionalGraphHelper.createCommitManager(g, 50); g.v(1).out('foo').transform{[it, it.name, it.outE('bar').count()]}.aggregate().cap.next().groupBy{it[1]}.each{key,value - value.sort{a,b - b[2] = a[2]}.eachWithIndex{a,i - if(i 0) {g.removeVertex(a[0]); manager.incrCounter()}}} manager.close(); After going through this I got a lot better understanding in Gremlin. Thanks Peter and Marko. On Sat, Oct 22, 2011 at 6:04 PM, Nuo Yan yan@gmail.com wrote: Thanks very much Marko. I researched the query one step at a time and gained much more knowledge about gremlin. However, I wanted to do something a little bit different, instead of comparing the name property of the children nodes to the source node, I wanted to compare among the siblings of the children nodes (only first level under the source node) and if there are duplicates, only keep the one with the biggest degree of bar relationship. (The source node doesn't have a name property). For example, v(1) --foo-- v(2) name: abc --bar-- (15 nodes) v(1) --foo-- v(3) name: abc --bar -- (20 nodes) v(1) --foo-- v(4) name xyz --bar-- (15 nodes) v(1) --foo-- v(5) name xyz --bar-- (25 nodes) would become: v(1) --foo-- v(3) name: abc --bar -- (20 nodes) v(1) --foo-- v(5) name xyz --bar-- (25 nodes) So instead of doing g.v(1).sideEffect{x = it.getProperty('name')}.out('foo').filter{it.getProperty('name').equals(x)} I proposed doing: g.v(1).out(foo).transform{[it, it.name, it.out(bar).count]}.aggregate.cap to get an array of first level children nodes, their names, and degree of bar edges like [v(2), abc, 15], [v(3), abc, 20], [v(4), xyz, 15], [v(5), xyz, 20] And then I can sort the array by the name property, and iterate through that array to delete nodes that have a smaller count based on the count value specified in each sub array. But since my gremlin knowledge is still very limited, before digging too much into this proposed solution I want to verify with you that it would work and see if you have better or easier approach to do it (i.e. maybe one simple method that I can make use that I'm not aware of). Thanks very much again. On Sat, Oct 22, 2011 at 9:40 AM, Marko Rodriguez okramma...@gmail.comwrote: Hi, Currently I'm doing the following in my own code with multiple requests to the standalone neo4j server. I wonder if it's possible to achieve in one gremlin query/script so that I can post the gremlin query to the server as 1 request and done. What I'm trying to achieve is: Start from one given node (e.g. v1), get all of the nodes connected through a given type of relationship (e.g. relationship foo), within all of these nodes, see if their name property has the same value, and if so, delete the node (and the foo relationship connected to it) with smaller outgoing degree (on a specific type of relationship, say, bar). If there are more than two nodes with the same name property, only keep the one with biggest outgoing degree (on type bar). The query below is to warm you up. It will delete all vertices with same property value as source vertex that are 'foo' related to source vertex. Given that you are mutating the graph, you will want to deal with transaction buffers so you don't do one transaction per mutations: https://github.com/tinkerpop/blueprints/wiki/Graph-Transactions g.v(1).sideEffect{x = it.getProperty('name')}.out('foo').filter{it.getProperty('name').equals(x)}.sideEffect{g.removeVertex(it)} - To do the stuff with the smaller counts, etc. You can do: g.v(1).sideEffect{x = it.getProperty('name')}.out('foo').filter{it.getProperty('name').equals(x)}.transform{[it, it.outE('bar').count()]}.filter{it[1] 0}.aggregate.cap.next().sort{a,b - b[1] = a[1]}.eachWithIndex{a,i - if(i 0) g.removeVertex(a[0])} There you go! One big fatty Gremlin query to solve your problem. I would recommend going through each step and seeing what it returns so you understand what is going on Again, given that you are mutating the graph, be sure to be wise about transactions. Enjoy!, Marko. http://markorodriguez.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] Gremlin help
Hi Marko, I believe 1.5 milestone release has Gremlin 1.3 and Blueprints 1.0 but before 1.5 stable release I'm going to be using 1.4.x. In 1.4.2 it only has Gremlin 1.2 and doesn't appear to have the setTransactionBufferSize stuff. On Tue, Oct 25, 2011 at 11:52 AM, Marko Rodriguez okramma...@gmail.comwrote: Hi, Note that with Blueprints 1.0, you do not have to deal with a commit manager. You can do: graph.setTransactionBufferSize(50); ...and then simply do your traversal. No manager.incrCount() needed. I believe the latest Neo4j release uses Gremlin 1.3 and Blueprints 1.0. ?? Peter? Take care, Marko. http://markorodriguez.com On Oct 25, 2011, at 12:43 PM, Nuo Yan wrote: For the record, in case someone else has similar need, I came up with the following query that does what I described in the last email below (still on gremlin 1.2 so still using Commit Manager): manager = TransactionalGraphHelper.createCommitManager(g, 50); g.v(1).out('foo').transform{[it, it.name, it.outE('bar').count()]}.aggregate().cap.next().groupBy{it[1]}.each{key,value - value.sort{a,b - b[2] = a[2]}.eachWithIndex{a,i - if(i 0) {g.removeVertex(a[0]); manager.incrCounter()}}} manager.close(); After going through this I got a lot better understanding in Gremlin. Thanks Peter and Marko. On Sat, Oct 22, 2011 at 6:04 PM, Nuo Yan yan@gmail.com wrote: Thanks very much Marko. I researched the query one step at a time and gained much more knowledge about gremlin. However, I wanted to do something a little bit different, instead of comparing the name property of the children nodes to the source node, I wanted to compare among the siblings of the children nodes (only first level under the source node) and if there are duplicates, only keep the one with the biggest degree of bar relationship. (The source node doesn't have a name property). For example, v(1) --foo-- v(2) name: abc --bar-- (15 nodes) v(1) --foo-- v(3) name: abc --bar -- (20 nodes) v(1) --foo-- v(4) name xyz --bar-- (15 nodes) v(1) --foo-- v(5) name xyz --bar-- (25 nodes) would become: v(1) --foo-- v(3) name: abc --bar -- (20 nodes) v(1) --foo-- v(5) name xyz --bar-- (25 nodes) So instead of doing g.v(1).sideEffect{x = it.getProperty('name')}.out('foo').filter{it.getProperty('name').equals(x)} I proposed doing: g.v(1).out(foo).transform{[it, it.name, it.out(bar).count]}.aggregate.cap to get an array of first level children nodes, their names, and degree of bar edges like [v(2), abc, 15], [v(3), abc, 20], [v(4), xyz, 15], [v(5), xyz, 20] And then I can sort the array by the name property, and iterate through that array to delete nodes that have a smaller count based on the count value specified in each sub array. But since my gremlin knowledge is still very limited, before digging too much into this proposed solution I want to verify with you that it would work and see if you have better or easier approach to do it (i.e. maybe one simple method that I can make use that I'm not aware of). Thanks very much again. On Sat, Oct 22, 2011 at 9:40 AM, Marko Rodriguez okramma...@gmail.com wrote: Hi, Currently I'm doing the following in my own code with multiple requests to the standalone neo4j server. I wonder if it's possible to achieve in one gremlin query/script so that I can post the gremlin query to the server as 1 request and done. What I'm trying to achieve is: Start from one given node (e.g. v1), get all of the nodes connected through a given type of relationship (e.g. relationship foo), within all of these nodes, see if their name property has the same value, and if so, delete the node (and the foo relationship connected to it) with smaller outgoing degree (on a specific type of relationship, say, bar). If there are more than two nodes with the same name property, only keep the one with biggest outgoing degree (on type bar). The query below is to warm you up. It will delete all vertices with same property value as source vertex that are 'foo' related to source vertex. Given that you are mutating the graph, you will want to deal with transaction buffers so you don't do one transaction per mutations: https://github.com/tinkerpop/blueprints/wiki/Graph-Transactions g.v(1).sideEffect{x = it.getProperty('name')}.out('foo').filter{it.getProperty('name').equals(x)}.sideEffect{g.removeVertex(it)} - To do the stuff with the smaller counts, etc. You can do: g.v(1).sideEffect{x = it.getProperty('name')}.out('foo').filter{it.getProperty('name').equals(x)}.transform{[it, it.outE('bar').count()]}.filter{it[1] 0}.aggregate.cap.next().sort{a,b - b[1] = a[1]}.eachWithIndex{a,i - if(i 0) g.removeVertex(a[0])} There you go! One big fatty Gremlin query to solve your problem. I would recommend
Re: [Neo4j] Gremlin help
Thanks very much Marko. I researched the query one step at a time and gained much more knowledge about gremlin. However, I wanted to do something a little bit different, instead of comparing the name property of the children nodes to the source node, I wanted to compare among the siblings of the children nodes (only first level under the source node) and if there are duplicates, only keep the one with the biggest degree of bar relationship. (The source node doesn't have a name property). For example, v(1) --foo-- v(2) name: abc --bar-- (15 nodes) v(1) --foo-- v(3) name: abc --bar -- (20 nodes) v(1) --foo-- v(4) name xyz --bar-- (15 nodes) v(1) --foo-- v(5) name xyz --bar-- (25 nodes) would become: v(1) --foo-- v(3) name: abc --bar -- (20 nodes) v(1) --foo-- v(5) name xyz --bar-- (25 nodes) So instead of doing g.v(1).sideEffect{x = it.getProperty('name')}.out('foo').filter{it.getProperty('name').equals(x)} I proposed doing: g.v(1).out(foo).transform{[it, it.name, it.out(bar).count]}.aggregate.cap to get an array of first level children nodes, their names, and degree of bar edges like [v(2), abc, 15], [v(3), abc, 20], [v(4), xyz, 15], [v(5), xyz, 20] And then I can sort the array by the name property, and iterate through that array to delete nodes that have a smaller count based on the count value specified in each sub array. But since my gremlin knowledge is still very limited, before digging too much into this proposed solution I want to verify with you that it would work and see if you have better or easier approach to do it (i.e. maybe one simple method that I can make use that I'm not aware of). Thanks very much again. On Sat, Oct 22, 2011 at 9:40 AM, Marko Rodriguez okramma...@gmail.comwrote: Hi, Currently I'm doing the following in my own code with multiple requests to the standalone neo4j server. I wonder if it's possible to achieve in one gremlin query/script so that I can post the gremlin query to the server as 1 request and done. What I'm trying to achieve is: Start from one given node (e.g. v1), get all of the nodes connected through a given type of relationship (e.g. relationship foo), within all of these nodes, see if their name property has the same value, and if so, delete the node (and the foo relationship connected to it) with smaller outgoing degree (on a specific type of relationship, say, bar). If there are more than two nodes with the same name property, only keep the one with biggest outgoing degree (on type bar). The query below is to warm you up. It will delete all vertices with same property value as source vertex that are 'foo' related to source vertex. Given that you are mutating the graph, you will want to deal with transaction buffers so you don't do one transaction per mutations: https://github.com/tinkerpop/blueprints/wiki/Graph-Transactions g.v(1).sideEffect{x = it.getProperty('name')}.out('foo').filter{it.getProperty('name').equals(x)}.sideEffect{g.removeVertex(it)} - To do the stuff with the smaller counts, etc. You can do: g.v(1).sideEffect{x = it.getProperty('name')}.out('foo').filter{it.getProperty('name').equals(x)}.transform{[it, it.outE('bar').count()]}.filter{it[1] 0}.aggregate.cap.next().sort{a,b - b[1] = a[1]}.eachWithIndex{a,i - if(i 0) g.removeVertex(a[0])} There you go! One big fatty Gremlin query to solve your problem. I would recommend going through each step and seeing what it returns so you understand what is going on Again, given that you are mutating the graph, be sure to be wise about transactions. Enjoy!, Marko. http://markorodriguez.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] [bug?] Unicode node property not returned correctly from bulk REST index search
Hey Peter, using the example of my original email, this is the corresponding json body I post when I created the node: {\uid\:\12345\,\name\:\\\u4f8b\\u5b50\} A single GET query returns the name data (as raw json) as: \name\ : \\xE4\xBE\x8B\xE5\xAD\x90\\n which after JSON parse becomes the correct one: name = 例子 When sending the same request as a POST to /batch, the server returns the following raw json: \name\ : \\xEF\xBF\xA4\xEF\xBE\xBE\xEF\xBE\x8B\xEF\xBF\xA5\xEF\xBE\xAD\xEF\xBE\x90\\n which after JSON parse becomes the busted result: name=¦ᄒヒ¥ᆳミ On Thu, Oct 20, 2011 at 11:28 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Guys, Do you have a JSON string you would use to set properties on a node? Can then update a test with it and check. On Oct 21, 2011 7:27 AM, Nuo Yan yan@gmail.com wrote: Yea, I'm pretty sure it's not a client parse issue. The data is correct in the database, and a single GET query returns the right data, only when doing the same request as a part of the bulk request, it returns busted data. It can be reproduced using curl and as well as rest client. I'm using 1.4.2 stable. Anyone from the neo4j team has any insight on this? On Thu, Oct 20, 2011 at 7:59 PM, Rick Bullotta rick.bullo...@thingworx.comwrote: I doubt it, since a GET works fine. It's probably an encoding issue somewhere in the batch processing pipeline. -Original Message- From: user-boun...@lists.neo4j.org [mailto: user-boun...@lists.neo4j.org] On Behalf Of Daniel Fitzpatrick Sent: Thursday, October 20, 2011 10:37 PM To: Neo4j user discussions Subject: Re: [Neo4j] [bug?] Unicode node property not returned correctly from bulk REST index search Possibly an issue with the client code not understanding unicode. Is there something you could use as a baseline to rule the database out eg maybe the web admin? On Oct 20, 2011 7:48 PM, Nuo Yan yan@gmail.com wrote: I have nodes with data properties with unicode (Chinese/Japanese) characters such as: {uid = 12345, name = 例子} I index such nodes with their id, so that by doing this (where users_index is the index, uid is the key, 12345 is the value): GET to /index/node/users_index/uid/12345 I can get back the right result: {indexed= http://localhost:7474/db/data/index/node/users_node/uid/12345/6638;, outgoing_relationships= http://localhost:7474/db/data/node/6638/relationships/out;, * data={uid=12345, name=例子}, * traverse= http://localhost:7474/db/data/node/6638/traverse/{returnType} , all_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/all/{-list||types} , property=http://localhost:7474/db/data/node/6638/properties/{key} , self=http://localhost:7474/db/data/node/6638;, properties= http://localhost:7474/db/data/node/6638/properties;, outgoing_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/out/{-list||types} , incoming_relationships= http://localhost:7474/db/data/node/6638/relationships/in;, extensions={}, create_relationship= http://localhost:7474/db/data/node/6638/relationships;, paged_traverse= http://localhost:7474/db/data/node/6638/paged/traverse/{returnType}{?pageSize,leaseTime} , all_relationships= http://localhost:7474/db/data/node/6638/relationships/all;, incoming_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/in/{-list||types} } However, if I do the same search query as a part of a bulk REST request: POST to /batch: [{method = GET, to = /index/node/users_index/uid/12345, body = {}, id = 0}] Returns the node in the body, however, with bad characters in the data field: [{id=0, body=[{indexed= http://localhost:7474/db/data/index/node/users_node/uid/12345/6638;, outgoing_relationships= http://localhost:7474/db/data/node/6638/relationships/out;, *data={uid=12345, name=¥ᄂᄃ¥ツᄏ\uFFE7モワ}, * traverse= http://localhost:7474/db/data/node/6638/traverse/{returnType} , all_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/all/{-list||types} , property=http://localhost:7474/db/data/node/6638/properties/{key} , self=http://localhost:7474/db/data/node/6638;, properties= http://localhost:7474/db/data/node/6638/properties;, outgoing_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/out/{-list||types} , incoming_relationships= http://localhost:7474/db/data/node/6638/relationships/in;, extensions={}, create_relationship= http://localhost:7474/db/data/node/6638/relationships;, paged_traverse= http://localhost:7474/db/data/node/6638/paged/traverse/{returnType}{?pageSize,leaseTime} , all_relationships= http://localhost:7474/db/data/node/6638
[Neo4j] Gremlin help
Hi Marko and Gremlin gurus: Currently I'm doing the following in my own code with multiple requests to the standalone neo4j server. I wonder if it's possible to achieve in one gremlin query/script so that I can post the gremlin query to the server as 1 request and done. What I'm trying to achieve is: Start from one given node (e.g. v1), get all of the nodes connected through a given type of relationship (e.g. relationship foo), within all of these nodes, see if their name property has the same value, and if so, delete the node (and the foo relationship connected to it) with smaller outgoing degree (on a specific type of relationship, say, bar). If there are more than two nodes with the same name property, only keep the one with biggest outgoing degree (on type bar). For example, for the following graph: v1 --foo-- v2(name = abc) --bar-- (15 nodes) v1 --foo-- v3(name = abc) --bar-- (5 nodes) v1 --foo-- v4(name = abc) --bar-- (8 nodes) v1 --foo-- v5(name = xyz)--bar--(16 nodes) v1 --foo-- v6(name = abc)--not_bar-- (20 nodes) Ideally, after running the gremlin script, it should be: v1 --foo-- v2(name = abc) --bar-- (15 nodes) v1 --foo-- v5(name = xyz)--bar--(16 nodes) v1 --foo-- v6(name = abc)--not_bar-- (20 nodes) with v3 and v4 (and the foo relationships connecting them to v1) deleted because they have the same name attributes with v2 but a smaller degree with outgoing bar relationship. It this possible to achieve relatively easily with Gremlin? ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] [bug?] Unicode node property not returned correctly from bulk REST index search
I have nodes with data properties with unicode (Chinese/Japanese) characters such as: {uid = 12345, name = 例子} I index such nodes with their id, so that by doing this (where users_index is the index, uid is the key, 12345 is the value): GET to /index/node/users_index/uid/12345 I can get back the right result: {indexed= http://localhost:7474/db/data/index/node/users_node/uid/12345/6638;, outgoing_relationships= http://localhost:7474/db/data/node/6638/relationships/out;, * data={uid=12345, name=例子}, * traverse=http://localhost:7474/db/data/node/6638/traverse/{returnType} , all_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/all/{-list||types}, property=http://localhost:7474/db/data/node/6638/properties/{key};, self=http://localhost:7474/db/data/node/6638;, properties= http://localhost:7474/db/data/node/6638/properties;, outgoing_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/out/{-list||types}, incoming_relationships= http://localhost:7474/db/data/node/6638/relationships/in;, extensions={}, create_relationship= http://localhost:7474/db/data/node/6638/relationships;, paged_traverse= http://localhost:7474/db/data/node/6638/paged/traverse/{returnType}{?pageSize,leaseTime};, all_relationships= http://localhost:7474/db/data/node/6638/relationships/all;, incoming_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/in/{-list||types}} However, if I do the same search query as a part of a bulk REST request: POST to /batch: [{method = GET, to = /index/node/users_index/uid/12345, body = {}, id = 0}] Returns the node in the body, however, with bad characters in the data field: [{id=0, body=[{indexed= http://localhost:7474/db/data/index/node/users_node/uid/12345/6638;, outgoing_relationships= http://localhost:7474/db/data/node/6638/relationships/out;, *data={uid=12345, name=¥ᄂᄃ¥ツᄏ\uFFE7モワ}, * traverse=http://localhost:7474/db/data/node/6638/traverse/{returnType};, all_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/all/{-list||types}, property=http://localhost:7474/db/data/node/6638/properties/{key};, self=http://localhost:7474/db/data/node/6638;, properties= http://localhost:7474/db/data/node/6638/properties;, outgoing_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/out/{-list||types}, incoming_relationships= http://localhost:7474/db/data/node/6638/relationships/in;, extensions={}, create_relationship= http://localhost:7474/db/data/node/6638/relationships;, paged_traverse= http://localhost:7474/db/data/node/6638/paged/traverse/{returnType}{?pageSize,leaseTime};, all_relationships= http://localhost:7474/db/data/node/6638/relationships/all;, incoming_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/in/{-list||types} }], from=/index/node/users_node/uid/12345}] Do you think if this is a bug or is there anything I can change to make the bulk request return the correct Chinese/Japanese characters? I can reproduce this all the time. Thanks, Nuo ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [bug?] Unicode node property not returned correctly from bulk REST index search
Yea, I'm pretty sure it's not a client parse issue. The data is correct in the database, and a single GET query returns the right data, only when doing the same request as a part of the bulk request, it returns busted data. It can be reproduced using curl and as well as rest client. I'm using 1.4.2 stable. Anyone from the neo4j team has any insight on this? On Thu, Oct 20, 2011 at 7:59 PM, Rick Bullotta rick.bullo...@thingworx.comwrote: I doubt it, since a GET works fine. It's probably an encoding issue somewhere in the batch processing pipeline. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Daniel Fitzpatrick Sent: Thursday, October 20, 2011 10:37 PM To: Neo4j user discussions Subject: Re: [Neo4j] [bug?] Unicode node property not returned correctly from bulk REST index search Possibly an issue with the client code not understanding unicode. Is there something you could use as a baseline to rule the database out eg maybe the web admin? On Oct 20, 2011 7:48 PM, Nuo Yan yan@gmail.com wrote: I have nodes with data properties with unicode (Chinese/Japanese) characters such as: {uid = 12345, name = 例子} I index such nodes with their id, so that by doing this (where users_index is the index, uid is the key, 12345 is the value): GET to /index/node/users_index/uid/12345 I can get back the right result: {indexed= http://localhost:7474/db/data/index/node/users_node/uid/12345/6638;, outgoing_relationships= http://localhost:7474/db/data/node/6638/relationships/out;, * data={uid=12345, name=例子}, * traverse=http://localhost:7474/db/data/node/6638/traverse/{returnType} , all_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/all/{-list||types} , property=http://localhost:7474/db/data/node/6638/properties/{key};, self=http://localhost:7474/db/data/node/6638;, properties= http://localhost:7474/db/data/node/6638/properties;, outgoing_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/out/{-list||types} , incoming_relationships= http://localhost:7474/db/data/node/6638/relationships/in;, extensions={}, create_relationship= http://localhost:7474/db/data/node/6638/relationships;, paged_traverse= http://localhost:7474/db/data/node/6638/paged/traverse/{returnType}{?pageSize,leaseTime} , all_relationships= http://localhost:7474/db/data/node/6638/relationships/all;, incoming_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/in/{-list||types}} However, if I do the same search query as a part of a bulk REST request: POST to /batch: [{method = GET, to = /index/node/users_index/uid/12345, body = {}, id = 0}] Returns the node in the body, however, with bad characters in the data field: [{id=0, body=[{indexed= http://localhost:7474/db/data/index/node/users_node/uid/12345/6638;, outgoing_relationships= http://localhost:7474/db/data/node/6638/relationships/out;, *data={uid=12345, name=¥ᄂᄃ¥ツᄏ\uFFE7モワ}, * traverse=http://localhost:7474/db/data/node/6638/traverse/{returnType} , all_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/all/{-list||types} , property=http://localhost:7474/db/data/node/6638/properties/{key};, self=http://localhost:7474/db/data/node/6638;, properties= http://localhost:7474/db/data/node/6638/properties;, outgoing_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/out/{-list||types} , incoming_relationships= http://localhost:7474/db/data/node/6638/relationships/in;, extensions={}, create_relationship= http://localhost:7474/db/data/node/6638/relationships;, paged_traverse= http://localhost:7474/db/data/node/6638/paged/traverse/{returnType}{?pageSize,leaseTime} , all_relationships= http://localhost:7474/db/data/node/6638/relationships/all;, incoming_typed_relationships= http://localhost:7474/db/data/node/6638/relationships/in/{-list||types} }], from=/index/node/users_node/uid/12345}] Do you think if this is a bug or is there anything I can change to make the bulk request return the correct Chinese/Japanese characters? I can reproduce this all the time. Thanks, Nuo ___ 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
[Neo4j] Standalone neo4j server log question
I use neo4j as a standalone server with REST. I currently set the log level to be INFO in conf/logging.properties: org.neo4j.server.level=INFO java.util.logging.ConsoleHandler.level=INFO java.util.logging.ConsoleHandler.formatter=org.neo4j.server.logging.SimpleConsoleFormatter java.util.logging.ConsoleHandler.filter=org.neo4j.server.logging.NeoLogFilter However, I don't see any log showing up on the per request basis. I want to be able to see when requests coming in (no matter succeeded or not). Is there anywhere I'm missing configuration? How can I enable log corresponding to every request coming in? Thanks. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] REST API Base URI
Hi Jake, Thanks for your reply. Sorry if my previous email was misleading, but I don't absolutely need key-based authentication; that just turned out to be the what I first thought of. I was trying to figure out what authentication methods were supported so that I can evaluate. HTTPS + basic auth with strong passwords do sound good to me at this moment. However, at this moment, instead of using authentication, I turned out configured security rules on my the neo4j server to only take connections from my app server so I temporarily don't have a problem in the near future. But it's good to know about the authentication extension. By the way, do you have any data about the performance impact of using the authentication extension to do basic auth + HTTPS compare to talking to neo4j without authentication (both through REST)? If you have such data, please let me know. That would be very helpful information. Thanks, Nuo On Tue, Sep 27, 2011 at 6:10 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: As far as I know, the auth plugin currently only supports HTTP BASIC authentication. But it would be interesting to expand it to allow other authentication methods, for instance by allowing pluggable authentication providers. So if I understand your question correctly, yes, it does support authentication beyond just limiting access by IP, but it does not support authentication using keys or certificates. Out of curiosity, what is the driver behind needing key-based authentication? The combination of HTTP BASIC, strong passwords and HTTPS seems like it would supply quite strong security, no? /Jake On Wed, Sep 21, 2011 at 9:16 PM, Nuo Yan yan@gmail.com wrote: Limiting access to certain URIs or IPs is great, but ideally at this moment I also need something like a key-based authentication so I can send a private key in the headers from my restclient and neo4j would authenticate and only take authenticated requests. Does the authentication extension support key-based authentication? If not, what forms of authentication does it currently support (user/password, token-based, shared-secret)? Thanks, Nuo On Wed, Sep 21, 2011 at 11:24 AM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nuo, Thomas Baum has been working on an authentication extension for Neo4j Server, see https://github.com/neo4j/authentication-extension. He could help you set it up and test it - it's used in hosting scenarios and should do what you want in terms of limiting access to certain URIs if that is what you want? 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 - Your high performance graph database. http://startupbootcamp.org/- Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Wed, Sep 21, 2011 at 6:14 PM, Nuo Yan yan@gmail.com wrote: For my scenario, I currently only use the LB for request authentication, so that not everyone on the network can access the neo4j server. In my use case, I think making the base uri configurable (including the protocol, e.g. https://foobar.com/) is enough. There are a couple other approaches that may also solve my problem. For example, having a configurable option to make the REST APIs return only relative paths in the result. Or, if neo4j could have a built-in request authentication mechanism for the REST interface, I may be able to get rid of the lb completely. On Wed, Sep 21, 2011 at 7:04 AM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nuo, right now the server is discovering its own IP upon startup. However, it sounds reasonable to return configurable base URL. I am just wondering if that really is enough to support a LB scenario? Do you need more stuff there? 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 - Your high performance graph database. http://startupbootcamp.org/- Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Tue, Sep 20, 2011 at 6:57 PM, Nuo Yan yan@gmail.com wrote: I access my neo4j server through the REST API. For security purpose, I put the neo4j server behind a nginx lb. I'm wondering if there is config entry somewhere that I can set the neo4j server to return a customized base uri that I can set to my LB's uri. For example
Re: [Neo4j] REST API Base URI
For my scenario, I currently only use the LB for request authentication, so that not everyone on the network can access the neo4j server. In my use case, I think making the base uri configurable (including the protocol, e.g. https://foobar.com/) is enough. There are a couple other approaches that may also solve my problem. For example, having a configurable option to make the REST APIs return only relative paths in the result. Or, if neo4j could have a built-in request authentication mechanism for the REST interface, I may be able to get rid of the lb completely. On Wed, Sep 21, 2011 at 7:04 AM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nuo, right now the server is discovering its own IP upon startup. However, it sounds reasonable to return configurable base URL. I am just wondering if that really is enough to support a LB scenario? Do you need more stuff there? 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 - Your high performance graph database. http://startupbootcamp.org/- Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Tue, Sep 20, 2011 at 6:57 PM, Nuo Yan yan@gmail.com wrote: I access my neo4j server through the REST API. For security purpose, I put the neo4j server behind a nginx lb. I'm wondering if there is config entry somewhere that I can set the neo4j server to return a customized base uri that I can set to my LB's uri. For example, currently creating a node by POSTing to the lb (say https://10.0.0.1/db/data) returns { outgoing_relationships : http://neo4j/db/data/node/160/relationships/out;, data : { }, traverse : http://neo4j/db/data/node/160/traverse/{returnType};, all_typed_relationships : http://neo4j/db/data/node/160/relationships/all/{-list||types}, property : http://neo4j/db/data/node/160/properties/{key};, self : http://neo4j/db/data/node/160;, properties : http://neo4j/db/data/node/160/properties;, outgoing_typed_relationships : http://neo4j/db/data/node/160/relationships/out/{-list||types}, incoming_relationships : http://neo4j/db/data/node/160/relationships/in , extensions : { }, create_relationship : http://neo4j/db/data/node/160/relationships;, paged_traverse : http://neo4j/db/data/node/160/paged/traverse/{returnType}{?pageSize,leaseTime} , all_relationships : http://neo4j/db/data/node/160/relationships/all , incoming_typed_relationships : http://neo4j/db/data/node/160/relationships/in/{-list||types} Is there a config on the neo4j server that I can set to make it either return the lb URI https://10.0.0.1; as the base uri or return relative path in the result? ___ 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] REST API Base URI
Limiting access to certain URIs or IPs is great, but ideally at this moment I also need something like a key-based authentication so I can send a private key in the headers from my restclient and neo4j would authenticate and only take authenticated requests. Does the authentication extension support key-based authentication? If not, what forms of authentication does it currently support (user/password, token-based, shared-secret)? Thanks, Nuo On Wed, Sep 21, 2011 at 11:24 AM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nuo, Thomas Baum has been working on an authentication extension for Neo4j Server, see https://github.com/neo4j/authentication-extension. He could help you set it up and test it - it's used in hosting scenarios and should do what you want in terms of limiting access to certain URIs if that is what you want? 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 - Your high performance graph database. http://startupbootcamp.org/- Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Wed, Sep 21, 2011 at 6:14 PM, Nuo Yan yan@gmail.com wrote: For my scenario, I currently only use the LB for request authentication, so that not everyone on the network can access the neo4j server. In my use case, I think making the base uri configurable (including the protocol, e.g. https://foobar.com/) is enough. There are a couple other approaches that may also solve my problem. For example, having a configurable option to make the REST APIs return only relative paths in the result. Or, if neo4j could have a built-in request authentication mechanism for the REST interface, I may be able to get rid of the lb completely. On Wed, Sep 21, 2011 at 7:04 AM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nuo, right now the server is discovering its own IP upon startup. However, it sounds reasonable to return configurable base URL. I am just wondering if that really is enough to support a LB scenario? Do you need more stuff there? 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 - Your high performance graph database. http://startupbootcamp.org/- Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Tue, Sep 20, 2011 at 6:57 PM, Nuo Yan yan@gmail.com wrote: I access my neo4j server through the REST API. For security purpose, I put the neo4j server behind a nginx lb. I'm wondering if there is config entry somewhere that I can set the neo4j server to return a customized base uri that I can set to my LB's uri. For example, currently creating a node by POSTing to the lb (say https://10.0.0.1/db/data) returns { outgoing_relationships : http://neo4j/db/data/node/160/relationships/out;, data : { }, traverse : http://neo4j/db/data/node/160/traverse/{returnType};, all_typed_relationships : http://neo4j/db/data/node/160/relationships/all/{-list||types}, property : http://neo4j/db/data/node/160/properties/{key};, self : http://neo4j/db/data/node/160;, properties : http://neo4j/db/data/node/160/properties;, outgoing_typed_relationships : http://neo4j/db/data/node/160/relationships/out/{-list||types}, incoming_relationships : http://neo4j/db/data/node/160/relationships/in , extensions : { }, create_relationship : http://neo4j/db/data/node/160/relationships , paged_traverse : http://neo4j/db/data/node/160/paged/traverse/{returnType}{?pageSize,leaseTime} , all_relationships : http://neo4j/db/data/node/160/relationships/all , incoming_typed_relationships : http://neo4j/db/data/node/160/relationships/in/{-list||types} Is there a config on the neo4j server that I can set to make it either return the lb URI https://10.0.0.1; as the base uri or return relative path in the result? ___ 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
[Neo4j] REST API Base URI
I access my neo4j server through the REST API. For security purpose, I put the neo4j server behind a nginx lb. I'm wondering if there is config entry somewhere that I can set the neo4j server to return a customized base uri that I can set to my LB's uri. For example, currently creating a node by POSTing to the lb (say https://10.0.0.1/db/data) returns { outgoing_relationships : http://neo4j/db/data/node/160/relationships/out;, data : { }, traverse : http://neo4j/db/data/node/160/traverse/{returnType};, all_typed_relationships : http://neo4j/db/data/node/160/relationships/all/{-list||types}, property : http://neo4j/db/data/node/160/properties/{key};, self : http://neo4j/db/data/node/160;, properties : http://neo4j/db/data/node/160/properties;, outgoing_typed_relationships : http://neo4j/db/data/node/160/relationships/out/{-list||types}, incoming_relationships : http://neo4j/db/data/node/160/relationships/in , extensions : { }, create_relationship : http://neo4j/db/data/node/160/relationships;, paged_traverse : http://neo4j/db/data/node/160/paged/traverse/{returnType}{?pageSize,leaseTime} , all_relationships : http://neo4j/db/data/node/160/relationships/all;, incoming_typed_relationships : http://neo4j/db/data/node/160/relationships/in/{-list||types} Is there a config on the neo4j server that I can set to make it either return the lb URI https://10.0.0.1; as the base uri or return relative path in the result? ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Server couldn't start after java.lang.OutOfMemoryError
Hey Adriano and everyone, I finally got a chance to monitor/profile the neo4j process with VisualVM when I run my set of tests. It seems that after running the set of tests once, ~ 50M of PermGen was used. However, subsequent test runs simply multiples that, which worries me a little. After the fourth run of the tests, ~ 200M of PermGen space was used. My app accesses to neo4j completely using the REST interface. During the test run, new nodes and relationships are being frequently created. There are batch requests that performs multiple actions at once (number of actions is reasonable, really small in this case, usually a few, or tenth). There are also gremlin script executions through REST (send the gremlin query over to the server through REST API). Most of the gremlin queries are traversals and returns the vertices or edges match the constraints. Total number of nodes created during a test run is only hundreds. There are more relationships, but at most thousands. That's basically all of the things that are done against neo4j server during a test run. Given this, do you think the PermGen usage is reasonable? Or do you think something is very wrong? I worried that setting a larger PermGen would only postpone but not resolve the OutOfMemory problem. Let me know if any other info is needed. Thanks much, Nuo On Aug 29, 2011, at 6:09 AM, Adriano Henrique de Almeida wrote: Hi Nuo, any results here? Cheers 2011/8/26 Nuo Yan yan@gmail.com Hey Adriano, Thanks very much for your reply. I will try with MaxPermSize. It's on my local machine, we are evaluating Neo4j and do not have it on production yet. I'm accessing the server through the REST APIs, the app is separate from Neo. I will see if I can do some profiling on Neo when I run my tests. Thanks, Nuo On Fri, Aug 26, 2011 at 3:53 PM, Adriano Henrique de Almeida adrianoalmei...@gmail.com wrote: Hey Nuo, wrapper.java.maxmemory and Xmx won't help, since it is a PermGenSpace problem, and they only deal with HeapSpace. Did you try with: -XX:*MaxPermSize **?* Anyway, something very wrong is happening, since you have few nodes. It is happening only on production, or development also? If it is happening on development, try to isolate the situation where you're stucking the permgen. Run you app with VisualVM, for instance, or any other profiler. Aren't you dealing with classloaders on your app? Cheers Adriano Almeida 2011/8/26 Jim Webber j...@neotechnology.com Hi Nuo, if you're using Neo4j server then you can edit the value in conf/neo-wrapper.conf wrapper.java.maxmemory=1024 Jim ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Adriano Almeida Caelum | Ensino e Inovação www.caelum.com.br ___ 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 -- Adriano Almeida Caelum | Ensino e Inovação www.caelum.com.br ___ 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] Server couldn't start after java.lang.OutOfMemoryError
According to this: http://neo4j.org/forums/#nabble-td3248377, I upgraded to 1.4.1 and the problem goes away. I guess there must be a bug in the 1.4.0 REST API that leaks classloader memory or so, and GC didn't happen as expected in PermGen. Anyways, it looks great after upgrading to 1.4.1. Memory monitoring graph shows GC happens as desired in PermGen. Thank you! On Sep 6, 2011, at 11:30 PM, Nuo Yan wrote: Hey Adriano and everyone, I finally got a chance to monitor/profile the neo4j process with VisualVM when I run my set of tests. It seems that after running the set of tests once, ~ 50M of PermGen was used. However, subsequent test runs simply multiples that, which worries me a little. After the fourth run of the tests, ~ 200M of PermGen space was used. My app accesses to neo4j completely using the REST interface. During the test run, new nodes and relationships are being frequently created. There are batch requests that performs multiple actions at once (number of actions is reasonable, really small in this case, usually a few, or tenth). There are also gremlin script executions through REST (send the gremlin query over to the server through REST API). Most of the gremlin queries are traversals and returns the vertices or edges match the constraints. Total number of nodes created during a test run is only hundreds. There are more relationships, but at most thousands. That's basically all of the things that are done against neo4j server during a test run. Given this, do you think the PermGen usage is reasonable? Or do you think something is very wrong? I worried that setting a larger PermGen would only postpone but not resolve the OutOfMemory problem. Let me know if any other info is needed. Thanks much, Nuo On Aug 29, 2011, at 6:09 AM, Adriano Henrique de Almeida wrote: Hi Nuo, any results here? Cheers 2011/8/26 Nuo Yan yan@gmail.com Hey Adriano, Thanks very much for your reply. I will try with MaxPermSize. It's on my local machine, we are evaluating Neo4j and do not have it on production yet. I'm accessing the server through the REST APIs, the app is separate from Neo. I will see if I can do some profiling on Neo when I run my tests. Thanks, Nuo On Fri, Aug 26, 2011 at 3:53 PM, Adriano Henrique de Almeida adrianoalmei...@gmail.com wrote: Hey Nuo, wrapper.java.maxmemory and Xmx won't help, since it is a PermGenSpace problem, and they only deal with HeapSpace. Did you try with: -XX:*MaxPermSize **?* Anyway, something very wrong is happening, since you have few nodes. It is happening only on production, or development also? If it is happening on development, try to isolate the situation where you're stucking the permgen. Run you app with VisualVM, for instance, or any other profiler. Aren't you dealing with classloaders on your app? Cheers Adriano Almeida 2011/8/26 Jim Webber j...@neotechnology.com Hi Nuo, if you're using Neo4j server then you can edit the value in conf/neo-wrapper.conf wrapper.java.maxmemory=1024 Jim ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Adriano Almeida Caelum | Ensino e Inovação www.caelum.com.br ___ 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 -- Adriano Almeida Caelum | Ensino e Inovação www.caelum.com.br ___ 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] Index entry removal after relationship deletion
Hey guys, When a relationship gets deleted, will it be removed from the index automatically? My test shows yes, but I want to be absolutely certain. For example, a relationship :foo exists between node A and B and it's indexed on the foo_rels index with key node_a's id and value node_b's id. When I delete this relationship, do I also have to manually remove it from the index (i.e. a DELETE to /index/relationship/foo_rels/15/23/100 where 15 is the key, 23 is the value, 100 is the relationship id)? ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Index entry removal after relationship deletion
Thanks. That was what I imagined too. However, I have a test that does: 1. create two nodes (e.g. node 2 and node 3) 2. create a relationship between the two nodes (e.g. rel id 23, type :foo) 3. add the relationship to the foo_rels index, with 2 as the key, 3 as the value (the node ids) on rel id 23. (In REST it's a POST to /index/relationship/foo_rels/2/3 with the URI of the relationship 23 as the body) 4. look up the relationship from the index, returned expected result (GET to /index/relationship/foo_rels/2/3). 5. delete the relationship (id 23) (a DELETE to /relationship/23) 6. look up the relationship from the index again (GET to /index/relationship/foo_rels/2/3), returned empty results ([]). The result of the test confused me. It appears that the relationship was also removed from the index (as step 6 returned empty array) when it was deleted. Any insights? On Sep 6, 2011, at 7:05 PM, Linan Wang wrote: as far as i know, no. you need to do it yourself. hint: http://docs.neo4j.org/chunked/1.4.1/indexing-update.html On Wed, Sep 7, 2011 at 1:25 AM, Nuo Yan yan@gmail.com wrote: Hey guys, When a relationship gets deleted, will it be removed from the index automatically? My test shows yes, but I want to be absolutely certain. For example, a relationship :foo exists between node A and B and it's indexed on the foo_rels index with key node_a's id and value node_b's id. When I delete this relationship, do I also have to manually remove it from the index (i.e. a DELETE to /index/relationship/foo_rels/15/23/100 where 15 is the key, 23 is the value, 100 is the relationship id)? ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Best regards Linan Wang ___ 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] Update/Move relationships through REST APIs
I want to update the ending node for all relationships that are type :foo coming into node A to node B. For example, for all relationships that are type :foo coming into node A (node A as the end node), no matter where their starting node is, I want them to set the end node to node B. Node C --:foo-- Node A Node D --:foo-- Node A Node E --:bar-- Node A would become: Node C --:foo-- Node B Node D --:foo - Node B Node E --:bar-- Node A On Wed, Aug 31, 2011 at 5:00 PM, Marko Rodriguez okramma...@gmail.comwrote: Hi, If you tell me in English what you want to do, I can give you the Gremlin query. With Gremlin, you can traverse and update in a single query so perhaps it will meet your needs. Marko. http://markorodriguez.com On Aug 31, 2011, at 5:13 PM, Nuo Yan wrote: I looked through the REST APIs and didn't see an endpoint to move relationships. Is such operation possible? For example, given a set of relationships all end in one node, I want to send a bulk request to update their end nodes to another node. If there is no REST API for updating/moving relationship, what is the best way to do this? Can gremlin do it easily? Or do I have to delete all of the relationships and create new ones to the new end node? Thanks, Nuo ___ 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] Update/Move relationships through REST APIs
Thanks! On Wed, Aug 31, 2011 at 6:50 PM, Marko Rodriguez okramma...@gmail.comwrote: Hey, One more thing. WARNING: If your transaction mode is AUTOMATIC, then there will be one transaction for each mutation !! tx.begin/tx.commit/tx.finish gremlin g.transactionMode ==AUTOMATIC You can use a transaction manager if you plan this query to iterate over lots of vertices and do lots of mutations: https://github.com/tinkerpop/blueprints/wiki/Graph-Transactions-Helpers Thus, your mutating traversal would be: manager = TransactionalGraphHelper.createCommitManager(g, 1000); g.V.outE('foo').sideEffect{g.addEdge(it.outVertex,g.v('B'),'foo'); g.removeEdge(it); manager.incrCounter()} manager.close(); Hope that helps -- and doesn't confuse :). Marko. http://markorodriguez.com P.S. Gremlin 1.3 will make it much more natural to do batch transactions. TransactionGraphs (like Neo4j) will have a setTransactionBuffer(int bufferSize) method so you don't need to create this CommitManager object. Anywho. Thats that. See ya. On Aug 31, 2011, at 7:38 PM, Marko Rodriguez wrote: Hi, I did you example over TinkerGraph as vertex IDs are Strings and thus, easy to build your graph with. ~$ gremlin \,,,/ (o o) -oOOo-(_)-oOOo- gremlin g = new TinkerGraph() ==tinkergraph[vertices:0 edges:0] gremlin g.addVertex('A'); g.addVertex('B'); g.addVertex('C'); g.addVertex('D'); g.addVertex('E'); ==v[E] gremlin g.addEdge(g.v('C'),g.v('A'),'foo'); g.addEdge(g.v('D'),g.v('A'),'foo'); g.addEdge(g.v('E'),g.v('A'),'bar') ==e[2][E-bar-A] gremlin g.V ==v[D] ==v[E] ==v[A] ==v[B] ==v[C] gremlin g.E ==e[2][E-bar-A] ==e[1][D-foo-A] ==e[0][C-foo-A] So, you have your 5 vertices and 3 edges. Next, here is your mutating traversal: gremlin g.V.outE('foo').sideEffect{g.addEdge(it.outVertex,g.v('B'),'foo'); g.removeEdge(it)} ==e[1][D-foo-A] ==e[0][C-foo-A] And now your edges are as you wanted them. gremlin g.E ==e[3][D-foo-B] ==e[2][E-bar-A] ==e[4][C-foo-B] So again, your traversal is: g.V.outE('foo').sideEffect{g.addEdge(it.outVertex,g.v('B'),'foo'); g.removeEdge(it)} Here is what the traversal says step-by-step: g.V : iterate through all vertices outE('foo') : iterate through their the outgoing 'foo' labeled edges sideEffect{} : yield a sideEffect (mutate state) g.addEdge(it.outVertex,g.v('B'),'foo'): add a new edge from the vertex (e.g. C,D,E -- it.outVertex) to vertex B with label 'foo'. g.removeEdge(it) : remove the current edge (it) Note that its more optimal to do: v = g.v('B'); g.V.outE('foo').sideEffect{g.addEdge(it.outVertex,v,'foo'); g.removeEdge(it)} Also, vertex IDs are not Strings in Neo4j, but longs. Hopefully you can do what you need from here. Good luck, Marko. http://markorodriguez.com On Aug 31, 2011, at 6:17 PM, Nuo Yan wrote: I want to update the ending node for all relationships that are type :foo coming into node A to node B. For example, for all relationships that are type :foo coming into node A (node A as the end node), no matter where their starting node is, I want them to set the end node to node B. Node C --:foo-- Node A Node D --:foo-- Node A Node E --:bar-- Node A would become: Node C --:foo-- Node B Node D --:foo - Node B Node E --:bar-- Node A On Wed, Aug 31, 2011 at 5:00 PM, Marko Rodriguez okramma...@gmail.com wrote: Hi, If you tell me in English what you want to do, I can give you the Gremlin query. With Gremlin, you can traverse and update in a single query so perhaps it will meet your needs. Marko. http://markorodriguez.com On Aug 31, 2011, at 5:13 PM, Nuo Yan wrote: I looked through the REST APIs and didn't see an endpoint to move relationships. Is such operation possible? For example, given a set of relationships all end in one node, I want to send a bulk request to update their end nodes to another node. If there is no REST API for updating/moving relationship, what is the best way to do this? Can gremlin do it easily? Or do I have to delete all of the relationships and create new ones to the new end node? Thanks, Nuo ___ 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 ___ Neo4j mailing list User
Re: [Neo4j] Server couldn't start after java.lang.OutOfMemoryError
Hey Adriano, Thanks so much for following up. I haven't had chance to profile the neo4j server yet due to other tasks on hand and meetings. I will find some time to do it this week and let you know. I did set -XX:MaxPermSize to 1024M though, and haven't got OutOfMemory yet after it. Thanks, Nuo On Mon, Aug 29, 2011 at 6:09 AM, Adriano Henrique de Almeida adrianoalmei...@gmail.com wrote: Hi Nuo, any results here? Cheers 2011/8/26 Nuo Yan yan@gmail.com Hey Adriano, Thanks very much for your reply. I will try with MaxPermSize. It's on my local machine, we are evaluating Neo4j and do not have it on production yet. I'm accessing the server through the REST APIs, the app is separate from Neo. I will see if I can do some profiling on Neo when I run my tests. Thanks, Nuo On Fri, Aug 26, 2011 at 3:53 PM, Adriano Henrique de Almeida adrianoalmei...@gmail.com wrote: Hey Nuo, wrapper.java.maxmemory and Xmx won't help, since it is a PermGenSpace problem, and they only deal with HeapSpace. Did you try with: -XX:*MaxPermSize **?* Anyway, something very wrong is happening, since you have few nodes. It is happening only on production, or development also? If it is happening on development, try to isolate the situation where you're stucking the permgen. Run you app with VisualVM, for instance, or any other profiler. Aren't you dealing with classloaders on your app? Cheers Adriano Almeida 2011/8/26 Jim Webber j...@neotechnology.com Hi Nuo, if you're using Neo4j server then you can edit the value in conf/neo-wrapper.conf wrapper.java.maxmemory=1024 Jim ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Adriano Almeida Caelum | Ensino e Inovação www.caelum.com.br ___ 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 -- Adriano Almeida Caelum | Ensino e Inovação www.caelum.com.br ___ 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] Server couldn't start after java.lang.OutOfMemoryError
I later changed -Xmx to 1024m in the neo4j start script (./bin/neo4j line 109): JAVA_OPTS=-server ${wrapper_java_additional} -Xmx1024m I only have a few thousands nodes so I thought 1G should be enough (when my tests run, new nodes are being created frequently, but total number of nodes is certainly below 10k when it went out of memory). Increasing memory this way didn't help. Did I do it right? On Fri, Aug 26, 2011 at 2:18 AM, Mattias Persson matt...@neotechnology.comwrote: Tried with more memory? 2011/8/26 Nuo Yan yan@gmail.com Hey Jim, It happened again and I'm pretty sure there was no other server process running. Also this time when it crashed I saw this line in the console log (not seeing this previously): Could not load hsdis-.jnilib; library not loadable; PrintAssembly is disabled When I tried to restart, data/graph.db/message.log shows a lot of lines like the following and fail with the error message in my last email: Thu Aug 25 15:18:15 PDT 2011: Injected one phase commit, txId=11611 Thu Aug 25 15:18:15 PDT 2011: Injected one phase commit, txId=11612 Thu Aug 25 15:18:15 PDT 2011: Injected one phase commit, txId=11613 On Tue, Aug 23, 2011 at 6:23 PM, Jim Webber j...@neotechnology.com wrote: Hi Nuo, process [26266]... waiting for server to be ready. BAD. another server-process is running with [] Just to check before we dig deeper, are you certain you don't have another server process running? Jim ___ 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 -- 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 ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Server couldn't start after java.lang.OutOfMemoryError
Hey Adriano, Thanks very much for your reply. I will try with MaxPermSize. It's on my local machine, we are evaluating Neo4j and do not have it on production yet. I'm accessing the server through the REST APIs, the app is separate from Neo. I will see if I can do some profiling on Neo when I run my tests. Thanks, Nuo On Fri, Aug 26, 2011 at 3:53 PM, Adriano Henrique de Almeida adrianoalmei...@gmail.com wrote: Hey Nuo, wrapper.java.maxmemory and Xmx won't help, since it is a PermGenSpace problem, and they only deal with HeapSpace. Did you try with: -XX:*MaxPermSize **?* Anyway, something very wrong is happening, since you have few nodes. It is happening only on production, or development also? If it is happening on development, try to isolate the situation where you're stucking the permgen. Run you app with VisualVM, for instance, or any other profiler. Aren't you dealing with classloaders on your app? Cheers Adriano Almeida 2011/8/26 Jim Webber j...@neotechnology.com Hi Nuo, if you're using Neo4j server then you can edit the value in conf/neo-wrapper.conf wrapper.java.maxmemory=1024 Jim ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Adriano Almeida Caelum | Ensino e Inovação www.caelum.com.br ___ 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] Server couldn't start after java.lang.OutOfMemoryError
Hey Jim, It happened again and I'm pretty sure there was no other server process running. Also this time when it crashed I saw this line in the console log (not seeing this previously): Could not load hsdis-.jnilib; library not loadable; PrintAssembly is disabled When I tried to restart, data/graph.db/message.log shows a lot of lines like the following and fail with the error message in my last email: Thu Aug 25 15:18:15 PDT 2011: Injected one phase commit, txId=11611 Thu Aug 25 15:18:15 PDT 2011: Injected one phase commit, txId=11612 Thu Aug 25 15:18:15 PDT 2011: Injected one phase commit, txId=11613 On Tue, Aug 23, 2011 at 6:23 PM, Jim Webber j...@neotechnology.com wrote: Hi Nuo, process [26266]... waiting for server to be ready. BAD. another server-process is running with [] Just to check before we dig deeper, are you certain you don't have another server process running? Jim ___ 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] Server couldn't start after java.lang.OutOfMemoryError
Sent through direct mail. Also one thing I forgot to mention was that for a few occasions that the server was able to start after a few tries after the error; other times I tried enough times and since it's my dev machine so I decided to clear/move the database and restart (which has always led to success). On Tue, Aug 23, 2011 at 10:29 PM, Mattias Persson matt...@neotechnology.com wrote: It would also be very useful if you could send data/db/messages.log (to me directly since the mailing list doesn't like attachments) after such an error. thanks, Mattias Den onsdagen den 24:e augusti 2011 skrev Nuo Yanyan@gmail.com: I don't think another process was running but I'm not 100% certain (didn't check other than doing ./bin/neo4j status which shows not running). When it happens again I will check further and let you know. Thanks! Nuo On Tue, Aug 23, 2011 at 6:23 PM, Jim Webber j...@neotechnology.com wrote: Hi Nuo, process [26266]... waiting for server to be ready. BAD. another server-process is running with [] Just to check before we dig deeper, are you certain you don't have another server process running? Jim ___ 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 -- 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 ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Server couldn't start after java.lang.OutOfMemoryError
The neo4j server refuses to start after getting a Java OutOfMemory Error. I was trying to start the server using the ./bin/neo4j start command. Starting neo4j-service...WARNING: not changing user process [26266]... waiting for server to be ready. BAD. another server-process is running with [] Console log: Exception in thread Statistics Gatherer java.lang.OutOfMemoryError: PermGen space at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) at java.lang.Class.getMethod0(Class.java:2670) at java.lang.Class.getMethod(Class.java:1603) at org.neo4j.helpers.Service.java6Loader(Service.java:330) at org.neo4j.helpers.Service.load(Service.java:191) at org.neo4j.helpers.Service.load(Service.java:207) at org.neo4j.kernel.EmbeddedGraphDbImpl.getManagementBean(EmbeddedGraphDbImpl.java:221) at org.neo4j.kernel.EmbeddedGraphDatabase.getManagementBean(EmbeddedGraphDatabase.java:156) at org.neo4j.server.rrd.DatabasePrimitivesSampleableBase.getObjectName(DatabasePrimitivesSampleableBase.java:86) at org.neo4j.server.rrd.DatabasePrimitivesSampleableBase.getValue(DatabasePrimitivesSampleableBase.java:53) at org.neo4j.server.rrd.RrdSampler.updateSample(RrdSampler.java:62) at org.neo4j.server.rrd.RrdJob.run(RrdJob.java:41) at org.neo4j.server.rrd.ScheduledJob$1.run(ScheduledJob.java:47) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) neo4j log: Aug 23, 2011 4:23:11 PM org.neo4j.server.logging.Logger log INFO: Starting Neo Server on port [7474] with [80] threads available Aug 23, 2011 4:23:11 PM org.mortbay.log.Slf4jLog info INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog Aug 23, 2011 4:23:11 PM org.neo4j.server.logging.Logger log INFO: Using database at /Users/nuo/5star/neo4j-community-1.4/data/graph.db Aug 23, 2011 4:23:11 PM org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog doInternalRecovery INFO: Non clean shutdown detected on log [/Users/nuo/5star/neo4j-community-1.4/data/graph.db/nioneo_logical.log.1]. Recovery started ... Aug 23, 2011 4:23:13 PM org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog doInternalRecovery INFO: Non clean shutdown detected on log [/Users/nuo/5star/neo4j-community-1.4/data/graph.db/index/lucene.log.1]. Recovery started ... Does anybody have any insights on what's happening? Is the recovery not finishing up and timing out or something else is happening? It starts fine if I clear the data (graph.db). In addition, I've modified line 109 of the ./bin/lib/neo4j script to JAVA_OPTS=-server ${wrapper_java_additional} -Xmx512m (basically adding -Xmx512m) and also updated the conf/neo4j.properties file to set mapped_memory for nodes and relationships to be 100M; but I was still seeing the out of memory exception. Did I do it right to increase the memory allocation to neo? Thanks, Nuo Yan ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Server couldn't start after java.lang.OutOfMemoryError
I don't think another process was running but I'm not 100% certain (didn't check other than doing ./bin/neo4j status which shows not running). When it happens again I will check further and let you know. Thanks! Nuo On Tue, Aug 23, 2011 at 6:23 PM, Jim Webber j...@neotechnology.com wrote: Hi Nuo, process [26266]... waiting for server to be ready. BAD. another server-process is running with [] Just to check before we dig deeper, are you certain you don't have another server process running? Jim ___ 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] Filter traversal result by relationship type (REST API)
I wanted to traverse the graph from my origin node, and get all nodes in the next level only (max depth == 1) such that they have foo relationship type with the origin node but not bar relationship type. I set my return filter to be: { language : javascript, body : position.length() 0 position.lastRelationship().getType() != 'bar' } And the body of the request is: { order : breadth first, relationships : [{direction : all, type : foo}], uniqueness : node_global, prune_evaluator : {language:builtin, name : none}, max_depth : 1, return_filter : return_filter (see above) } However, it still gets all nodes with foo relationship, even those with bar relationship. Where did I do wrong? What's the right way to exclude nodes connected with certain relationship type(s) when traversing the graph? Thanks! Nuo ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Transactions using the REST API?
I've skimmed through the online resources and it appears that there's no documentations/articles mentioning how to get transactions support with the REST API. I found an earlier mailing list message asking about this but didn't see an answer. Is it actually possible to do multiple operations in a transaction (for example, create node, add to index, and create relationship) through the REST API? Or do I have to use the embedded db approach? Thanks, Nuo ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Transactions using the REST API?
Thanks to both of you Michael and Jim! That's exactly what I needed. Best, Nuo On Mon, Aug 8, 2011 at 4:43 PM, Jim Webber j...@neotechnology.com wrote: Hi Nuo, In the REST API every interaction is automatically executed within a transaction on the server side. If you need to complete multiple operations within the scope of a transaction you have a few options: 1. REST batch API: http://docs.neo4j.org/chunked/snapshot/rest-api-batch-ops.html 2. Unmanaged extension (JAX-RS): http://docs.neo4j.org/chunked/snapshot/server-unmanaged-extensions.html 3. Server plugins: http://docs.neo4j.org/chunked/snapshot/server-plugins.html With 1 you POST commands over to the server and the batch API executes them against the GraphDatabaseService on your behalf (and rolls back the transaction and gives you feedback if anything goes wrong). With 2 3 you write server-side Java code which interacts with the GraphDatabaseService hosted by the Neo4j server. Jim ___ 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