[Neo4j] what is the neo4j-spatial website?
Hi, I can not find the neo4j-spatial database download page. Only I can download neo4j-enterprise-1.4.2. Who can tell me the website of neo4j-spatial database? zhao ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j performance with 400million nodes
Hi anders, appreciate your offer very much! It is good to know that the neo4j community is very active and involved. http://neo4j-community-discussions.438527.n3.nabble.com/file/n3472966/BatchImportData.groovy BatchImportData.groovy Here is the import script. it is a stripped version of the graph I used for testing. If you need more data, just increase the variable 'amountTypeA' at line 26. -- alican -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-performance-with-400million-nodes-tp3467806p3472966.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] what is the neo4j-spatial website?
Thank you very much 2011/11/2 Peter Neubauer peter.neuba...@neotechnology.com Zhao, Neo4j Spatial is an add-on to the Neo4j ecosystem. We are in the process fo getting the docs in order, until then, the best is to look at https://github.com/neo4j/spatial . Also, I am attaching the current state of the docs, hope to publish it during the next weeks on a approriate place. Anything special you want to know? 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 Tue, Nov 1, 2011 at 11:05 PM, chen zhao dreamthinkin...@gmail.com wrote: Hi, I can not find the neo4j-spatial database download page. Only I can download neo4j-enterprise-1.4.2. Who can tell me the website of neo4j-spatial database? zhao ___ 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] what is the neo4j-spatial website?
Now I have download neo4j-spatial-be288f2,I want to import a shapfile file into the neo4j-spatial database. How can I start the neo4j-spatial db? Is the neo4j-spatial independent or dependent on neo4j-enterprise-1.4.2? I do not know the relationship between the two? Thank you. zhao 2011/11/2 chen zhao dreamthinkin...@gmail.com Thank you very much 2011/11/2 Peter Neubauer peter.neuba...@neotechnology.com Zhao, Neo4j Spatial is an add-on to the Neo4j ecosystem. We are in the process fo getting the docs in order, until then, the best is to look at https://github.com/neo4j/spatial . Also, I am attaching the current state of the docs, hope to publish it during the next weeks on a approriate place. Anything special you want to know? 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 Tue, Nov 1, 2011 at 11:05 PM, chen zhao dreamthinkin...@gmail.com wrote: Hi, I can not find the neo4j-spatial database download page. Only I can download neo4j-enterprise-1.4.2. Who can tell me the website of neo4j-spatial database? zhao ___ 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] Node Id generation deadlock
(Sorry for re-opening this thread, I hadn't yet subscribed to the mailing list when I opened it the previous time, so I had to re-start it..) Hi, I'm using Neo4J version 1.4.1. I've tried following the design guide ( http://wiki.neo4j.org/content/Design_Guide#Make_use_of_Factories ) writing a short program, but when I try to run it, it goes into a deadlock and the application freezes. Basically what my program does is to create a new embedded graph database, initalize a factory node, then it creates two threads where each of them is tasked with creating two nodes, giving them an ID (according to the pattern shown in the design guide), and that's about it. Once I run it, one thread end up on WAIT state, while the other is on MONITOR. Showing the threads dump, I can see that the MONITOR-state thread is waiting for the other thread to release the ID generation method's lock (_lock), and the WAIT-state thread is waiting inside Neo4J's RWLock class, trying to acquire a write lock, but for some reason it's waiting (line 326). It got there from a call in the ID generation method which tries to update the factory node's ID sequence property, as shown in the design guide. I'm appending the code here. I'm aware that this program misses some things (such as shutting down the DB once i'm done, adding the relationship between factory node and created node, and for the createNode() method to actually return a node) - i've left out everything I could to have the least amount of code which makes this problem occur. The code: public class MultiThreadingBasicTest { private final GraphDatabaseService _graphDB; private final Object _lock; private final Node _factoryNode; public static void main(String[] args) { MultiThreadingBasicTest test = new MultiThreadingBasicTest(); test.run(); } public MultiThreadingBasicTest() { _graphDB = new EmbeddedGraphDatabase(/MTBT-graphDB); _lock = new Object(); _factoryNode = createFactoryNode(); } public void run() { Thread[] threads = new Thread[2]; for (int i=0; i threads.length; i++) { threads[i] = new Thread(new Runnable() { @Override public void run() { Transaction tx = _graphDB.beginTx(); try { for (int i=0; i 2; i++) { createNode(); System.out.println(echo from thread + Thread.currentThread().getName()); } tx.success(); } finally { tx.finish(); } } }); } System.out.println(running the threads now); for (Thread thread : threads) { thread.start(); } } private Node createFactoryNode() { Node factoryNode = null; Transaction tx = _graphDB.beginTx(); try { factoryNode = _graphDB.createNode(); tx.success(); } finally { tx.finish(); } return factoryNode; } private void createNode() { long id = generateId(); //Node node = _graphDB.createNode(); // //node.setProperty(idseq, id); } private long generateId() { synchronized (_lock) { Long id; if (_factoryNode.hasProperty(idseq)) { id = (Long) _factoryNode.getProperty(idseq); } else { id = 1L; } _factoryNode.setProperty(idseq, id+1); return id; } } } (One last thing - I kept the line: System.out.println(echo from thread + Thread.currentThread().getName()); since if I remove it, the deadlock actually does not occur - at least not on my machine. However this is just a matter of race conditions, and if you use a higher number of threads / created-nodes-per-thread, then the problem will occur even without this line. I decided to keep it since I figured a case with two threads each creating two nodes is as simply as this can get). Thank you for your help, Ran. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Node-Id-generation-deadlock-tp3473118p3473118.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] DSL for Cypher - request for feedback!
Hi guys, I am in the process of creating a Java DSL for Cypher, and would like your feedback on different variants. You can find the code here: https://github.com/neo4j/cypher-dsl/ The Cypher reference manual has been implemented here: https://github.com/neo4j/cypher-dsl/blob/master/src/test/java/org/neo4j/cypherdsl/CypherReferenceTest.java That should provide reasonable amount of examples of usage. There are a couple of variants of implementation that I'd like your views on. The first question is whether to do this using mainly static methods, or using an object instantiation block trick. Here's what the static version would look like: CypherQuery.start( node( john, 0 )).returns( nodes(john) ) where node and nodes are static methods in StartExpression and ReturnExpression respectively. With full static imports it simply becomes: String q = start( node( john, 0 )).returns( nodes(john) ).toString() To avoid statics I've tried doing a version that uses object instantiation blocks instead, and then it looks like this: String q = new CypherQuery() {{ starts( node( john, 0 ) ).returns( nodes( john ) ); }}.toString(); In this case the starts method is a protected method in CypherQuery, and node and nodes are also protected methods in CypherQuery that returns expressions to be used in starts() and returns() respectively. Statics: Pro: Very compact syntax Con: need to do extensive static imports for it to be compact Instantiation block: Pro: No static imports Con: Slightly more verbose The second design decision has to do with path declarations. Here are the two options: 1) path(r).from(x).optional().out(KNOWS).to(y) vs 2) path(x,Direction.OUT, r,KNOWS, y) or path(x,y).direction(OUT).name(r).relationship(KNOWS) With multi-path scenarios it becomes: path(r).from(x).to(y).path(p).to(z) vs path(x,ANY,r,y).path(ANY, z).relationship(p) i.e. (x)-[r]-(y)-[p]-(z) 1): Pro: very explicit about what each parameter means Con: very explicit about what each parameter means 2) Pro: all-in-one-go (compact) Con: all-in-one-go (hard to know what each means) And that's about it I think! Please have a look at it, and if you have thoughts on the above, or any of the other design decisions, please let me know. regards, Rickard -- Rickard Öberg Developer Neo Technology Twitter: @rickardoberg, Skype: rickardoberg ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] REST traverse deprecation
On Tue, Nov 1, 2011 at 5:37 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, I think that Cypher is not yes taking into account Uniqueness, or is it Andres? Otherwise, most of the normal traversals are covered. To keep things consistent and give people a way of doing fine grained traversals, I would then suggest to document all the existing examples using Cypher or Groovy code, so we can document that things are working as expected and not loose functionality. Sounds like a really good idea. The JavaScript exposure then would totally go away from the REST API and possibly be factored out into a plugin like Groovy/Gremlin. Or dropped. I vote dropped :) WDYT? 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 Tue, Nov 1, 2011 at 9:31 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Tue, Nov 1, 2011 at 5:22 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nope, I mean a server side script execution (which we already are doing in http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html) to execute traversal API code on the server. Neo4js is a client driver. Remember that adding yet another way to talk to the server comes at a cost of confusion and spreading engineering focus thin. I don't think we should do this unless there is a good answer to the question: *Is there anything* *that this solves that is not solved by Cypher or Gremlin, and if so, why don't we expand Cypher or Gremlin to incorporate that use case instead? *Collecting our efforts in fewer buckets means that improvements will benefit everyone, not just the group that uses the Groovy endpoint, or the Traversal API, or the JS endpoint and so on. 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 Tue, Nov 1, 2011 at 9:19 AM, Andres Taylor andres.tay...@neotechnology.com wrote: You, something like Neo4js https://github.com/neo4j/neo4js? We've had that since forever. Or do you mean something different? Andrés On Tue, Nov 1, 2011 at 5:06 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Also, there is another possibility: We are exposing a ECMA script execution engine via the Traverse enpoints. Instead of trying to shoehorn the traversal API into REST calls and then anyway executing script snippets, Why not exposing a JavaScript plugin along exactly the same lines as the Groovy plugin, and provide examples on how to use the same usecases via that plugin, so we cover the traversal API that way? 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 Tue, Nov 1, 2011 at 9:00 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: It would be interesting to rephrase the question like this: Are there any use cases that the REST traversal API covers, that we currently cannot replicate in Cypher or Gremlin? On Sun, Oct 30, 2011 at 2:45 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, Andres has been putting the first algo into cypher and we are thinking of exposing them there so thru can be used as path functions in an expression. However, that will be step 2. WDYT? On Oct 29, 2011 6:47 PM, maxdemarzi maxdema...@gmail.com wrote: I think the traversal rest api is fine for my purposes, but if cypher is where we want to go long term, then we need to deprecate it in 1.6 and drop it in 1.7. This gives us some time to update our libraries and for cypher to settle down. Are you guys thinking of getting rid of the rest built in graph algorithms or are those there to stay? -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-REST-traverse-deprecation-tp3460396p3464979.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. ___ Neo4j mailing list
Re: [Neo4j] REST traverse deprecation
I vote not dropped, as there are lots of non-java developers out there which would want to use REST server dynamically. That was the reason why we wrote the ruby-script-extension support. Michael Am 02.11.2011 um 10:08 schrieb Jacob Hansson: On Tue, Nov 1, 2011 at 5:37 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, I think that Cypher is not yes taking into account Uniqueness, or is it Andres? Otherwise, most of the normal traversals are covered. To keep things consistent and give people a way of doing fine grained traversals, I would then suggest to document all the existing examples using Cypher or Groovy code, so we can document that things are working as expected and not loose functionality. Sounds like a really good idea. The JavaScript exposure then would totally go away from the REST API and possibly be factored out into a plugin like Groovy/Gremlin. Or dropped. I vote dropped :) WDYT? 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 Tue, Nov 1, 2011 at 9:31 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Tue, Nov 1, 2011 at 5:22 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nope, I mean a server side script execution (which we already are doing in http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html) to execute traversal API code on the server. Neo4js is a client driver. Remember that adding yet another way to talk to the server comes at a cost of confusion and spreading engineering focus thin. I don't think we should do this unless there is a good answer to the question: *Is there anything* *that this solves that is not solved by Cypher or Gremlin, and if so, why don't we expand Cypher or Gremlin to incorporate that use case instead? *Collecting our efforts in fewer buckets means that improvements will benefit everyone, not just the group that uses the Groovy endpoint, or the Traversal API, or the JS endpoint and so on. 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 Tue, Nov 1, 2011 at 9:19 AM, Andres Taylor andres.tay...@neotechnology.com wrote: You, something like Neo4js https://github.com/neo4j/neo4js? We've had that since forever. Or do you mean something different? Andrés On Tue, Nov 1, 2011 at 5:06 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Also, there is another possibility: We are exposing a ECMA script execution engine via the Traverse enpoints. Instead of trying to shoehorn the traversal API into REST calls and then anyway executing script snippets, Why not exposing a JavaScript plugin along exactly the same lines as the Groovy plugin, and provide examples on how to use the same usecases via that plugin, so we cover the traversal API that way? 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 Tue, Nov 1, 2011 at 9:00 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: It would be interesting to rephrase the question like this: Are there any use cases that the REST traversal API covers, that we currently cannot replicate in Cypher or Gremlin? On Sun, Oct 30, 2011 at 2:45 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, Andres has been putting the first algo into cypher and we are thinking of exposing them there so thru can be used as path functions in an expression. However, that will be step 2. WDYT? On Oct 29, 2011 6:47 PM, maxdemarzi maxdema...@gmail.com wrote: I think the traversal rest api is fine for my purposes, but if cypher is where we want to go long term, then we need to deprecate it in 1.6 and drop it in 1.7. This gives us some time to update our libraries and for cypher to settle down. Are you guys thinking of getting rid of the rest built in graph algorithms or are those there to stay? -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-REST-traverse-deprecation-tp3460396p3464979.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
Re: [Neo4j] REST traverse deprecation
On Wed, Nov 2, 2011 at 10:20 AM, Michael Hunger michael.hun...@neotechnology.com wrote: I vote not dropped, as there are lots of non-java developers out there which would want to use REST server dynamically. I am completely open to the notion that I am wrong here. But I want us to have answered the questions I was asking before properly, if we are going to embrace all these ways to talk to the server. What use cases does dynamic script execution cover that cypher or gremlin do not? Why should those use cases not be covered by cypher or gremlin? That was the reason why we wrote the ruby-script-extension support. Michael Am 02.11.2011 um 10:08 schrieb Jacob Hansson: On Tue, Nov 1, 2011 at 5:37 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, I think that Cypher is not yes taking into account Uniqueness, or is it Andres? Otherwise, most of the normal traversals are covered. To keep things consistent and give people a way of doing fine grained traversals, I would then suggest to document all the existing examples using Cypher or Groovy code, so we can document that things are working as expected and not loose functionality. Sounds like a really good idea. The JavaScript exposure then would totally go away from the REST API and possibly be factored out into a plugin like Groovy/Gremlin. Or dropped. I vote dropped :) WDYT? 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 Tue, Nov 1, 2011 at 9:31 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Tue, Nov 1, 2011 at 5:22 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nope, I mean a server side script execution (which we already are doing in http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html) to execute traversal API code on the server. Neo4js is a client driver. Remember that adding yet another way to talk to the server comes at a cost of confusion and spreading engineering focus thin. I don't think we should do this unless there is a good answer to the question: *Is there anything* *that this solves that is not solved by Cypher or Gremlin, and if so, why don't we expand Cypher or Gremlin to incorporate that use case instead? *Collecting our efforts in fewer buckets means that improvements will benefit everyone, not just the group that uses the Groovy endpoint, or the Traversal API, or the JS endpoint and so on. 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 Tue, Nov 1, 2011 at 9:19 AM, Andres Taylor andres.tay...@neotechnology.com wrote: You, something like Neo4js https://github.com/neo4j/neo4js? We've had that since forever. Or do you mean something different? Andrés On Tue, Nov 1, 2011 at 5:06 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Also, there is another possibility: We are exposing a ECMA script execution engine via the Traverse enpoints. Instead of trying to shoehorn the traversal API into REST calls and then anyway executing script snippets, Why not exposing a JavaScript plugin along exactly the same lines as the Groovy plugin, and provide examples on how to use the same usecases via that plugin, so we cover the traversal API that way? 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 Tue, Nov 1, 2011 at 9:00 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: It would be interesting to rephrase the question like this: Are there any use cases that the REST traversal API covers, that we currently cannot replicate in Cypher or Gremlin? On Sun, Oct 30, 2011 at 2:45 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, Andres has been putting the first algo into cypher and we are thinking of exposing them there so thru can be used as path functions in an expression. However, that will be step 2. WDYT? On Oct 29, 2011 6:47 PM, maxdemarzi maxdema...@gmail.com wrote: I think the traversal rest api is fine for my purposes, but if cypher is
[Neo4j] Cypher: including start in result
Hi, I have a very simply graph: UserGroup 2 -[:IS_MEMBER_OF]- UserGroup 1, User 3 UserGroup 1 -[:IS_MEMBER_OF]- User 1, User 2 I use the following cypher to find all nodes that are below UserGroup 2 (I start at node User 3 and go one level up in the tree which equals UserGroup 2): START principals=node:nodes(NAME='User 3') MATCH (principals)-[:IS_MEMBER_OF]-()-[:IS_MEMBER_OF*0..]-(n) RETURN n The result does not contain User 3 even though it is a child of UserGroup2 and connected to it via IS_MEMBER_OF relationship. Is there any way to also include it in the result? Thanks, - Didi ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Cypher: ommitting relationship if not available
Hi, I have a very simply graph: UserGroup 2 -[:IS_MEMBER_OF]- UserGroup 1, User 3 UserGroup 1 -[:IS_MEMBER_OF]- User 1, User 2 I want to find all nodes that are on the same level or on a level below the starting point. Using START principals=node:nodes(NAME='User 3') MATCH (principals)-[?:IS_MEMBER_OF]-()-[:IS_MEMBER_OF*0..]-(n) RETURN n I first go one level up and then determine all nodes below this level. However, it is not working if I change the start to START principals=node:nodes(NAME='UserGroup 2') (because there is no IS_MEMBER_OF relationship to go up). Is there a way to ommit this condition if it is not available? To make it somehow optional? Thanks, - Didi ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] REST traverse deprecation
custom use-cases like the ones implemented by our customers with plugins / extensions and in the case of the ruby script extensions a way I'd like to promote to talk to the server that is 1) create you own RESTful endpoints that are focused on a protocol speaking your domain and not nodes + rels 2) the protocol is use-case oriented 3) it only transmits the information necessary (not more). 4) The code of these endpoints would be transactionally executed Use-Cases with customers so far have been: * unique nodes with locking + index lookup * batch data insertion (also unique stuff see above) * custom traversals with complicated callbacks * aggregating multiple gremlin / cypher queries in the server and returning only a partial result-set/projection of those executions * With the ruby script extension what we've done there is to leverage the web/REST frameworks of the platform and allow rack-apps to expose their REST endpoints within the neo4j-server. Thomas and I also talked about a more generic way to allow any language supported by the javax.script extension to register endpoints with the neo4j-server. A generic javax.scripting languages plugin would accommodate for more ad-hoc execution mode for which writing an extension is too much ceremony. Michael Am 02.11.2011 um 10:54 schrieb Jacob Hansson: On Wed, Nov 2, 2011 at 10:20 AM, Michael Hunger michael.hun...@neotechnology.com wrote: I vote not dropped, as there are lots of non-java developers out there which would want to use REST server dynamically. I am completely open to the notion that I am wrong here. But I want us to have answered the questions I was asking before properly, if we are going to embrace all these ways to talk to the server. What use cases does dynamic script execution cover that cypher or gremlin do not? Why should those use cases not be covered by cypher or gremlin? That was the reason why we wrote the ruby-script-extension support. Michael Am 02.11.2011 um 10:08 schrieb Jacob Hansson: On Tue, Nov 1, 2011 at 5:37 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, I think that Cypher is not yes taking into account Uniqueness, or is it Andres? Otherwise, most of the normal traversals are covered. To keep things consistent and give people a way of doing fine grained traversals, I would then suggest to document all the existing examples using Cypher or Groovy code, so we can document that things are working as expected and not loose functionality. Sounds like a really good idea. The JavaScript exposure then would totally go away from the REST API and possibly be factored out into a plugin like Groovy/Gremlin. Or dropped. I vote dropped :) WDYT? 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 Tue, Nov 1, 2011 at 9:31 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Tue, Nov 1, 2011 at 5:22 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nope, I mean a server side script execution (which we already are doing in http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html) to execute traversal API code on the server. Neo4js is a client driver. Remember that adding yet another way to talk to the server comes at a cost of confusion and spreading engineering focus thin. I don't think we should do this unless there is a good answer to the question: *Is there anything* *that this solves that is not solved by Cypher or Gremlin, and if so, why don't we expand Cypher or Gremlin to incorporate that use case instead? *Collecting our efforts in fewer buckets means that improvements will benefit everyone, not just the group that uses the Groovy endpoint, or the Traversal API, or the JS endpoint and so on. 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 Tue, Nov 1, 2011 at 9:19 AM, Andres Taylor andres.tay...@neotechnology.com wrote: You, something like Neo4js https://github.com/neo4j/neo4js? We've had that since forever. Or do you mean something different? Andrés On Tue, Nov 1, 2011 at 5:06 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Also, there is another possibility: We are exposing a ECMA script execution engine via the Traverse enpoints. Instead of trying to shoehorn the traversal API into REST calls and then anyway executing script
Re: [Neo4j] Cypher: ommitting relationship if not available
I though that this is what I used with MATCH (principals)-[?:IS_MEMBER_OF]- When I turn it into MATCH (principals)-[?]-()-[:IS_MEMBER_OF*0..]-(n) RETURN n Nothing at all is returned Am 02.11.2011 11:05, schrieb Jacob Hansson: On Wed, Nov 2, 2011 at 11:01 AM, D. Frejdieter_f...@gmx.net wrote: Hi, I have a very simply graph: UserGroup 2-[:IS_MEMBER_OF]- UserGroup 1, User 3 UserGroup 1-[:IS_MEMBER_OF]- User 1, User 2 I want to find all nodes that are on the same level or on a level below the starting point. Using START principals=node:nodes(NAME='User 3') MATCH (principals)-[?:IS_MEMBER_OF]-()-[:IS_MEMBER_OF*0..]-(n) RETURN n I first go one level up and then determine all nodes below this level. However, it is not working if I change the start to START principals=node:nodes(NAME='UserGroup 2') (because there is no IS_MEMBER_OF relationship to go up). Is there a way to ommit this condition if it is not available? To make it somehow optional? You could use an optional relationship here. See: http://docs.neo4j.org/chunked/snapshot/query-match.html#match-optional-relationship Note that this is the snapshot version of the documentation, you will want to look at the documentation for the version of neo4j you are using to make sure that this syntax is supported. Thanks, - Didi ___ 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] Cypher: including start in result
Hi, in the pattern matching employed by cypher nodes already bound to an identifier won't be bound to another identifier. That is the reason why all nodes that already belong to principals don't appear in n. In your case it might be easiest to just return n,principals Cheers Michael Am 02.11.2011 um 10:56 schrieb D. Frej: Hi, I have a very simply graph: UserGroup 2 -[:IS_MEMBER_OF]- UserGroup 1, User 3 UserGroup 1 -[:IS_MEMBER_OF]- User 1, User 2 I use the following cypher to find all nodes that are below UserGroup 2 (I start at node User 3 and go one level up in the tree which equals UserGroup 2): START principals=node:nodes(NAME='User 3') MATCH (principals)-[:IS_MEMBER_OF]-()-[:IS_MEMBER_OF*0..]-(n) RETURN n The result does not contain User 3 even though it is a child of UserGroup2 and connected to it via IS_MEMBER_OF relationship. Is there any way to also include it in the result? Thanks, - Didi ___ 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] Cypher: ommitting relationship if not available
If I understand you correctly, then your start nodes (aka UserGroup 2) would be dangling as there is no relationship IS_MEMBER_OF starting from this group. so your start nodes are connected by an optional relationship, so everything also hanging on this optional relationship is also optional. What would you expect when starting with UserGroup 2 ? Probably it is mixing two use-cases ? First one starting from the leaf-nodes like users MATCH (principals)-[:IS_MEMBER_OF]-()-[:IS_MEMBER_OF*0..]-(n) and a second one starting from higher level nodes like groups. MATCH (principals)-[:IS_MEMBER_OF*0..]-(n) So that is a different place for the starting points in the match. Perhaps something like this could work: MATCH (principals)-[:IS_MEMBER_OF*0..1]-()-[:IS_MEMBER_OF*0..]-(n) But perhaps better when Peter chimes in later today as he spent a lot of time applying Cypher to ACL scenarios. Michael Am 02.11.2011 um 11:18 schrieb D. Frej: I though that this is what I used with MATCH (principals)-[?:IS_MEMBER_OF]- When I turn it into MATCH (principals)-[?]-()-[:IS_MEMBER_OF*0..]-(n) RETURN n Nothing at all is returned Am 02.11.2011 11:05, schrieb Jacob Hansson: On Wed, Nov 2, 2011 at 11:01 AM, D. Frejdieter_f...@gmx.net wrote: Hi, I have a very simply graph: UserGroup 2-[:IS_MEMBER_OF]- UserGroup 1, User 3 UserGroup 1-[:IS_MEMBER_OF]- User 1, User 2 I want to find all nodes that are on the same level or on a level below the starting point. Using START principals=node:nodes(NAME='User 3') MATCH (principals)-[?:IS_MEMBER_OF]-()-[:IS_MEMBER_OF*0..]-(n) RETURN n I first go one level up and then determine all nodes below this level. However, it is not working if I change the start to START principals=node:nodes(NAME='UserGroup 2') (because there is no IS_MEMBER_OF relationship to go up). Is there a way to ommit this condition if it is not available? To make it somehow optional? You could use an optional relationship here. See: http://docs.neo4j.org/chunked/snapshot/query-match.html#match-optional-relationship Note that this is the snapshot version of the documentation, you will want to look at the documentation for the version of neo4j you are using to make sure that this syntax is supported. Thanks, - Didi ___ 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] Cypher: ommitting relationship if not available
my use case is the following: - a principal in a group has access to all other principals in a group = therefore I need to go one level up to find the other principals in the group - additionally: if there is another group as principal in a group (UserGroup 1 is in UserGroup 2) , then the principal also has access to the principals of the sub-group (User 3 has access to User 1 and User 2 which are in sub-group UserGroup 1) = that is the second part in the MATCH clause Your idea looks like it is working: MATCH (principals)-[:IS_MEMBER_OF*0..1]- Thanks. Nevertheless, maybe Peter has another/better idea :-) Am 02.11.2011 11:34, schrieb Michael Hunger: If I understand you correctly, then your start nodes (aka UserGroup 2) would be dangling as there is no relationship IS_MEMBER_OF starting from this group. so your start nodes are connected by an optional relationship, so everything also hanging on this optional relationship is also optional. What would you expect when starting with UserGroup 2 ? Probably it is mixing two use-cases ? First one starting from the leaf-nodes like users MATCH (principals)-[:IS_MEMBER_OF]-()-[:IS_MEMBER_OF*0..]-(n) and a second one starting from higher level nodes like groups. MATCH (principals)-[:IS_MEMBER_OF*0..]-(n) So that is a different place for the starting points in the match. Perhaps something like this could work: MATCH (principals)-[:IS_MEMBER_OF*0..1]-()-[:IS_MEMBER_OF*0..]-(n) But perhaps better when Peter chimes in later today as he spent a lot of time applying Cypher to ACL scenarios. Michael Am 02.11.2011 um 11:18 schrieb D. Frej: I though that this is what I used with MATCH (principals)-[?:IS_MEMBER_OF]- When I turn it into MATCH (principals)-[?]-()-[:IS_MEMBER_OF*0..]-(n) RETURN n Nothing at all is returned Am 02.11.2011 11:05, schrieb Jacob Hansson: On Wed, Nov 2, 2011 at 11:01 AM, D. Frejdieter_f...@gmx.net wrote: Hi, I have a very simply graph: UserGroup 2-[:IS_MEMBER_OF]- UserGroup 1, User 3 UserGroup 1-[:IS_MEMBER_OF]- User 1, User 2 I want to find all nodes that are on the same level or on a level below the starting point. Using START principals=node:nodes(NAME='User 3') MATCH (principals)-[?:IS_MEMBER_OF]-()-[:IS_MEMBER_OF*0..]-(n) RETURN n I first go one level up and then determine all nodes below this level. However, it is not working if I change the start to START principals=node:nodes(NAME='UserGroup 2') (because there is no IS_MEMBER_OF relationship to go up). Is there a way to ommit this condition if it is not available? To make it somehow optional? You could use an optional relationship here. See: http://docs.neo4j.org/chunked/snapshot/query-match.html#match-optional-relationship Note that this is the snapshot version of the documentation, you will want to look at the documentation for the version of neo4j you are using to make sure that this syntax is supported. Thanks, - Didi ___ 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] Newbie issues with indexing
Hi Bill, Why BarName in one and FooName in the other? I'm assuming you have NodeType/Name for both ok? So... a query like this would look like: nodeIndex.query( NodeType:Bar AND Name:\Bar 1\ ); 2011/11/1 Bill Baker bill...@billbak.com Hello, I have an index and add my nodes to it as I create them. I index two properties, nodeType and nodeName. Later I want to see if a node already exists of a given type and a given name. If it does, I'll use it; otherwise I'll create it (and index it.) (All this is in the Java API.) IndexManager indexMgr = graphDB.index(); IndexNode nodeIndex = indexMgr.forNodes(NodeType); Later on I create a node (newNode) with properties NodeType = Bar and BarName = Bar 1 and another with NodeType = Foo and FooName = Foo 1. nodeIndex.add (newNode, NodeType, Bar); nodeIndex.add (newNode, BarName, Bar 1); nodeIndex.add (newNode2, NodeType, Foo); nodeIndex.add)newNode2, FooName, Foo 1); etc. Still later, I want to see if I already have a node of type Bar with name Bar 1. I read up on the query syntax in 7.7 ( http://docs.neo4j.org/chunked/stable/indexing-search.html) and noticed that the syntax listed there does not support any white space in the query string. So I am looking into how to use Lucene query objects to form my query. But now I'm stumped. I want to get a list (IndexHits is fine) of any nodes in the system that have these two properties (NodeType and BarType) set to specific values. I think there might be more to Lucene Query objects than just TermQuery. Is that in the Neo4j docs, the Lucene docs? Any examples handy? Thanks in advance! Bill -- Bill Baker, Investor, Advisor, Board Member 206-619-0928 My other house is a data warehouse ___ 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] Cypher: including start in result
On Wed, Nov 2, 2011 at 11:18 AM, Michael Hunger michael.hun...@neotechnology.com wrote: Hi, in the pattern matching employed by cypher nodes already bound to an identifier won't be bound to another identifier. I was thinking this was a bug when I saw Didis mail here, but wasn't sure so I didn't answer. Is there a complex reason why this is the case, and is it going to stay this way? It feels a bit counter-intuitive.. That is the reason why all nodes that already belong to principals don't appear in n. In your case it might be easiest to just return n,principals Cheers Michael Am 02.11.2011 um 10:56 schrieb D. Frej: Hi, I have a very simply graph: UserGroup 2 -[:IS_MEMBER_OF]- UserGroup 1, User 3 UserGroup 1 -[:IS_MEMBER_OF]- User 1, User 2 I use the following cypher to find all nodes that are below UserGroup 2 (I start at node User 3 and go one level up in the tree which equals UserGroup 2): START principals=node:nodes(NAME='User 3') MATCH (principals)-[:IS_MEMBER_OF]-()-[:IS_MEMBER_OF*0..]-(n) RETURN n The result does not contain User 3 even though it is a child of UserGroup2 and connected to it via IS_MEMBER_OF relationship. Is there any way to also include it in the result? Thanks, - Didi ___ 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 -- Jacob Hansson Phone: +46 (0) 763503395 Twitter: @jakewins ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] REST traverse deprecation
On Wed, Nov 2, 2011 at 11:11 AM, Michael Hunger michael.hun...@neotechnology.com wrote: custom use-cases like the ones implemented by our customers with plugins / extensions and in the case of the ruby script extensions a way I'd like to promote to talk to the server that is 1) create you own RESTful endpoints that are focused on a protocol speaking your domain and not nodes + rels Isn't running domain logic inside a database server a well known anti-pattern? My experience with companies building lots of stuff with stored procedures is that it is *really* hard to maintain, hard to scale, hard to test, hard to tweak and impossible to get an overview of. See for instance how much pain Etsy.com had getting off this type of architecture: http://arstechnica.com/business/news/2011/10/when-clever-goes-wrong-how-etsy-overcame-poor-architectural-choices.ars 2) the protocol is use-case oriented This also implies running domain logic in the database server. 3) it only transmits the information necessary (not more). This is a really good point. Wouldn't it be better though, if we pulled some use cases like this out and said we need Cypher to be able to do this, and thus make Cypher better, rather than saying screw it, lets just let clients use the database as an application server. What are some use cases where this occurs? Lets look at them, and see if it would be possible to make cypher or gremlin do it. 4) The code of these endpoints would be transactionally executed This is a bug, in my mind, of the REST API. Solving it in roundabout ways like this and the batch-operations-API is not actually solving the problem. Use-Cases with customers so far have been: * unique nodes with locking + index lookup This is an *excellent* use case. Compared to the scripting solution, wouldn't it be better if we supported upserts directly in the REST API, as a core feature? * batch data insertion (also unique stuff see above) This is mainly because the REST API is slow, no? If so, spending time working around the problem with arbitrary script execution is beating around the bush. We should fix the real problem here, not hack around it. * custom traversals with complicated callbacks This is really what my original question to Peter was about - what are some traversals like this, that we currently cannot do with Cypher or Gremlin? Can we extend Cypher to accomodate those use cases? * aggregating multiple gremlin / cypher queries in the server and returning only a partial result-set/projection of those executions This also seems like a limitation of Cypher. Can you give an example of when this would be necessary, and we can talk about how that could be integrated into Cypher, if possible? * With the ruby script extension what we've done there is to leverage the web/REST frameworks of the platform and allow rack-apps to expose their REST endpoints within the neo4j-server. Thomas and I also talked about a more generic way to allow any language supported by the javax.script extension to register endpoints with the neo4j-server. A generic javax.scripting languages plugin would accommodate for more ad-hoc execution mode for which writing an extension is too much ceremony. Michael Am 02.11.2011 um 10:54 schrieb Jacob Hansson: On Wed, Nov 2, 2011 at 10:20 AM, Michael Hunger michael.hun...@neotechnology.com wrote: I vote not dropped, as there are lots of non-java developers out there which would want to use REST server dynamically. I am completely open to the notion that I am wrong here. But I want us to have answered the questions I was asking before properly, if we are going to embrace all these ways to talk to the server. What use cases does dynamic script execution cover that cypher or gremlin do not? Why should those use cases not be covered by cypher or gremlin? That was the reason why we wrote the ruby-script-extension support. Michael Am 02.11.2011 um 10:08 schrieb Jacob Hansson: On Tue, Nov 1, 2011 at 5:37 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, I think that Cypher is not yes taking into account Uniqueness, or is it Andres? Otherwise, most of the normal traversals are covered. To keep things consistent and give people a way of doing fine grained traversals, I would then suggest to document all the existing examples using Cypher or Groovy code, so we can document that things are working as expected and not loose functionality. Sounds like a really good idea. The JavaScript exposure then would totally go away from the REST API and possibly be factored out into a plugin like Groovy/Gremlin. Or dropped. I vote dropped :) WDYT? Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter
Re: [Neo4j] Cypher: including start in result
On Wed, Nov 2, 2011 at 12:01 PM, Jacob Hansson jacob.hans...@neotechnology.com wrote: Is there a complex reason why this is the case, and is it going to stay this way? It feels a bit counter-intuitive.. Cypher has no way of expressing uniqueness today. I think it should. I think the current scheme is least surprising: it allows the foaf thing to work without surprises: MATCH me-[:FRIEND]-friend-[:FRIEND]-foaf This will not return yourself as a foaf. I think I would like to be able to say: MATCH me-[:FRIEND]-friend-[:FRIEND]-foaf WITH NO UNIQUENESS/NODE UNIQUENESS/RELATIONSHIP UNIQUENESS/IDENTIFIER UNIQUENESS Or something like that. Identifier uniqueness would be the default. It's a difficult concept, so I want the default to be as non-surprising as possible. This is one of the things that keep me up at night. Andrés ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Node Id generation deadlock
Hi, I had a similar issue (also with ID generation), and I would be also interested in a solution, or how synchronizations should be done to avoid deadlocks like this in the transaction. Regards, --- balazs On 11/2/11 8:55 AM, Cres wrote: (Sorry for re-opening this thread, I hadn't yet subscribed to the mailing list when I opened it the previous time, so I had to re-start it..) Hi, I'm using Neo4J version 1.4.1. I've tried following the design guide ( http://wiki.neo4j.org/content/Design_Guide#Make_use_of_Factories ) writing a short program, but when I try to run it, it goes into a deadlock and the application freezes. Basically what my program does is to create a new embedded graph database, initalize a factory node, then it creates two threads where each of them is tasked with creating two nodes, giving them an ID (according to the pattern shown in the design guide), and that's about it. Once I run it, one thread end up on WAIT state, while the other is on MONITOR. Showing the threads dump, I can see that the MONITOR-state thread is waiting for the other thread to release the ID generation method's lock (_lock), and the WAIT-state thread is waiting inside Neo4J's RWLock class, trying to acquire a write lock, but for some reason it's waiting (line 326). It got there from a call in the ID generation method which tries to update the factory node's ID sequence property, as shown in the design guide. I'm appending the code here. I'm aware that this program misses some things (such as shutting down the DB once i'm done, adding the relationship between factory node and created node, and for the createNode() method to actually return a node) - i've left out everything I could to have the least amount of code which makes this problem occur. The code: public class MultiThreadingBasicTest { private final GraphDatabaseService _graphDB; private final Object _lock; private final Node _factoryNode; public static void main(String[] args) { MultiThreadingBasicTest test = new MultiThreadingBasicTest(); test.run(); } public MultiThreadingBasicTest() { _graphDB = new EmbeddedGraphDatabase(/MTBT-graphDB); _lock = new Object(); _factoryNode = createFactoryNode(); } public void run() { Thread[] threads = new Thread[2]; for (int i=0; i threads.length; i++) { threads[i] = new Thread(new Runnable() { @Override public void run() { Transaction tx = _graphDB.beginTx(); try { for (int i=0; i 2; i++) { createNode(); System.out.println(echo from thread + Thread.currentThread().getName()); } tx.success(); } finally { tx.finish(); } } }); } System.out.println(running the threads now); for (Thread thread : threads) { thread.start(); } } private Node createFactoryNode() { Node factoryNode = null; Transaction tx = _graphDB.beginTx(); try { factoryNode = _graphDB.createNode(); tx.success(); } finally { tx.finish(); } return factoryNode; } private void createNode() { long id = generateId(); //Node node = _graphDB.createNode(); // //node.setProperty(idseq, id); } private long generateId() { synchronized (_lock) { Long id; if (_factoryNode.hasProperty(idseq)) { id = (Long) _factoryNode.getProperty(idseq); } else { id = 1L; } _factoryNode.setProperty(idseq, id+1); return id; } } } (One last thing - I kept the line: System.out.println(echo from thread + Thread.currentThread().getName()); since if I remove it, the deadlock actually does not occur - at least not on my machine. However this is just a matter of race conditions, and if you use a higher number of threads / created-nodes-per-thread, then the problem will occur even without this line. I decided to keep it since I figured a case with two threads each creating two nodes is as simply as this can get). Thank you for your help, Ran. -- View this message in context:
Re: [Neo4j] REST traverse deprecation
On Wed, Nov 2, 2011 at 11:56 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Wed, Nov 2, 2011 at 11:11 AM, Michael Hunger michael.hun...@neotechnology.com wrote: * custom traversals with complicated callbacks This is really what my original question to Peter was about - what are some traversals like this, that we currently cannot do with Cypher or Gremlin? Can we extend Cypher to accomodate those use cases? Well, Gremlin is just Groovy+Pipes, so there's nothing you can't do in Gremlin. If we're talking about Cypher, I have one for you: PageRank. PageRank iterates over the data set a specified number of times, marking and updating stuff on the fly, until it's happy and returns a result. It's not hard at all to write using Gremlin, but impossible with Cypher. I can't see a way to make that nice and easy with Cypher. Andrés ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Cypher: including start in result
On Wed, Nov 2, 2011 at 12:26 PM, Andres Taylor andres.tay...@neotechnology.com wrote: On Wed, Nov 2, 2011 at 12:01 PM, Jacob Hansson jacob.hans...@neotechnology.com wrote: Is there a complex reason why this is the case, and is it going to stay this way? It feels a bit counter-intuitive.. Cypher has no way of expressing uniqueness today. I think it should. I think the current scheme is least surprising: it allows the foaf thing to work without surprises: MATCH me-[:FRIEND]-friend-[:FRIEND]-foaf This will not return yourself as a foaf. I think I would like to be able to say: MATCH me-[:FRIEND]-friend-[:FRIEND]-foaf WITH NO UNIQUENESS/NODE UNIQUENESS/RELATIONSHIP UNIQUENESS/IDENTIFIER UNIQUENESS Or something like that. Identifier uniqueness would be the default. It's a difficult concept, so I want the default to be as non-surprising as possible. Makes sense. My two cents on this: The foaf example would have surprised me if it returned me the first time I ran it, but now, looking at the query, I'm actually surprised it does not. It would be cool to list some use cases, and try to determine which is the least surprising default. Also, the word unique could be confusing as well, since there could be lots of different nodes being referenced by the me identifier. Really, what you are saying is Guarantee that any node referenced by this identifier is not referenced by any other. This is one of the things that keep me up at night. Andrés ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Jacob Hansson Phone: +46 (0) 763503395 Twitter: @jakewins ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] REST traverse deprecation
On Wed, Nov 2, 2011 at 12:34 PM, Andres Taylor andres.tay...@neotechnology.com wrote: On Wed, Nov 2, 2011 at 11:56 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Wed, Nov 2, 2011 at 11:11 AM, Michael Hunger michael.hun...@neotechnology.com wrote: * custom traversals with complicated callbacks This is really what my original question to Peter was about - what are some traversals like this, that we currently cannot do with Cypher or Gremlin? Can we extend Cypher to accomodate those use cases? Well, Gremlin is just Groovy+Pipes, so there's nothing you can't do in Gremlin. If we're talking about Cypher, I have one for you: PageRank. PageRank iterates over the data set a specified number of times, marking and updating stuff on the fly, until it's happy and returns a result. It's not hard at all to write using Gremlin, but impossible with Cypher. I can't see a way to make that nice and easy with Cypher. START a=node(1) MATCH p = a-[1..100]-other RETURN pageRank(a via p using weights blah saving state in property x) :) But seriously, aren't you alluding to a key distinction here - Graph Querying vs. Graph Processing? For processing, cypher is not your friend. But neither is writing jobs from scratch in your language of choice - at least not compared to writing a gremlin script. In this space (processing-style traversals), are there any use cases that are better served by arbitrary script execution than gremlin queries? And is catering to those use cases, if they exist, worth the cost in confusion, diffusion of effort and security problems? Andrés ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Jacob Hansson Phone: +46 (0) 763503395 Twitter: @jakewins ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] REST traverse deprecation
Mmh, this thread is just about deprecating the travers() section of the REST API, not take away general scripting form the server. I have not seen one single case where people have exploited the JavaScript exposure in the return/stop evaluators to do anything like you say Michael. Extensions and plugins are not going away for the time being, I am only concerned about http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html not adding value to the API, and being able to be scripted in a more concise way via the existing extensions (which I want to make examples of). I haven't heard any argument for this case, so the question is whether to document the usecases in other ways (Groovy, JavaScript or Cypher plugins) and deprecate this section, since it doesn't add functionality, just exposes scripting in a hacked-up way. 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 Wed, Nov 2, 2011 at 3:11 AM, Michael Hunger michael.hun...@neotechnology.com wrote: custom use-cases like the ones implemented by our customers with plugins / extensions and in the case of the ruby script extensions a way I'd like to promote to talk to the server that is 1) create you own RESTful endpoints that are focused on a protocol speaking your domain and not nodes + rels 2) the protocol is use-case oriented 3) it only transmits the information necessary (not more). 4) The code of these endpoints would be transactionally executed Use-Cases with customers so far have been: * unique nodes with locking + index lookup * batch data insertion (also unique stuff see above) * custom traversals with complicated callbacks * aggregating multiple gremlin / cypher queries in the server and returning only a partial result-set/projection of those executions * With the ruby script extension what we've done there is to leverage the web/REST frameworks of the platform and allow rack-apps to expose their REST endpoints within the neo4j-server. Thomas and I also talked about a more generic way to allow any language supported by the javax.script extension to register endpoints with the neo4j-server. A generic javax.scripting languages plugin would accommodate for more ad-hoc execution mode for which writing an extension is too much ceremony. Michael Am 02.11.2011 um 10:54 schrieb Jacob Hansson: On Wed, Nov 2, 2011 at 10:20 AM, Michael Hunger michael.hun...@neotechnology.com wrote: I vote not dropped, as there are lots of non-java developers out there which would want to use REST server dynamically. I am completely open to the notion that I am wrong here. But I want us to have answered the questions I was asking before properly, if we are going to embrace all these ways to talk to the server. What use cases does dynamic script execution cover that cypher or gremlin do not? Why should those use cases not be covered by cypher or gremlin? That was the reason why we wrote the ruby-script-extension support. Michael Am 02.11.2011 um 10:08 schrieb Jacob Hansson: On Tue, Nov 1, 2011 at 5:37 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, I think that Cypher is not yes taking into account Uniqueness, or is it Andres? Otherwise, most of the normal traversals are covered. To keep things consistent and give people a way of doing fine grained traversals, I would then suggest to document all the existing examples using Cypher or Groovy code, so we can document that things are working as expected and not loose functionality. Sounds like a really good idea. The JavaScript exposure then would totally go away from the REST API and possibly be factored out into a plugin like Groovy/Gremlin. Or dropped. I vote dropped :) WDYT? 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 Tue, Nov 1, 2011 at 9:31 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Tue, Nov 1, 2011 at 5:22 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Nope, I mean a server side script execution (which we already are doing in http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html) to execute traversal API code on the server. Neo4js is a client driver. Remember that adding yet another way to talk to the server comes at a cost of confusion and spreading engineering focus thin. I don't think we should do this unless there is a good answer to the question: *Is there
Re: [Neo4j] Java segfault using paste and Python bindings
I had no idea that neo4j had a REST interface; I am essentially implementing my own REST interface in order to use neo4j embedded in a desktop app. I will have to look into that more to see if there's an easy way to embed the server and still communicate to it via the REST API. Thanks for the pointer! ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Java segfault using paste and Python bindings
Michael, have you looked at http://docs.neo4j.org/chunked/snapshot/rest-api.html for documentation? We probably should promote the manual much more prominently on the site :/ 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 Wed, Nov 2, 2011 at 7:49 AM, Michael Rene Armida m...@marmida.com wrote: I had no idea that neo4j had a REST interface; I am essentially implementing my own REST interface in order to use neo4j embedded in a desktop app. I will have to look into that more to see if there's an easy way to embed the server and still communicate to it via the REST API. Thanks for the pointer! ___ 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] Newbie issues with indexing
Thanks Mattias. One node is a Foo node and one is a Bar node. Maybe I am being too fancy; I could just use 'NAME' for any type of node. I'm a little confused about the query string below. Should it perhaps be NodeType:Bar AND Name:Bar 1 ? I'm not getting why the property name is inside the quotes for one predicate and not the other (below.) Thanks! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Wednesday, November 02, 2011 3:56 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Hi Bill, Why BarName in one and FooName in the other? I'm assuming you have NodeType/Name for both ok? So... a query like this would look like: nodeIndex.query( NodeType:Bar AND Name:\Bar 1\ ); 2011/11/1 Bill Baker bill...@billbak.com Hello, I have an index and add my nodes to it as I create them. I index two properties, nodeType and nodeName. Later I want to see if a node already exists of a given type and a given name. If it does, I'll use it; otherwise I'll create it (and index it.) (All this is in the Java API.) IndexManager indexMgr = graphDB.index(); IndexNode nodeIndex = indexMgr.forNodes(NodeType); Later on I create a node (newNode) with properties NodeType = Bar and BarName = Bar 1 and another with NodeType = Foo and FooName = Foo 1. nodeIndex.add (newNode, NodeType, Bar); nodeIndex.add (newNode, BarName, Bar 1); nodeIndex.add (newNode2, NodeType, Foo); nodeIndex.add)newNode2, FooName, Foo 1); etc. Still later, I want to see if I already have a node of type Bar with name Bar 1. I read up on the query syntax in 7.7 ( http://docs.neo4j.org/chunked/stable/indexing-search.html) and noticed that the syntax listed there does not support any white space in the query string. So I am looking into how to use Lucene query objects to form my query. But now I'm stumped. I want to get a list (IndexHits is fine) of any nodes in the system that have these two properties (NodeType and BarType) set to specific values. I think there might be more to Lucene Query objects than just TermQuery. Is that in the Neo4j docs, the Lucene docs? Any examples handy? Thanks in advance! Bill -- Bill Baker, Investor, Advisor, Board Member 206-619-0928 My other house is a data warehouse ___ 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] REST traverse deprecation
On Wed, Nov 2, 2011 at 3:44 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Mmh, this thread is just about deprecating the travers() section of the REST API, not take away general scripting form the server. I have not seen one single case where people have exploited the JavaScript exposure in the return/stop evaluators to do anything like you say Michael. Extensions and plugins are not going away for the time being, I am only concerned about http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html not adding value to the API, and being able to be scripted in a more concise way via the existing extensions (which I want to make examples of). I haven't heard any argument for this case, so the question is whether to document the usecases in other ways (Groovy, JavaScript or Cypher plugins) and deprecate this section, since it doesn't add functionality, just exposes scripting in a hacked-up way. Good that you point this out, this thread is a bit confusing since we're talking about a lot of different things. If we can't find use cases that warrants the REST traversal API, we should deprecate it. It would be great to get the input of some of the people working on clients for the REST server before a decision is made though. I would also *really* like to continue the discussion about arbitrary script execution, because I want to understand the arguments for it. Perhaps we should break that discussion into a separate thread, to keep things concise. Imma start a new thread :) 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 Wed, Nov 2, 2011 at 3:11 AM, Michael Hunger michael.hun...@neotechnology.com wrote: custom use-cases like the ones implemented by our customers with plugins / extensions and in the case of the ruby script extensions a way I'd like to promote to talk to the server that is 1) create you own RESTful endpoints that are focused on a protocol speaking your domain and not nodes + rels 2) the protocol is use-case oriented 3) it only transmits the information necessary (not more). 4) The code of these endpoints would be transactionally executed Use-Cases with customers so far have been: * unique nodes with locking + index lookup * batch data insertion (also unique stuff see above) * custom traversals with complicated callbacks * aggregating multiple gremlin / cypher queries in the server and returning only a partial result-set/projection of those executions * With the ruby script extension what we've done there is to leverage the web/REST frameworks of the platform and allow rack-apps to expose their REST endpoints within the neo4j-server. Thomas and I also talked about a more generic way to allow any language supported by the javax.script extension to register endpoints with the neo4j-server. A generic javax.scripting languages plugin would accommodate for more ad-hoc execution mode for which writing an extension is too much ceremony. Michael Am 02.11.2011 um 10:54 schrieb Jacob Hansson: On Wed, Nov 2, 2011 at 10:20 AM, Michael Hunger michael.hun...@neotechnology.com wrote: I vote not dropped, as there are lots of non-java developers out there which would want to use REST server dynamically. I am completely open to the notion that I am wrong here. But I want us to have answered the questions I was asking before properly, if we are going to embrace all these ways to talk to the server. What use cases does dynamic script execution cover that cypher or gremlin do not? Why should those use cases not be covered by cypher or gremlin? That was the reason why we wrote the ruby-script-extension support. Michael Am 02.11.2011 um 10:08 schrieb Jacob Hansson: On Tue, Nov 1, 2011 at 5:37 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, I think that Cypher is not yes taking into account Uniqueness, or is it Andres? Otherwise, most of the normal traversals are covered. To keep things consistent and give people a way of doing fine grained traversals, I would then suggest to document all the existing examples using Cypher or Groovy code, so we can document that things are working as expected and not loose functionality. Sounds like a really good idea. The JavaScript exposure then would totally go away from the REST API and possibly be factored out into a plugin like Groovy/Gremlin. Or dropped. I vote dropped :) WDYT? Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer
Re: [Neo4j] REST traverse deprecation
Yes. This thread is about ONLY the traverse-Endpoint not scripting in general. 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 Wed, Nov 2, 2011 at 8:35 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Wed, Nov 2, 2011 at 3:44 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Mmh, this thread is just about deprecating the travers() section of the REST API, not take away general scripting form the server. I have not seen one single case where people have exploited the JavaScript exposure in the return/stop evaluators to do anything like you say Michael. Extensions and plugins are not going away for the time being, I am only concerned about http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html not adding value to the API, and being able to be scripted in a more concise way via the existing extensions (which I want to make examples of). I haven't heard any argument for this case, so the question is whether to document the usecases in other ways (Groovy, JavaScript or Cypher plugins) and deprecate this section, since it doesn't add functionality, just exposes scripting in a hacked-up way. Good that you point this out, this thread is a bit confusing since we're talking about a lot of different things. If we can't find use cases that warrants the REST traversal API, we should deprecate it. It would be great to get the input of some of the people working on clients for the REST server before a decision is made though. I would also *really* like to continue the discussion about arbitrary script execution, because I want to understand the arguments for it. Perhaps we should break that discussion into a separate thread, to keep things concise. Imma start a new thread :) 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 Wed, Nov 2, 2011 at 3:11 AM, Michael Hunger michael.hun...@neotechnology.com wrote: custom use-cases like the ones implemented by our customers with plugins / extensions and in the case of the ruby script extensions a way I'd like to promote to talk to the server that is 1) create you own RESTful endpoints that are focused on a protocol speaking your domain and not nodes + rels 2) the protocol is use-case oriented 3) it only transmits the information necessary (not more). 4) The code of these endpoints would be transactionally executed Use-Cases with customers so far have been: * unique nodes with locking + index lookup * batch data insertion (also unique stuff see above) * custom traversals with complicated callbacks * aggregating multiple gremlin / cypher queries in the server and returning only a partial result-set/projection of those executions * With the ruby script extension what we've done there is to leverage the web/REST frameworks of the platform and allow rack-apps to expose their REST endpoints within the neo4j-server. Thomas and I also talked about a more generic way to allow any language supported by the javax.script extension to register endpoints with the neo4j-server. A generic javax.scripting languages plugin would accommodate for more ad-hoc execution mode for which writing an extension is too much ceremony. Michael Am 02.11.2011 um 10:54 schrieb Jacob Hansson: On Wed, Nov 2, 2011 at 10:20 AM, Michael Hunger michael.hun...@neotechnology.com wrote: I vote not dropped, as there are lots of non-java developers out there which would want to use REST server dynamically. I am completely open to the notion that I am wrong here. But I want us to have answered the questions I was asking before properly, if we are going to embrace all these ways to talk to the server. What use cases does dynamic script execution cover that cypher or gremlin do not? Why should those use cases not be covered by cypher or gremlin? That was the reason why we wrote the ruby-script-extension support. Michael Am 02.11.2011 um 10:08 schrieb Jacob Hansson: On Tue, Nov 1, 2011 at 5:37 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Well, I think that Cypher is not yes taking into account Uniqueness, or is it Andres? Otherwise, most of the normal traversals are covered. To keep things consistent and give people a way of doing fine grained traversals, I would then suggest to document all the existing examples using Cypher
Re: [Neo4j] Newbie issues with indexing
...because you have a space character in the name. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Bill Baker [bill...@billbak.com] Sent: Wednesday, November 02, 2011 11:33 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Thanks Mattias. One node is a Foo node and one is a Bar node. Maybe I am being too fancy; I could just use 'NAME' for any type of node. I'm a little confused about the query string below. Should it perhaps be NodeType:Bar AND Name:Bar 1 ? I'm not getting why the property name is inside the quotes for one predicate and not the other (below.) Thanks! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Wednesday, November 02, 2011 3:56 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Hi Bill, Why BarName in one and FooName in the other? I'm assuming you have NodeType/Name for both ok? So... a query like this would look like: nodeIndex.query( NodeType:Bar AND Name:\Bar 1\ ); 2011/11/1 Bill Baker bill...@billbak.com Hello, I have an index and add my nodes to it as I create them. I index two properties, nodeType and nodeName. Later I want to see if a node already exists of a given type and a given name. If it does, I'll use it; otherwise I'll create it (and index it.) (All this is in the Java API.) IndexManager indexMgr = graphDB.index(); IndexNode nodeIndex = indexMgr.forNodes(NodeType); Later on I create a node (newNode) with properties NodeType = Bar and BarName = Bar 1 and another with NodeType = Foo and FooName = Foo 1. nodeIndex.add (newNode, NodeType, Bar); nodeIndex.add (newNode, BarName, Bar 1); nodeIndex.add (newNode2, NodeType, Foo); nodeIndex.add)newNode2, FooName, Foo 1); etc. Still later, I want to see if I already have a node of type Bar with name Bar 1. I read up on the query syntax in 7.7 ( http://docs.neo4j.org/chunked/stable/indexing-search.html) and noticed that the syntax listed there does not support any white space in the query string. So I am looking into how to use Lucene query objects to form my query. But now I'm stumped. I want to get a list (IndexHits is fine) of any nodes in the system that have these two properties (NodeType and BarType) set to specific values. I think there might be more to Lucene Query objects than just TermQuery. Is that in the Neo4j docs, the Lucene docs? Any examples handy? Thanks in advance! Bill -- Bill Baker, Investor, Advisor, Board Member 206-619-0928 My other house is a data warehouse ___ 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 mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] REST traverse deprecation
Hi, We use the REST traversal API extensively. One of our core use cases is to find all paths between two nodes. We are a .Net shop so we rely on the REST API, and are currently using a .Net neo4j library from about 18 months ago that we have customized to our needs. I have seen other recent threads about updated .Net libraries so that is on our roadmap. We are currently on v1.4.1 so if the REST traversal API is deprecated in a future version, that will drive a fairly significant change on our system to replace the .Net library and refactor the traversal functionality accordingly. I generally think this is a good thing since we need to move in that directly anyways, but I wanted to at least get it out that we use the REST traversal API. Thanks, Kevin On Wed, Nov 2, 2011 at 11:35 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Wed, Nov 2, 2011 at 3:44 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Mmh, this thread is just about deprecating the travers() section of the REST API, not take away general scripting form the server. I have not seen one single case where people have exploited the JavaScript exposure in the return/stop evaluators to do anything like you say Michael. Extensions and plugins are not going away for the time being, I am only concerned about http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html not adding value to the API, and being able to be scripted in a more concise way via the existing extensions (which I want to make examples of). I haven't heard any argument for this case, so the question is whether to document the usecases in other ways (Groovy, JavaScript or Cypher plugins) and deprecate this section, since it doesn't add functionality, just exposes scripting in a hacked-up way. Good that you point this out, this thread is a bit confusing since we're talking about a lot of different things. If we can't find use cases that warrants the REST traversal API, we should deprecate it. It would be great to get the input of some of the people working on clients for the REST server before a decision is made though. I would also *really* like to continue the discussion about arbitrary script execution, because I want to understand the arguments for it. Perhaps we should break that discussion into a separate thread, to keep things concise. Imma start a new thread :) 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 Wed, Nov 2, 2011 at 3:11 AM, Michael Hunger michael.hun...@neotechnology.com wrote: custom use-cases like the ones implemented by our customers with plugins / extensions and in the case of the ruby script extensions a way I'd like to promote to talk to the server that is 1) create you own RESTful endpoints that are focused on a protocol speaking your domain and not nodes + rels 2) the protocol is use-case oriented 3) it only transmits the information necessary (not more). 4) The code of these endpoints would be transactionally executed Use-Cases with customers so far have been: * unique nodes with locking + index lookup * batch data insertion (also unique stuff see above) * custom traversals with complicated callbacks * aggregating multiple gremlin / cypher queries in the server and returning only a partial result-set/projection of those executions * With the ruby script extension what we've done there is to leverage the web/REST frameworks of the platform and allow rack-apps to expose their REST endpoints within the neo4j-server. Thomas and I also talked about a more generic way to allow any language supported by the javax.script extension to register endpoints with the neo4j-server. A generic javax.scripting languages plugin would accommodate for more ad-hoc execution mode for which writing an extension is too much ceremony. Michael Am 02.11.2011 um 10:54 schrieb Jacob Hansson: On Wed, Nov 2, 2011 at 10:20 AM, Michael Hunger michael.hun...@neotechnology.com wrote: I vote not dropped, as there are lots of non-java developers out there which would want to use REST server dynamically. I am completely open to the notion that I am wrong here. But I want us to have answered the questions I was asking before properly, if we are going to embrace all these ways to talk to the server. What use cases does dynamic script execution cover that cypher or gremlin do not? Why should those use cases not be covered by cypher or gremlin? That was the reason why we wrote the ruby-script-extension support.
Re: [Neo4j] REST traverse deprecation
As I said it is still used in the rest-graphdb-client which comes as a drop-in-replacement for the core-api. This functionality would go missing then. Same goes for lot of stuff that for instance neography does with the REST server to offer a quite fluent way of traversing the graph. See here: https://github.com/maxdemarzi/neography - Readme n1.outgoing(:friends).incoming(:enemies) # Get nodes related by one of multiple relationships n1.outgoing(:friends).depth(2) # Get nodes related by friends and friends of friends n1.outgoing(:friends).depth(:all)# Get nodes related by friends until the end of the graph n1.outgoing(:friends).depth(2).include_start_node # Get n1 and nodes related by friends and friends of friends n1.outgoing(:friends).prune(position.endNode().getProperty('name') == 'Tom';) n1.outgoing(:friends).filter(position.length() == 2;) We use this functionality also in our hosting provider to navigate the graph of servers, providers, users, databases and servers. If it goes away we have to rewrite parts of the hosting provider in something else. Cheers Michael Am 02.11.2011 um 16:41 schrieb Peter Neubauer: Yes. This thread is about ONLY the traverse-Endpoint not scripting in general. 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 Wed, Nov 2, 2011 at 8:35 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Wed, Nov 2, 2011 at 3:44 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Mmh, this thread is just about deprecating the travers() section of the REST API, not take away general scripting form the server. I have not seen one single case where people have exploited the JavaScript exposure in the return/stop evaluators to do anything like you say Michael. Extensions and plugins are not going away for the time being, I am only concerned about http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html not adding value to the API, and being able to be scripted in a more concise way via the existing extensions (which I want to make examples of). I haven't heard any argument for this case, so the question is whether to document the usecases in other ways (Groovy, JavaScript or Cypher plugins) and deprecate this section, since it doesn't add functionality, just exposes scripting in a hacked-up way. Good that you point this out, this thread is a bit confusing since we're talking about a lot of different things. If we can't find use cases that warrants the REST traversal API, we should deprecate it. It would be great to get the input of some of the people working on clients for the REST server before a decision is made though. I would also *really* like to continue the discussion about arbitrary script execution, because I want to understand the arguments for it. Perhaps we should break that discussion into a separate thread, to keep things concise. Imma start a new thread :) 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 Wed, Nov 2, 2011 at 3:11 AM, Michael Hunger michael.hun...@neotechnology.com wrote: custom use-cases like the ones implemented by our customers with plugins / extensions and in the case of the ruby script extensions a way I'd like to promote to talk to the server that is 1) create you own RESTful endpoints that are focused on a protocol speaking your domain and not nodes + rels 2) the protocol is use-case oriented 3) it only transmits the information necessary (not more). 4) The code of these endpoints would be transactionally executed Use-Cases with customers so far have been: * unique nodes with locking + index lookup * batch data insertion (also unique stuff see above) * custom traversals with complicated callbacks * aggregating multiple gremlin / cypher queries in the server and returning only a partial result-set/projection of those executions * With the ruby script extension what we've done there is to leverage the web/REST frameworks of the platform and allow rack-apps to expose their REST endpoints within the neo4j-server. Thomas and I also talked about a more generic way to allow any language supported by the javax.script extension to register endpoints with the neo4j-server. A generic javax.scripting languages plugin would accommodate for more ad-hoc
Re: [Neo4j] REST traverse deprecation
Ok, then let's shelf this until further notice, and revise it when we have done some more extensive work on the server and fast protocol stack. Thanks for all input, good that you speak up! 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 Wed, Nov 2, 2011 at 8:53 AM, Michael Hunger michael.hun...@neotechnology.com wrote: As I said it is still used in the rest-graphdb-client which comes as a drop-in-replacement for the core-api. This functionality would go missing then. Same goes for lot of stuff that for instance neography does with the REST server to offer a quite fluent way of traversing the graph. See here: https://github.com/maxdemarzi/neography - Readme n1.outgoing(:friends).incoming(:enemies) # Get nodes related by one of multiple relationships n1.outgoing(:friends).depth(2) # Get nodes related by friends and friends of friends n1.outgoing(:friends).depth(:all) # Get nodes related by friends until the end of the graph n1.outgoing(:friends).depth(2).include_start_node # Get n1 and nodes related by friends and friends of friends n1.outgoing(:friends).prune(position.endNode().getProperty('name') == 'Tom';) n1.outgoing(:friends).filter(position.length() == 2;) We use this functionality also in our hosting provider to navigate the graph of servers, providers, users, databases and servers. If it goes away we have to rewrite parts of the hosting provider in something else. Cheers Michael Am 02.11.2011 um 16:41 schrieb Peter Neubauer: Yes. This thread is about ONLY the traverse-Endpoint not scripting in general. 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 Wed, Nov 2, 2011 at 8:35 AM, Jacob Hansson jacob.hans...@neotechnology.com wrote: On Wed, Nov 2, 2011 at 3:44 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Mmh, this thread is just about deprecating the travers() section of the REST API, not take away general scripting form the server. I have not seen one single case where people have exploited the JavaScript exposure in the return/stop evaluators to do anything like you say Michael. Extensions and plugins are not going away for the time being, I am only concerned about http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html not adding value to the API, and being able to be scripted in a more concise way via the existing extensions (which I want to make examples of). I haven't heard any argument for this case, so the question is whether to document the usecases in other ways (Groovy, JavaScript or Cypher plugins) and deprecate this section, since it doesn't add functionality, just exposes scripting in a hacked-up way. Good that you point this out, this thread is a bit confusing since we're talking about a lot of different things. If we can't find use cases that warrants the REST traversal API, we should deprecate it. It would be great to get the input of some of the people working on clients for the REST server before a decision is made though. I would also *really* like to continue the discussion about arbitrary script execution, because I want to understand the arguments for it. Perhaps we should break that discussion into a separate thread, to keep things concise. Imma start a new thread :) 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 Wed, Nov 2, 2011 at 3:11 AM, Michael Hunger michael.hun...@neotechnology.com wrote: custom use-cases like the ones implemented by our customers with plugins / extensions and in the case of the ruby script extensions a way I'd like to promote to talk to the server that is 1) create you own RESTful endpoints that are focused on a protocol speaking your domain and not nodes + rels 2) the protocol is use-case oriented 3) it only transmits the information necessary (not more). 4) The code of these endpoints would be transactionally executed Use-Cases with customers so far have been: * unique nodes with locking + index lookup * batch data insertion (also unique stuff see above) * custom
Re: [Neo4j] Newbie issues with indexing
Got it, quote the string so the spaces don't matter, thanks. NodeType:Bar AND Name:\Bar 1\ seems inconsistent. It has five quotes. I will try this: NodeType:Bar AND Name:\Bar 1\ as I _think_ the version above has unmatched quotes. Thanks everyone, I appreciate the help. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Rick Bullotta Sent: Wednesday, November 02, 2011 8:44 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing ...because you have a space character in the name. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Bill Baker [bill...@billbak.com] Sent: Wednesday, November 02, 2011 11:33 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Thanks Mattias. One node is a Foo node and one is a Bar node. Maybe I am being too fancy; I could just use 'NAME' for any type of node. I'm a little confused about the query string below. Should it perhaps be NodeType:Bar AND Name:Bar 1 ? I'm not getting why the property name is inside the quotes for one predicate and not the other (below.) Thanks! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Wednesday, November 02, 2011 3:56 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Hi Bill, Why BarName in one and FooName in the other? I'm assuming you have NodeType/Name for both ok? So... a query like this would look like: nodeIndex.query( NodeType:Bar AND Name:\Bar 1\ ); 2011/11/1 Bill Baker bill...@billbak.com Hello, I have an index and add my nodes to it as I create them. I index two properties, nodeType and nodeName. Later I want to see if a node already exists of a given type and a given name. If it does, I'll use it; otherwise I'll create it (and index it.) (All this is in the Java API.) IndexManager indexMgr = graphDB.index(); IndexNode nodeIndex = indexMgr.forNodes(NodeType); Later on I create a node (newNode) with properties NodeType = Bar and BarName = Bar 1 and another with NodeType = Foo and FooName = Foo 1. nodeIndex.add (newNode, NodeType, Bar); nodeIndex.add (newNode, BarName, Bar 1); nodeIndex.add (newNode2, NodeType, Foo); nodeIndex.add)newNode2, FooName, Foo 1); etc. Still later, I want to see if I already have a node of type Bar with name Bar 1. I read up on the query syntax in 7.7 ( http://docs.neo4j.org/chunked/stable/indexing-search.html) and noticed that the syntax listed there does not support any white space in the query string. So I am looking into how to use Lucene query objects to form my query. But now I'm stumped. I want to get a list (IndexHits is fine) of any nodes in the system that have these two properties (NodeType and BarType) set to specific values. I think there might be more to Lucene Query objects than just TermQuery. Is that in the Neo4j docs, the Lucene docs? Any examples handy? Thanks in advance! Bill -- Bill Baker, Investor, Advisor, Board Member 206-619-0928 My other house is a data warehouse ___ 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 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] Running arbitrary code in the server
Breaking this out of the talk about deprecating REST traversals ( http://neo4j.org/forums/#nabble-td3460396). So, I'm trying to understand the arguments pro and con *POSTing arbitrary code to the server*, as well as *writing server plugins for the sake of adding domain logic inside the database*. To be clear, I'm not debating plugins that extend general server functionality, like spatial, gremlin, cypher and so on. It sounds to me like the main argument for both of these is you use it to build SOA by deploying code into the database. I think SOA is kick-ass, but I'm not sure I understand why running your domain logic inside your database is a good way to go about building SOA systems. Is the SOA thing the main argument for supporting arbitrary code execution? if answer is True: *What are the arguments for doing SOA this way?* else: *What is the main argument for arbitrary code execution then?* The reason I want this discussion is because I'm worried that there are problems with this approach that will bite us later, and I want to know that the arguments pro are worth that pain. I also think that a lot of the arguments for arbitrary script execution are related to shortcomings in the server and in Cypher, and I don't think hacking around those shortcomings is a good solution. -- Jacob Hansson Phone: +46 (0) 763503395 Twitter: @jakewins ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] what is the neo4j-spatial website?
Hi there, the current snapshots of Neo4j Spatial are dependent on Neo4j 1.5-SNAPSHOT. For importing a shapefile, please look at https://github.com/neo4j/spatial/blob/master/src/test/java/org/neo4j/gis/spatial/TestSpatial.java#L212 Does that work? 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 Tue, Nov 1, 2011 at 11:54 PM, chen zhao dreamthinkin...@gmail.com wrote: Now I have download neo4j-spatial-be288f2,I want to import a shapfile file into the neo4j-spatial database. How can I start the neo4j-spatial db? Is the neo4j-spatial independent or dependent on neo4j-enterprise-1.4.2? I do not know the relationship between the two? Thank you. zhao 2011/11/2 chen zhao dreamthinkin...@gmail.com Thank you very much 2011/11/2 Peter Neubauer peter.neuba...@neotechnology.com Zhao, Neo4j Spatial is an add-on to the Neo4j ecosystem. We are in the process fo getting the docs in order, until then, the best is to look at https://github.com/neo4j/spatial . Also, I am attaching the current state of the docs, hope to publish it during the next weeks on a approriate place. Anything special you want to know? 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 Tue, Nov 1, 2011 at 11:05 PM, chen zhao dreamthinkin...@gmail.com wrote: Hi, I can not find the neo4j-spatial database download page. Only I can download neo4j-enterprise-1.4.2. Who can tell me the website of neo4j-spatial database? zhao ___ 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] Tree structure
Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Newbie issues with indexing
2011/11/2 Bill Baker bill...@billbak.com Got it, quote the string so the spaces don't matter, thanks. NodeType:Bar AND Name:\Bar 1\ seems inconsistent. It has five quotes. I will try this: NodeType:Bar AND Name:\Bar 1\ as I _think_ the version above has unmatched quotes. It's how the java code looks and it's consistent, it's copy-pasted from a passing test with your data that I wrote up for this :) Thanks everyone, I appreciate the help. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Rick Bullotta Sent: Wednesday, November 02, 2011 8:44 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing ...because you have a space character in the name. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Bill Baker [bill...@billbak.com] Sent: Wednesday, November 02, 2011 11:33 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Thanks Mattias. One node is a Foo node and one is a Bar node. Maybe I am being too fancy; I could just use 'NAME' for any type of node. I'm a little confused about the query string below. Should it perhaps be NodeType:Bar AND Name:Bar 1 ? I'm not getting why the property name is inside the quotes for one predicate and not the other (below.) Thanks! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Wednesday, November 02, 2011 3:56 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Hi Bill, Why BarName in one and FooName in the other? I'm assuming you have NodeType/Name for both ok? So... a query like this would look like: nodeIndex.query( NodeType:Bar AND Name:\Bar 1\ ); 2011/11/1 Bill Baker bill...@billbak.com Hello, I have an index and add my nodes to it as I create them. I index two properties, nodeType and nodeName. Later I want to see if a node already exists of a given type and a given name. If it does, I'll use it; otherwise I'll create it (and index it.) (All this is in the Java API.) IndexManager indexMgr = graphDB.index(); IndexNode nodeIndex = indexMgr.forNodes(NodeType); Later on I create a node (newNode) with properties NodeType = Bar and BarName = Bar 1 and another with NodeType = Foo and FooName = Foo 1. nodeIndex.add (newNode, NodeType, Bar); nodeIndex.add (newNode, BarName, Bar 1); nodeIndex.add (newNode2, NodeType, Foo); nodeIndex.add)newNode2, FooName, Foo 1); etc. Still later, I want to see if I already have a node of type Bar with name Bar 1. I read up on the query syntax in 7.7 ( http://docs.neo4j.org/chunked/stable/indexing-search.html) and noticed that the syntax listed there does not support any white space in the query string. So I am looking into how to use Lucene query objects to form my query. But now I'm stumped. I want to get a list (IndexHits is fine) of any nodes in the system that have these two properties (NodeType and BarType) set to specific values. I think there might be more to Lucene Query objects than just TermQuery. Is that in the Neo4j docs, the Lucene docs? Any examples handy? Thanks in advance! Bill -- Bill Baker, Investor, Advisor, Board Member 206-619-0928 My other house is a data warehouse ___ 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 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
Re: [Neo4j] Newbie issues with indexing
Then I will try it straight-up! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Wednesday, November 02, 2011 9:39 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing 2011/11/2 Bill Baker bill...@billbak.com Got it, quote the string so the spaces don't matter, thanks. NodeType:Bar AND Name:\Bar 1\ seems inconsistent. It has five quotes. I will try this: NodeType:Bar AND Name:\Bar 1\ as I _think_ the version above has unmatched quotes. It's how the java code looks and it's consistent, it's copy-pasted from a passing test with your data that I wrote up for this :) Thanks everyone, I appreciate the help. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Rick Bullotta Sent: Wednesday, November 02, 2011 8:44 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing ...because you have a space character in the name. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Bill Baker [bill...@billbak.com] Sent: Wednesday, November 02, 2011 11:33 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Thanks Mattias. One node is a Foo node and one is a Bar node. Maybe I am being too fancy; I could just use 'NAME' for any type of node. I'm a little confused about the query string below. Should it perhaps be NodeType:Bar AND Name:Bar 1 ? I'm not getting why the property name is inside the quotes for one predicate and not the other (below.) Thanks! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Wednesday, November 02, 2011 3:56 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Hi Bill, Why BarName in one and FooName in the other? I'm assuming you have NodeType/Name for both ok? So... a query like this would look like: nodeIndex.query( NodeType:Bar AND Name:\Bar 1\ ); 2011/11/1 Bill Baker bill...@billbak.com Hello, I have an index and add my nodes to it as I create them. I index two properties, nodeType and nodeName. Later I want to see if a node already exists of a given type and a given name. If it does, I'll use it; otherwise I'll create it (and index it.) (All this is in the Java API.) IndexManager indexMgr = graphDB.index(); IndexNode nodeIndex = indexMgr.forNodes(NodeType); Later on I create a node (newNode) with properties NodeType = Bar and BarName = Bar 1 and another with NodeType = Foo and FooName = Foo 1. nodeIndex.add (newNode, NodeType, Bar); nodeIndex.add (newNode, BarName, Bar 1); nodeIndex.add (newNode2, NodeType, Foo); nodeIndex.add)newNode2, FooName, Foo 1); etc. Still later, I want to see if I already have a node of type Bar with name Bar 1. I read up on the query syntax in 7.7 ( http://docs.neo4j.org/chunked/stable/indexing-search.html) and noticed that the syntax listed there does not support any white space in the query string. So I am looking into how to use Lucene query objects to form my query. But now I'm stumped. I want to get a list (IndexHits is fine) of any nodes in the system that have these two properties (NodeType and BarType) set to specific values. I think there might be more to Lucene Query objects than just TermQuery. Is that in the Neo4j docs, the Lucene docs? Any examples handy? Thanks in advance! Bill -- Bill Baker, Investor, Advisor, Board Member 206-619-0928 My other house is a data warehouse ___ 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 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] Node Id generation deadlock
Hi Ran, Each thread creates 2 nodes in the same transaction. The chain of events leading to this seems to be the following: * Thread 1 creates the first node. By the time it leaves createNode(), it will have a write lock on the ID generator node. * Thread 2 creates the first node. It will try to update the ID generator node, but will wait until thread 1 commits the transaction. It's waiting inside a synchronized context, locking on _lock. * Thread 1 creates the second node. It waits for _lock to become available. Now you have a deadlock. The reason that this deadlock is not detected by Neo4j is because it mixes Neo4j and Java synchronization, which is impossible for Neo4j to detect. This can be fixed by replacing the Java synchronization with Neo4j synchronization. Instead of doing a synchronized block, first grab a write lock on the ID generator node by e.g. removing a non-existent property. The thread that gets that lock will then complete its entire transaction before any other thread gets in there. In some scenarios this may effectively serialize your transactions. To avoid this, you can split your transactions in two, where you first allocate the required number of IDs, and commit that transaction with the ID generator node only. Then you enter the second transaction where you actually use the IDs. The tradeoff here is that you may end up allocating IDs that don't get used, e.g. due to machine crashes at the wrong time. David On Wed, Nov 2, 2011 at 12:55 AM, Cres cre...@gmail.com wrote: (Sorry for re-opening this thread, I hadn't yet subscribed to the mailing list when I opened it the previous time, so I had to re-start it..) Hi, I'm using Neo4J version 1.4.1. I've tried following the design guide ( http://wiki.neo4j.org/content/Design_Guide#Make_use_of_Factories ) writing a short program, but when I try to run it, it goes into a deadlock and the application freezes. Basically what my program does is to create a new embedded graph database, initalize a factory node, then it creates two threads where each of them is tasked with creating two nodes, giving them an ID (according to the pattern shown in the design guide), and that's about it. Once I run it, one thread end up on WAIT state, while the other is on MONITOR. Showing the threads dump, I can see that the MONITOR-state thread is waiting for the other thread to release the ID generation method's lock (_lock), and the WAIT-state thread is waiting inside Neo4J's RWLock class, trying to acquire a write lock, but for some reason it's waiting (line 326). It got there from a call in the ID generation method which tries to update the factory node's ID sequence property, as shown in the design guide. I'm appending the code here. I'm aware that this program misses some things (such as shutting down the DB once i'm done, adding the relationship between factory node and created node, and for the createNode() method to actually return a node) - i've left out everything I could to have the least amount of code which makes this problem occur. The code: public class MultiThreadingBasicTest { private final GraphDatabaseService _graphDB; private final Object _lock; private final Node _factoryNode; public static void main(String[] args) { MultiThreadingBasicTest test = new MultiThreadingBasicTest(); test.run(); } public MultiThreadingBasicTest() { _graphDB = new EmbeddedGraphDatabase(/MTBT-graphDB); _lock = new Object(); _factoryNode = createFactoryNode(); } public void run() { Thread[] threads = new Thread[2]; for (int i=0; i threads.length; i++) { threads[i] = new Thread(new Runnable() { @Override public void run() { Transaction tx = _graphDB.beginTx(); try { for (int i=0; i 2; i++) { createNode(); System.out.println(echo from thread + Thread.currentThread().getName()); } tx.success(); } finally { tx.finish(); } } }); } System.out.println(running the threads now); for (Thread thread : threads) { thread.start(); } } private Node createFactoryNode() { Node factoryNode = null; Transaction tx = _graphDB.beginTx(); try { factoryNode = _graphDB.createNode(); tx.success(); } finally { tx.finish(); } return factoryNode; } private void createNode() { long id = generateId(); //Node node =
Re: [Neo4j] Newbie issues with indexing
Got it running, thank you! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Bill Baker Sent: Wednesday, November 02, 2011 9:41 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Then I will try it straight-up! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Wednesday, November 02, 2011 9:39 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing 2011/11/2 Bill Baker bill...@billbak.com Got it, quote the string so the spaces don't matter, thanks. NodeType:Bar AND Name:\Bar 1\ seems inconsistent. It has five quotes. I will try this: NodeType:Bar AND Name:\Bar 1\ as I _think_ the version above has unmatched quotes. It's how the java code looks and it's consistent, it's copy-pasted from a passing test with your data that I wrote up for this :) Thanks everyone, I appreciate the help. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Rick Bullotta Sent: Wednesday, November 02, 2011 8:44 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing ...because you have a space character in the name. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Bill Baker [bill...@billbak.com] Sent: Wednesday, November 02, 2011 11:33 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Thanks Mattias. One node is a Foo node and one is a Bar node. Maybe I am being too fancy; I could just use 'NAME' for any type of node. I'm a little confused about the query string below. Should it perhaps be NodeType:Bar AND Name:Bar 1 ? I'm not getting why the property name is inside the quotes for one predicate and not the other (below.) Thanks! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Wednesday, November 02, 2011 3:56 AM To: Neo4j user discussions Subject: Re: [Neo4j] Newbie issues with indexing Hi Bill, Why BarName in one and FooName in the other? I'm assuming you have NodeType/Name for both ok? So... a query like this would look like: nodeIndex.query( NodeType:Bar AND Name:\Bar 1\ ); 2011/11/1 Bill Baker bill...@billbak.com Hello, I have an index and add my nodes to it as I create them. I index two properties, nodeType and nodeName. Later I want to see if a node already exists of a given type and a given name. If it does, I'll use it; otherwise I'll create it (and index it.) (All this is in the Java API.) IndexManager indexMgr = graphDB.index(); IndexNode nodeIndex = indexMgr.forNodes(NodeType); Later on I create a node (newNode) with properties NodeType = Bar and BarName = Bar 1 and another with NodeType = Foo and FooName = Foo 1. nodeIndex.add (newNode, NodeType, Bar); nodeIndex.add (newNode, BarName, Bar 1); nodeIndex.add (newNode2, NodeType, Foo); nodeIndex.add)newNode2, FooName, Foo 1); etc. Still later, I want to see if I already have a node of type Bar with name Bar 1. I read up on the query syntax in 7.7 ( http://docs.neo4j.org/chunked/stable/indexing-search.html) and noticed that the syntax listed there does not support any white space in the query string. So I am looking into how to use Lucene query objects to form my query. But now I'm stumped. I want to get a list (IndexHits is fine) of any nodes in the system that have these two properties (NodeType and BarType) set to specific values. I think there might be more to Lucene Query objects than just TermQuery. Is that in the Neo4j docs, the Lucene docs? Any examples handy? Thanks in advance! Bill -- Bill Baker, Investor, Advisor, Board Member 206-619-0928 My other house is a data warehouse ___ 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 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
Re: [Neo4j] Tree structure
Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree (http://www.jstree.com/) or a more model visualization using D3 (http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ 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] Tree structure
I've used d3. You do need a bit of JQuery/Javascript skills to munge the data into a form the d3 libraries expect it, but the results are impressive if you do. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Andreas Kollegger [andreas.kolleg...@neotechnology.com] Sent: Wednesday, November 02, 2011 1:52 PM To: Neo4j user discussions Subject: Re: [Neo4j] Tree structure Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree (http://www.jstree.com/) or a more model visualization using D3 (http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ 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] User Digest, Vol 56, Issue 12
I hadn't. I'm still confused about how I would combine that with embedding, though; I don't want to run a standalone neo4j daemon. Because the app I'm embedding into will be running Python, I figure the current setup may not be all that sub-optimal, now that the threading problem is out of the way. Date: Wed, 2 Nov 2011 08:05:18 -0700 From: Peter Neubauer peter.neuba...@neotechnology.com Subject: Re: [Neo4j] Java segfault using paste and Python bindings To: Neo4j user discussions user@lists.neo4j.org Message-ID: CAF59RW4TmPYPF=dd7plpzfwpdtpyfxvfou2fs683jahkgs6...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 Michael, have you looked at http://docs.neo4j.org/chunked/snapshot/rest-api.html for documentation? We probably should promote the manual much more prominently on the site :/ ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Node Id generation deadlock
Hi David, Thank you very much for your response. I can see now what caused the deadlock. However, I'm not really sure how I can solve this problem efficiently - as you mentioned, your proposed solution will effectively serialize my transactions. Unfortunately, it'd be very difficult for me to split each transaction into two in the application I'm currently working on (the code I posted in the first message was just a sample code I wrote to explain the problem more clearly) since there are many transactions which are higher up the chain and are not really nearby the node factory, which is where I want to use your lock-grabbing technique. I thought about creating a nested transaction just for the update for the factory node's idseq property, after which I'd commit (and thereby release the RW lock I grabbed when removing the non-existing property), but I now realize it can't work because nested transactions aren't pure nested and so the lock would remain until the parent transaction commits... Is there any way I could possibly release the lock I have for the node without committing the entire transaction? And since I presume such a way doesn't exist, do you happen to know of any other possible solutions for my problem? Thanks again, Ran. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Node-Id-generation-deadlock-tp3473118p3474747.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] zero fromDepth and toDepth
Hi everybody when setting fromDepth and toDepth both at zero, like in the following code Traversal.description.breadthFirst .evaluator(Evaluators.fromDepth(0)) .evaluator(Evaluators.toDepth(0)) I'm expecting to get only the start node, but I don't. Am I missing anything? Thanks! Cheers Alex -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/zero-fromDepth-and-toDepth-tp3474825p3474825.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] Neo4j Installer in Neography
At SpringOne we were talking about a Neo4j installer as a Ruby Gem. This is not that... but it's a start. https://github.com/maxdemarzi/neography/commit/066ed4fb0ce76b9c648e7fa4bae8c3cdfac6af41 -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Installer-in-Neography-tp3474951p3474951.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] Neo4j Events in November
*** Hi Everyone, Here is a comprehensive list of events we have coming up in November. Check it out below. Remember, check back to http://plancast.com/neo4j for updates throughout the month. If you have any questions regarding participation, feel free to email me at alli...@neotechnology.com. * 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 this technique 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 | Getting Started with Neo4j* Thursday, 17 November 2011* * This webinar is designed to help developers achieve a fast start with Neo4j.. There are no prerequisites. Join this webinar to learn: * basic graph concepts * modeling data in a graph * querying a graph https://www1.gotomeeting.com/register/911016521 *Fort Lauderdale Session | NOSQL: Getting Started with Neo4j* 29 Nov - 2 December 2011* * What is a graph database, why would you use it, and how do you get started? In this session we'll look at the kinds of problems that graph databases can solve and will run through the process of getting started with neo4j By the end of this session you'll have all of the information required to get started with neo4j on your projects. http://therichwebexperience.com/conference/fort_lauderdale/2011/11/session?id=24267https://www1.gotomeeting.com/register/911016521 *** *Allison Sparrow* * **Marketing Manager | Neo Technology* +19499036091 | @ayeeson http://twitter.com/#%21/ayeeson *Allison Sparrow* * **Marketing Manager | Neo Technology* +19499036091 | @ayeeson http://twitter.com/#%21/ayeeson
Re: [Neo4j] Neo4j Events in November
Everyone, for Öredev Open, the first 20 signups are sponsored with the campaign code NEOOPEN11 at http://oredev.org/2011/oredev-open, and registration stops on Friday 17.00 CET. See you 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 - NOSQL for the Enterprise. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. On Wed, Nov 2, 2011 at 1:24 PM, Allison Sparrow alli...@neotechnology.com wrote: *** Hi Everyone, Here is a comprehensive list of events we have coming up in November. Check it out below. Remember, check back to http://plancast.com/neo4j for updates throughout the month. If you have any questions regarding participation, feel free to email me at alli...@neotechnology.com. * 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 this technique 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 | Getting Started with Neo4j* Thursday, 17 November 2011* * This webinar is designed to help developers achieve a fast start with Neo4j.. There are no prerequisites. Join this webinar to learn: * basic graph concepts * modeling data in a graph * querying a graph https://www1.gotomeeting.com/register/911016521 *Fort Lauderdale Session | NOSQL: Getting Started with Neo4j* 29 Nov - 2 December 2011* * What is a graph database, why would you use it, and how do you get started? In
Re: [Neo4j] Neo4j Installer in Neography
This is nice Max! How do I use it? 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 Wed, Nov 2, 2011 at 12:48 PM, maxdemarzi maxdema...@gmail.com wrote: At SpringOne we were talking about a Neo4j installer as a Ruby Gem. This is not that... but it's a start. https://github.com/maxdemarzi/neography/commit/066ed4fb0ce76b9c648e7fa4bae8c3cdfac6af41 -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Installer-in-Neography-tp3474951p3474951.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] Neo4j Installer in Neography
In your Rakefile or “lib/tasks/neography.rake”, add: require 'neography/tasks' It will add the following rake tasks to your project: rake neo4j:install # Install Neo4j to the neo4j directory under your project rake neo4j:start # Start Neo4j rake neo4j:stop # Stop Neo4j rake neo4j:restart # Restart Neo4j rake neo4j:reset_yes_i_am_sure # Wipe your Neo4j Database -- Now... the other way of doing it is to build a gem that has the same files as the distribution like Sunspot::Solr. Sunspot::Solr is a packaged distribution of Solr for use with the Sunspot and Sunspot::Rails gems. See those gems’ documentation for more information. https://github.com/outoftime/sunspot/tree/master/sunspot_solr I'm not sure how you guys feel about that. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Installer-in-Neography-tp3474951p3475227.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] Neo4j Installer in Neography
Ok I read my instructions and they were just overly complicated, so I added a Railtie. Assuming you are on a Rails project, point the gemfile to use the gem from git git 'neography', :git = 'git://github.com/maxdemarzi/neography.git and the tasks will be automatically included for you in your Rails project. check it with rake -T -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Installer-in-Neography-tp3474951p3475364.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] java.lang.IllegalArgumentException launching 1.5M02
Any tips on where to start? I'm going to go looking for ServerProcessConsole.java but any other pointers are welcome. :) C:\AzureTemp\Resources\2e546563-a35c-42f6-b903-03317cfdf847\directory\Neo4jInst\neo4j-community-1.5.M02\binNeo4j.bat java.lang.IllegalArgumentException at java.lang.ProcessImpl.init(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at org.neo4j.wrapper.ServerProcessConsole.doStart(ServerProcessConsole.java:39) at org.neo4j.wrapper.ServerProcess.init(ServerProcess.java:116) at org.neo4j.wrapper.ServerProcessConsole.init(ServerProcessConsole.java:29) at org.neo4j.wrapper.NeoServiceWrapper.launchAsConsoleApp(NeoServiceWrapper.java:48) at org.neo4j.wrapper.NeoServiceWrapper.main(NeoServiceWrapper.java:35) C:\AzureTemp\Resources\2e546563-a35c-42f6-b903-03317cfdf847\directory\Neo4jInst\neo4j-community-1.5.M02\bin -- Tatham Oddie au mob: +61 414 275 989, us cell: +1 415 598 8201, skype: tathamoddie If you're printing this email, you're doing it wrong. This is a computer, not a typewriter. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] java.lang.IllegalArgumentException launching 1.5M02
It was this line in neo4j-wrapper.conf: wrapper.java.additional.3=-Xloggc:data/log/neo4j-gc.log It's commented out by default, but we had it in for some of our perf work. It seems it's no longer compatible with 1.5M02 even though it's still in the default config files (albeit commented out). -- Tatham -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tatham Oddie Sent: Thursday, 3 November 2011 8:56 AM To: Neo4j user discussions Subject: [Neo4j] java.lang.IllegalArgumentException launching 1.5M02 Any tips on where to start? I'm going to go looking for ServerProcessConsole.java but any other pointers are welcome. :) C:\AzureTemp\Resources\2e546563-a35c-42f6-b903-03317cfdf847\directory\Neo4jInst\neo4j-community-1.5.M02\binNeo4j.bat java.lang.IllegalArgumentException at java.lang.ProcessImpl.init(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at org.neo4j.wrapper.ServerProcessConsole.doStart(ServerProcessConsole.java:39) at org.neo4j.wrapper.ServerProcess.init(ServerProcess.java:116) at org.neo4j.wrapper.ServerProcessConsole.init(ServerProcessConsole.java:29) at org.neo4j.wrapper.NeoServiceWrapper.launchAsConsoleApp(NeoServiceWrapper.java:48) at org.neo4j.wrapper.NeoServiceWrapper.main(NeoServiceWrapper.java:35) C:\AzureTemp\Resources\2e546563-a35c-42f6-b903-03317cfdf847\directory\Neo4jInst\neo4j-community-1.5.M02\bin -- Tatham Oddie au mob: +61 414 275 989, us cell: +1 415 598 8201, skype: tathamoddie If you're printing this email, you're doing it wrong. This is a computer, not a typewriter. ___ 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] Cypher questions
Hello, I have some questions regarding Cypher. 1. I have an ontology that defines classes and individuals. I store this ontology into Neo4J REST db. Is there any ways to find all individuals that have some given class? In SPARQL, it can be done like ...WHERE { ?u a :User.}... to find all instances that have a type of User. 2. Similar to the question#1, if I understand correctly in Cypher I always have to start with a known node either by its ID or name. If so how to find any nodes that have some given relationship? For example, I want to find any nodes that have the the relationship type go_to_school. (x)-[:go_to_school]-(n) where (n.name= NotreDame) return x Thank you, ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Debian/Ubuntu packages for Neo4j?
Quick question: has anyone done any work on putting together .deb packages for Neo? And if so, has there been any consideration about getting them into Debian or Ubuntu repositories? Nige ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] 1.5M02 launches then exits immediately
On Windows 7. It launches, opens the network socket, responds to the first REST request with a 200 OK, then promptly exits. This is an upgrade from 1.5M01 which is/was running fine. Full log: http://dl.dropbox.com/u/5216304/2003.01-neo4j.0.0.log Any ideas? I'm not a Java guy so having a hard time working this one out. CONFIG: The EJB interceptor binding API is not available. JAX-RS EJB support is disabled. javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.lookup(Unknown Source) at com.sun.jersey.server.impl.ejb.EJBComponentProviderFactoryInitilizer.initialize(EJBComponentProviderFactoryInitilizer.java:64) at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:574) at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:311) at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:608) at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556) at javax.servlet.GenericServlet.init(GenericServlet.java:241) at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.neo4j.server.web.Jetty6WebServer.startJetty(Jetty6WebServer.java:168) at org.neo4j.server.web.Jetty6WebServer.start(Jetty6WebServer.java:105) at org.neo4j.server.NeoServerWithEmbeddedWebServer.startWebServer(NeoServerWithEmbeddedWebServer.java:227) at org.neo4j.server.NeoServerWithEmbeddedWebServer.start(NeoServerWithEmbeddedWebServer.java:91) at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:87) at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:52) Nov 03, 2011 11:07:33 AM com.sun.jersey.server.impl.cdi.CDIComponentProviderFactoryInitializer initialize CONFIG: The CDI BeanManager is not available. JAX-RS CDI support is disabled. javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.lookup(Unknown Source) at com.sun.jersey.server.impl.cdi.CDIComponentProviderFactoryInitializer.initialize(CDIComponentProviderFactoryInitializer.java:66) at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:576) at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:311) at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:608) at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556) at
Re: [Neo4j] User Digest, Vol 56, Issue 16
Hi , Thanks Andreas Kollegger and Rick Bullotta, i am using vaadin framework. but the issue is.how to build a tree using nodes. becouse we are selecting nodes form different levels of the graph based on some conditions . then i have to merge child node with if the parent nodes are available in the current result. i think i have to do a algorithm for this. is there any easy api available with neo for this kind of task. Please help me with your soulutions. Thanka Emil On Thu, Nov 3, 2011 at 2:31 AM, user-requ...@lists.neo4j.org wrote: Send User mailing list submissions to user@lists.neo4j.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.neo4j.org/mailman/listinfo/user or, via email, send a message with subject or body 'help' to user-requ...@lists.neo4j.org You can reach the person managing the list at user-ow...@lists.neo4j.org When replying, please edit your Subject line so it is more specific than Re: Contents of User digest... Today's Topics: 1. Re: Tree structure (Andreas Kollegger) 2. Re: Tree structure (Rick Bullotta) 3. Re: User Digest, Vol 56, Issue 12 (Michael Rene Armida) 4. Re: Node Id generation deadlock (Cres) 5. zero fromDepth and toDepth (Alex) 6. Neo4j Installer in Neography (maxdemarzi) 7. Neo4j Events in November (Allison Sparrow) 8. Re: Neo4j Events in November (Peter Neubauer) -- Message: 1 Date: Wed, 2 Nov 2011 10:52:44 -0700 From: Andreas Kollegger andreas.kolleg...@neotechnology.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: ab950280-d372-40b0-b270-6cf81bde2...@neotechnology.com Content-Type: text/plain; charset=us-ascii Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Message: 2 Date: Wed, 2 Nov 2011 10:53:54 -0700 From: Rick Bullotta rick.bullo...@thingworx.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: 09df3402c845ec489a3323a06208f20d1b46e...@p3pw5ex1mb14.ex1.secureserver.net Content-Type: text/plain; charset=us-ascii I've used d3. You do need a bit of JQuery/Javascript skills to munge the data into a form the d3 libraries expect it, but the results are impressive if you do. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Andreas Kollegger [andreas.kolleg...@neotechnology.com] Sent: Wednesday, November 02, 2011 1:52 PM To: Neo4j user discussions Subject: Re: [Neo4j] Tree structure Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ 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 -- Message: 3 Date: Wed, 2 Nov 2011 11:05:02 -0700 From: Michael Rene Armida m...@marmida.com Subject: Re: [Neo4j] User Digest, Vol 56, Issue 12 To: user@lists.neo4j.org Message-ID: CAPeGkJ4Vm3gKHr=zlolbnrchdx51wnrb+hcfbfo-5p42e9u...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 I hadn't. I'm still confused
Re: [Neo4j] Cypher questions
Both your questions would be answered with indexing: for the 1) you would add the user nodes them to a User index and then use start user=node:User(id:*) ... For 2) you would index the relationships-similarly (for the interesting types). e.g. create an index for only the rel-type you're interested in: index().forRelationships(go_to_school).add(rel, key,value) key and value are arbitrary things, but you might leverage them with sensible data in your domain model. start r = relationship:go_to_school(field:*) match (x)-[r]-(n) where n.name = Notre Dame return x !! usually you would probably rather index the schools, and look them up directly start school = node:schools(name,{school_name}) match pupil-[:go_to_school]-school return pupil (You could use auto-indexing for both if that is useful for you, the index-names would then be node_auto_index and relationship_auto_index, see : http://docs.neo4j.org/chunked/snapshot/auto-indexing.htmlhttp://docs.neo4j.org/chunked/snapshot/rest-api-auto-indexes.html ) Am 03.11.2011 um 00:35 schrieb andrew ton: Hello, I have some questions regarding Cypher. 1. I have an ontology that defines classes and individuals. I store this ontology into Neo4J REST db. Is there any ways to find all individuals that have some given class? In SPARQL, it can be done like ...WHERE { ?u a :User.}... to find all instances that have a type of User. 2. Similar to the question#1, if I understand correctly in Cypher I always have to start with a known node either by its ID or name. If so how to find any nodes that have some given relationship? For example, I want to find any nodes that have the the relationship type go_to_school. (x)-[:go_to_school]-(n) where (n.name= NotreDame) return x Thank you, ___ 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] Neo4j Installer in Neography
This is typical Ruby-fluff. Where is my verbose Java! This is too short. 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 Wed, Nov 2, 2011 at 2:55 PM, maxdemarzi maxdema...@gmail.com wrote: Ok I read my instructions and they were just overly complicated, so I added a Railtie. Assuming you are on a Rails project, point the gemfile to use the gem from git git 'neography', :git = 'git://github.com/maxdemarzi/neography.git and the tasks will be automatically included for you in your Rails project. check it with rake -T -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Installer-in-Neography-tp3474951p3475364.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] java.lang.IllegalArgumentException launching 1.5M02
Tatham, could you please open an issue in https://github.com/neo4j/packaging/issues so we can sort it out? 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 Wed, Nov 2, 2011 at 3:37 PM, Tatham Oddie tat...@oddie.com.au wrote: It was this line in neo4j-wrapper.conf: wrapper.java.additional.3=-Xloggc:data/log/neo4j-gc.log It's commented out by default, but we had it in for some of our perf work. It seems it's no longer compatible with 1.5M02 even though it's still in the default config files (albeit commented out). -- Tatham -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tatham Oddie Sent: Thursday, 3 November 2011 8:56 AM To: Neo4j user discussions Subject: [Neo4j] java.lang.IllegalArgumentException launching 1.5M02 Any tips on where to start? I'm going to go looking for ServerProcessConsole.java but any other pointers are welcome. :) C:\AzureTemp\Resources\2e546563-a35c-42f6-b903-03317cfdf847\directory\Neo4jInst\neo4j-community-1.5.M02\binNeo4j.bat java.lang.IllegalArgumentException at java.lang.ProcessImpl.init(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at org.neo4j.wrapper.ServerProcessConsole.doStart(ServerProcessConsole.java:39) at org.neo4j.wrapper.ServerProcess.init(ServerProcess.java:116) at org.neo4j.wrapper.ServerProcessConsole.init(ServerProcessConsole.java:29) at org.neo4j.wrapper.NeoServiceWrapper.launchAsConsoleApp(NeoServiceWrapper.java:48) at org.neo4j.wrapper.NeoServiceWrapper.main(NeoServiceWrapper.java:35) C:\AzureTemp\Resources\2e546563-a35c-42f6-b903-03317cfdf847\directory\Neo4jInst\neo4j-community-1.5.M02\bin -- Tatham Oddie au mob: +61 414 275 989, us cell: +1 415 598 8201, skype: tathamoddie If you're printing this email, you're doing it wrong. This is a computer, not a typewriter. ___ 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] User Digest, Vol 56, Issue 16
Emil, I am not totally following your thoughts (would be great with an example in pictures). Have you looked at Cypher tree structure handling, e.g. http://docs.neo4j.org/chunked/snapshot/examples-acl-structures-in-graphs.html#_read_permission_example to find some inspiration? 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 Wed, Nov 2, 2011 at 5:18 PM, Emil Dombagolla em...@hsenidoutsourcing.com wrote: Hi , Thanks Andreas Kollegger and Rick Bullotta, i am using vaadin framework. but the issue is.how to build a tree using nodes. becouse we are selecting nodes form different levels of the graph based on some conditions . then i have to merge child node with if the parent nodes are available in the current result. i think i have to do a algorithm for this. is there any easy api available with neo for this kind of task. Please help me with your soulutions. Thanka Emil On Thu, Nov 3, 2011 at 2:31 AM, user-requ...@lists.neo4j.org wrote: Send User mailing list submissions to user@lists.neo4j.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.neo4j.org/mailman/listinfo/user or, via email, send a message with subject or body 'help' to user-requ...@lists.neo4j.org You can reach the person managing the list at user-ow...@lists.neo4j.org When replying, please edit your Subject line so it is more specific than Re: Contents of User digest... Today's Topics: 1. Re: Tree structure (Andreas Kollegger) 2. Re: Tree structure (Rick Bullotta) 3. Re: User Digest, Vol 56, Issue 12 (Michael Rene Armida) 4. Re: Node Id generation deadlock (Cres) 5. zero fromDepth and toDepth (Alex) 6. Neo4j Installer in Neography (maxdemarzi) 7. Neo4j Events in November (Allison Sparrow) 8. Re: Neo4j Events in November (Peter Neubauer) -- Message: 1 Date: Wed, 2 Nov 2011 10:52:44 -0700 From: Andreas Kollegger andreas.kolleg...@neotechnology.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: ab950280-d372-40b0-b270-6cf81bde2...@neotechnology.com Content-Type: text/plain; charset=us-ascii Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Message: 2 Date: Wed, 2 Nov 2011 10:53:54 -0700 From: Rick Bullotta rick.bullo...@thingworx.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: 09df3402c845ec489a3323a06208f20d1b46e...@p3pw5ex1mb14.ex1.secureserver.net Content-Type: text/plain; charset=us-ascii I've used d3. You do need a bit of JQuery/Javascript skills to munge the data into a form the d3 libraries expect it, but the results are impressive if you do. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Andreas Kollegger [andreas.kolleg...@neotechnology.com] Sent: Wednesday, November 02, 2011 1:52 PM To: Neo4j user discussions Subject: Re: [Neo4j] Tree structure Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to
Re: [Neo4j] User Digest, Vol 56, Issue 16
Something you could probably do is to return paths from cypher or traversal and then pick the nodes off the paths that you're interested in - from the path you get the tree-structure aka. the path's to the root of your tree. From the information extracted there you can build your composite object/structure which can then be rendered whatever technique you'd like to use. If I understood you correctly the challenge was how to keep the structural information which nodes are in which position of the hierarchy ? Cheers Michael Am 03.11.2011 um 01:18 schrieb Emil Dombagolla: Hi , Thanks Andreas Kollegger and Rick Bullotta, i am using vaadin framework. but the issue is.how to build a tree using nodes. becouse we are selecting nodes form different levels of the graph based on some conditions . then i have to merge child node with if the parent nodes are available in the current result. i think i have to do a algorithm for this. is there any easy api available with neo for this kind of task. Please help me with your soulutions. Thanka Emil On Thu, Nov 3, 2011 at 2:31 AM, user-requ...@lists.neo4j.org wrote: Send User mailing list submissions to user@lists.neo4j.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.neo4j.org/mailman/listinfo/user or, via email, send a message with subject or body 'help' to user-requ...@lists.neo4j.org You can reach the person managing the list at user-ow...@lists.neo4j.org When replying, please edit your Subject line so it is more specific than Re: Contents of User digest... Today's Topics: 1. Re: Tree structure (Andreas Kollegger) 2. Re: Tree structure (Rick Bullotta) 3. Re: User Digest, Vol 56, Issue 12 (Michael Rene Armida) 4. Re: Node Id generation deadlock (Cres) 5. zero fromDepth and toDepth (Alex) 6. Neo4j Installer in Neography (maxdemarzi) 7. Neo4j Events in November (Allison Sparrow) 8. Re: Neo4j Events in November (Peter Neubauer) -- Message: 1 Date: Wed, 2 Nov 2011 10:52:44 -0700 From: Andreas Kollegger andreas.kolleg...@neotechnology.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: ab950280-d372-40b0-b270-6cf81bde2...@neotechnology.com Content-Type: text/plain; charset=us-ascii Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Message: 2 Date: Wed, 2 Nov 2011 10:53:54 -0700 From: Rick Bullotta rick.bullo...@thingworx.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: 09df3402c845ec489a3323a06208f20d1b46e...@p3pw5ex1mb14.ex1.secureserver.net Content-Type: text/plain; charset=us-ascii I've used d3. You do need a bit of JQuery/Javascript skills to munge the data into a form the d3 libraries expect it, but the results are impressive if you do. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Andreas Kollegger [andreas.kolleg...@neotechnology.com] Sent: Wednesday, November 02, 2011 1:52 PM To: Neo4j user discussions Subject: Re: [Neo4j] Tree structure Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ Neo4j mailing
Re: [Neo4j] Debian/Ubuntu packages for Neo4j?
There is the work Jake has been doing at https://github.com/jakewins/neo4j-server-debian . I would love if you could fork and update? Anders has made first attempts to set up a launchpad repo, not sure what the state there is. Welcome to chime in! 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 Wed, Nov 2, 2011 at 4:40 PM, Nigel Small ni...@nigelsmall.name wrote: Quick question: has anyone done any work on putting together .deb packages for Neo? And if so, has there been any consideration about getting them into Debian or Ubuntu repositories? Nige ___ 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] 1.5M02 launches then exits immediately
Tatham, can you recreate this with a vanilla 1.5.M02 install and a clean database? In that case, in what folder, and can you send over the full installation? Just open a ticket in https://github.com/neo4j/packaging/issues so we can sort it out. 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 Wed, Nov 2, 2011 at 5:15 PM, Tatham Oddie tat...@oddie.com.au wrote: On Windows 7. It launches, opens the network socket, responds to the first REST request with a 200 OK, then promptly exits. This is an upgrade from 1.5M01 which is/was running fine. Full log: http://dl.dropbox.com/u/5216304/2003.01-neo4j.0.0.log Any ideas? I'm not a Java guy so having a hard time working this one out. CONFIG: The EJB interceptor binding API is not available. JAX-RS EJB support is disabled. javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.lookup(Unknown Source) at com.sun.jersey.server.impl.ejb.EJBComponentProviderFactoryInitilizer.initialize(EJBComponentProviderFactoryInitilizer.java:64) at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:574) at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:311) at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:608) at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556) at javax.servlet.GenericServlet.init(GenericServlet.java:241) at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.neo4j.server.web.Jetty6WebServer.startJetty(Jetty6WebServer.java:168) at org.neo4j.server.web.Jetty6WebServer.start(Jetty6WebServer.java:105) at org.neo4j.server.NeoServerWithEmbeddedWebServer.startWebServer(NeoServerWithEmbeddedWebServer.java:227) at org.neo4j.server.NeoServerWithEmbeddedWebServer.start(NeoServerWithEmbeddedWebServer.java:91) at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:87) at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:52) Nov 03, 2011 11:07:33 AM com.sun.jersey.server.impl.cdi.CDIComponentProviderFactoryInitializer initialize CONFIG: The CDI BeanManager is not available. JAX-RS CDI support is disabled. javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.lookup(Unknown Source) at
Re: [Neo4j] zero fromDepth and toDepth
Alex, looking at the source, the Evaluators.toDepth() does: public static Evaluator toDepth( final int depth ) { return new Evaluator() { public Evaluation evaluate( Path path ) { return path.length() depth ? Evaluation.INCLUDE_AND_CONTINUE : Evaluation.INCLUDE_AND_PRUNE; } }; } So it won't work. However, question is if it should be inclusive or not. WDYAT? I could change it to return path.length() = depth ? Evaluation.INCLUDE_AND_CONTINUE : Evaluation.INCLUDE_AND_PRUNE; 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 Wed, Nov 2, 2011 at 11:59 AM, Alex a...@auv.name wrote: Hi everybody when setting fromDepth and toDepth both at zero, like in the following code Traversal.description.breadthFirst .evaluator(Evaluators.fromDepth(0)) .evaluator(Evaluators.toDepth(0)) I'm expecting to get only the start node, but I don't. Am I missing anything? Thanks! Cheers Alex -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/zero-fromDepth-and-toDepth-tp3474825p3474825.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] Cypher questions
Andrew, we have been trying to keep things very tight and document most of the functionality in the manual. See even some domain examples that have Cypher in them, http://docs.neo4j.org/chunked/snapshot/domain-modeling-gallery.html What else would you like to see? 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 Wed, Nov 2, 2011 at 7:32 PM, andrew ton andrewt...@yahoo.com wrote: Hi Michael, Thank you very much! Your answers are very helpful to me. Although I have read the manual enclosed in the neo4j package I downloaded I did not know that we can use * wildcard for any ids or names. Besides the manual what other resources can I find to understand more about Cypher? Appreciated your help. A. From: Michael Hunger michael.hun...@neotechnology.com To: Neo4j user discussions user@lists.neo4j.org Sent: Wednesday, November 2, 2011 5:31 PM Subject: Re: [Neo4j] Cypher questions Both your questions would be answered with indexing: for the 1) you would add the user nodes them to a User index and then use start user=node:User(id:*) ... For 2) you would index the relationships-similarly (for the interesting types). e.g. create an index for only the rel-type you're interested in: index().forRelationships(go_to_school).add(rel, key,value) key and value are arbitrary things, but you might leverage them with sensible data in your domain model. start r = relationship:go_to_school(field:*) match (x)-[r]-(n) where n.name = Notre Dame return x !! usually you would probably rather index the schools, and look them up directly start school = node:schools(name,{school_name}) match pupil-[:go_to_school]-school return pupil (You could use auto-indexing for both if that is useful for you, the index-names would then be node_auto_index and relationship_auto_index, see : http://docs.neo4j.org/chunked/snapshot/auto-indexing.htmlhttp://docs.neo4j.org/chunked/snapshot/rest-api-auto-indexes.html ) Am 03.11.2011 um 00:35 schrieb andrew ton: Hello, I have some questions regarding Cypher. 1. I have an ontology that defines classes and individuals. I store this ontology into Neo4J REST db. Is there any ways to find all individuals that have some given class? In SPARQL, it can be done like ...WHERE { ?u a :User.}... to find all instances that have a type of User. 2. Similar to the question#1, if I understand correctly in Cypher I always have to start with a known node either by its ID or name. If so how to find any nodes that have some given relationship? For example, I want to find any nodes that have the the relationship type go_to_school. (x)-[:go_to_school]-(n) where (n.name= NotreDame) return x Thank you, ___ 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] zero fromDepth and toDepth
What about atDepth(0) ? Michael Am 03.11.2011 um 03:33 schrieb Peter Neubauer: Alex, looking at the source, the Evaluators.toDepth() does: public static Evaluator toDepth( final int depth ) { return new Evaluator() { public Evaluation evaluate( Path path ) { return path.length() depth ? Evaluation.INCLUDE_AND_CONTINUE : Evaluation.INCLUDE_AND_PRUNE; } }; } So it won't work. However, question is if it should be inclusive or not. WDYAT? I could change it to return path.length() = depth ? Evaluation.INCLUDE_AND_CONTINUE : Evaluation.INCLUDE_AND_PRUNE; 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 Wed, Nov 2, 2011 at 11:59 AM, Alex a...@auv.name wrote: Hi everybody when setting fromDepth and toDepth both at zero, like in the following code Traversal.description.breadthFirst .evaluator(Evaluators.fromDepth(0)) .evaluator(Evaluators.toDepth(0)) I'm expecting to get only the start node, but I don't. Am I missing anything? Thanks! Cheers Alex -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/zero-fromDepth-and-toDepth-tp3474825p3474825.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 ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Cypher questions
the Neo4j-indexing provider (which is also used by Cypher) is lucene, so the default lucene query syntax works in the neo4j core API and Cypher queries. http://lucene.apache.org/java/3_4_0/queryparsersyntax.html Michael Am 03.11.2011 um 03:32 schrieb andrew ton: Hi Michael, Thank you very much! Your answers are very helpful to me. Although I have read the manual enclosed in the neo4j package I downloaded I did not know that we can use * wildcard for any ids or names. Besides the manual what other resources can I find to understand more about Cypher? Appreciated your help. A. From: Michael Hunger michael.hun...@neotechnology.com To: Neo4j user discussions user@lists.neo4j.org Sent: Wednesday, November 2, 2011 5:31 PM Subject: Re: [Neo4j] Cypher questions Both your questions would be answered with indexing: for the 1) you would add the user nodes them to a User index and then use start user=node:User(id:*) ... For 2) you would index the relationships-similarly (for the interesting types). e.g. create an index for only the rel-type you're interested in: index().forRelationships(go_to_school).add(rel, key,value) key and value are arbitrary things, but you might leverage them with sensible data in your domain model. start r = relationship:go_to_school(field:*) match (x)-[r]-(n) where n.name = Notre Dame return x !! usually you would probably rather index the schools, and look them up directly start school = node:schools(name,{school_name}) match pupil-[:go_to_school]-school return pupil (You could use auto-indexing for both if that is useful for you, the index-names would then be node_auto_index and relationship_auto_index, see : http://docs.neo4j.org/chunked/snapshot/auto-indexing.htmlhttp://docs.neo4j.org/chunked/snapshot/rest-api-auto-indexes.html ) Am 03.11.2011 um 00:35 schrieb andrew ton: Hello, I have some questions regarding Cypher. 1. I have an ontology that defines classes and individuals. I store this ontology into Neo4J REST db. Is there any ways to find all individuals that have some given class? In SPARQL, it can be done like ...WHERE { ?u a :User.}... to find all instances that have a type of User. 2. Similar to the question#1, if I understand correctly in Cypher I always have to start with a known node either by its ID or name. If so how to find any nodes that have some given relationship? For example, I want to find any nodes that have the the relationship type go_to_school. (x)-[:go_to_school]-(n) where (n.name= NotreDame) return x Thank you, ___ 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] zero fromDepth and toDepth
Hi Peter it admittedly makes little sense to use fromDepth(0) toDepth(0) because there's obviously no need to run the query at all. Anyway, I'd expect a behavior consistent with, for example fromDepth(1) toDepth(1), which returns only nodes at depth 1 (if I'm not mistaken). So, I'd definitely modify the code for the sake of consistency. For the same reason, atDepth(0) should also return the start node. Cheers Alex -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/zero-fromDepth-and-toDepth-tp3474825p3476040.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] zero fromDepth and toDepth
Well, fromDepth is public static Evaluator fromDepth( final int depth ) { return new Evaluator() { public Evaluation evaluate( Path path ) { return path.length() depth ? Evaluation.EXCLUDE_AND_CONTINUE : Evaluation.INCLUDE_AND_CONTINUE; } }; } So it is inclusive. Given these, fromDepth(1) toDepth(1) will not return anything. Have not checked though. Feels like you have a point there. Mattias, WDYT? Also, atDepth(0) should return the start node? public static Evaluator atDepth( final int depth ) { return new Evaluator() { public Evaluation evaluate( Path path ) { return path.length() depth ? Evaluation.EXCLUDE_AND_CONTINUE : Evaluation.INCLUDE_AND_PRUNE; } }; } /peter 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 Wed, Nov 2, 2011 at 7:51 PM, Alex a...@auv.name wrote: Hi Peter it admittedly makes little sense to use fromDepth(0) toDepth(0) because there's obviously no need to run the query at all. Anyway, I'd expect a behavior consistent with, for example fromDepth(1) toDepth(1), which returns only nodes at depth 1 (if I'm not mistaken). So, I'd definitely modify the code for the sake of consistency. For the same reason, atDepth(0) should also return the start node. Cheers Alex -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/zero-fromDepth-and-toDepth-tp3474825p3476040.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] zero fromDepth and toDepth
That sounds a bit bizarre: in my code, fromDepth(n) toDepth(n) seems to be working like atDepth(n) if n0 (that's what should be happening, isn't it?) Alex -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/zero-fromDepth-and-toDepth-tp3474825p3476058.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] zero fromDepth and toDepth
Mmmh, let me do a testcase on this ... can you raise an issue? 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 Wed, Nov 2, 2011 at 8:04 PM, Alex a...@auv.name wrote: That sounds a bit bizarre: in my code, fromDepth(n) toDepth(n) seems to be working like atDepth(n) if n0 (that's what should be happening, isn't it?) Alex -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/zero-fromDepth-and-toDepth-tp3474825p3476058.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] zero fromDepth and toDepth
Done: http://neo4jdb.lighthouseapp.com/projects/77609-neo4j-community/tickets/17-consisnte-behavior-of-fromdepth-todepth-and-atdepth there's a typo in the title... time to get some sleep :) Alex -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/zero-fromDepth-and-toDepth-tp3474825p3476080.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] Python embedding: problems with shutdown and threads
I'm having some weird problems with threading on shutdown. As I previously discovered, using neo4j in a multi-threaded Python app requires complete segregation of neo4j into a single thread. That all works fine for creating a database, however, it appears that shutting one down is a bit of a mystery. I wrote a test program to minimally illustrate the difficulty: http://pastebin.com/gg204kae Threading is always easy to get wrong, so I added a simple switch to remove neo4j from the picture. When I disable neo, the program starts up and shuts down cleanly. When I re-enable neo, some of the print statements never get run, and the app mysteriously exits. I am testing this by saving it into a script and running it on the command line. Any time after the worker thread finishes creating the neo db, I hit ctrl-c, and the two scenarios play out as above. It seems that the embedded Python API is not exactly at the forefront of popular use, and so I understand if nobody knows what's up with this. I just thought I should add something, for the record. I hope my script doesn't have an obvious bug. Thanks, Michael ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Python embedding: problems with shutdown and threads
Here are a few notes of my own from using Neo4j with Python embedded. I know that this isn't the right place . Ubuntu doesn't set $JAVA_HOME. I ended up hard coding the location of my JVM. I seem to encounter unclean shutdowns all the time when running with the iPython REPL. Is there a db.shutdown() command that I've been neglecting to use? Tim On 3 November 2011 17:28, Michael Rene Armida m...@marmida.com wrote: I'm having some weird problems with threading on shutdown. As I previously discovered, using neo4j in a multi-threaded Python app requires complete segregation of neo4j into a single thread. That all works fine for creating a database, however, it appears that shutting one down is a bit of a mystery. I wrote a test program to minimally illustrate the difficulty: http://pastebin.com/gg204kae Threading is always easy to get wrong, so I added a simple switch to remove neo4j from the picture. When I disable neo, the program starts up and shuts down cleanly. When I re-enable neo, some of the print statements never get run, and the app mysteriously exits. I am testing this by saving it into a script and running it on the command line. Any time after the worker thread finishes creating the neo db, I hit ctrl-c, and the two scenarios play out as above. It seems that the embedded Python API is not exactly at the forefront of popular use, and so I understand if nobody knows what's up with this. I just thought I should add something, for the record. I hope my script doesn't have an obvious bug. Thanks, Michael ___ 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