[Neo4j] Using Spring Data Graph with REST
Hi I am using Neo4j over REST technology (Neo4j Server) Is it recommended to use the Spring Data Graph also? If so what are the pros. in such case? 10x! -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Using-Spring-Data-Graph-with-REST-tp3253069p3253069.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] Defining relationships declaritavely or with annotations
Have you enabled AspectJ support for your project? You should have the aspectj plugin installed and your project should show an AJ symbol on its icon. AspectJ will introduce this and other methods and functionality on classes annotated with @NodeEntity. Please look here for details: http://static.springsource.org/spring-data/data-graph/snapshot-site/reference/html/#reference:aspectj Please report back if it doesn't solve your problems. Thanks Michael Am 14.08.2011 um 00:55 schrieb etc1: Mike, Using Spring Data Graph, when defining a node entity using annotations... @NodeEntity public class User... ... the following code not work compileEclipse complains that the persist() method is not defined for class User, which is true, but in the imdb sample project it's coded the same way for Actor, Movie, etc. What am I missing? ..new User(...).persist(); -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Michael Hunger Sent: Monday, August 08, 2011 8:59 PM To: Neo4j user discussions Subject: Re: [Neo4j] Defining relationships declaritavely or with annotations What does make you think it not being very mature? As one of the project leads I'm very interested in your thorough evaluation. There are other libraries that follow a similar approach (annotation based mapping), like jo4neo. Neo4j itself is about the core-database, higher level bindings or drivers are provided mostly by the community. Michael Am 09.08.2011 um 02:44 schrieb etc1: Hi Michael, I saw that, but it does not look very mature. Does neo4j offer any other options aside from doing it in the code? XML config, etc, anything but hardcoding programmatically. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Michael Hunger Sent: Monday, August 08, 2011 8:41 PM To: Neo4j user discussions Subject: Re: [Neo4j] Defining relationships declaritavely or with annotations You might look into Spring Data Graph for a declarative object graph mapping. See: http://springsource.org/spring-data/neo4j http://bit.ly/sdg-html Cheers Michael Am 09.08.2011 um 02:34 schrieb etc1: Hi, Is it possible to define relationships using declarative configuration or annotations? The Getting Started guide illustrates how to do it programmatically, but I prefer to keep relationship mappings outside of the code, it will be easier to maintain. Thanks ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@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] Very Slow Transaction only on Windows
Hi Michael, your heap is smaller than that: see the line from messages.log: Thu Aug 11 12:05:17 PDT 2011: Physical mem: 3006MB, Heap size: 668MB Please provide your JVM with a larger heap setting like -Xmx4G Can you please upgrade your memory mapped config to take about 2G of that (in windows memory mapped memory is taken from the heap). If you start neo4j programmatically you can pass in a Map for that (see also http://wiki.neo4j.org/content/Configuration_Settings#Memory_mapped_I.2FO_settings) Current settings are in messages.log: Thu Aug 11 12:05:17 PDT 2011: neostore.nodestore.db.mapped_memory=20M Thu Aug 11 12:05:17 PDT 2011: neostore.propertystore.db.arrays.mapped_memory=130M Thu Aug 11 12:05:17 PDT 2011: neostore.propertystore.db.index.keys.mapped_memory=1M Thu Aug 11 12:05:17 PDT 2011: neostore.propertystore.db.index.mapped_memory=1M Thu Aug 11 12:05:17 PDT 2011: neostore.propertystore.db.mapped_memory=90M Thu Aug 11 12:05:17 PDT 2011: neostore.propertystore.db.strings.mapped_memory=130M Thu Aug 11 12:05:17 PDT 2011: neostore.relationshipstore.db.mapped_memory=100M I also saw you're running Java7 on that one, right now we have no performance tests on Java7. Just to mention it. Btw. even on Kei's Macbook it shouldn't take a second to add 1000 vertices. Rather around a few milliseconds. Don't know what kind of overhead, the blueprints / cytoscape managers around the neo4j core add. I'm blueprints has a auto-tx mode where there is a new tx per each operation and you have to disable that (if you use external tx-managment). Cheers Michael Am 14.08.2011 um 05:00 schrieb Michael Kirby: Hello, Here is my messages.log , I also recently got a new computer and it takes about 3 seconds on that one. The heap for it 1809 MB. Thu Aug 11 12:05:17 PDT 2011: Opened [target\neo4jDB\nioneo_logical.log.1] clean empty log, version=0 Thu Aug 11 12:05:17 PDT 2011: Opened [C:\Users\Michael\blueprints-graph-cytoscapeMaster\target\neo4jDB\index\lucene.log.1] clean empty log, version=0 Thu Aug 11 12:05:17 PDT 2011: TM opening log: target\neo4jDB\tm_tx_log.2 Thu Aug 11 12:05:17 PDT 2011: --- CONFIGURATION START --- Thu Aug 11 12:05:17 PDT 2011: Physical mem: 3006MB, Heap size: 668MB Thu Aug 11 12:05:17 PDT 2011: Kernel version: Neo4j - Graph Database Kernel 1.4.1 Thu Aug 11 12:05:17 PDT 2011: Neo4j - Graph Database Kernel 1.4.1 Thu Aug 11 12:05:17 PDT 2011: Operating System: Windows 7; version: 6.1; arch: amd64; cpus: 2 Thu Aug 11 12:05:17 PDT 2011: VM Name: Java HotSpot(TM) 64-Bit Server VM Thu Aug 11 12:05:17 PDT 2011: VM Vendor: Sun Microsystems Inc. Thu Aug 11 12:05:17 PDT 2011: VM Version: 17.0-b17 Thu Aug 11 12:05:17 PDT 2011: Boot Class Path: C:\Java\jdk1.6.0_21\jre\lib\resources.jar;C:\Java\jdk1.6.0_21\jre\lib\rt.jar;C:\Java\jdk1.6.0_21\jre\lib\sunrsasign.jar;C:\Java\jdk1.6.0_21\jre\lib\jsse.jar;C:\Java\jdk1.6.0_21\jre\lib\jce.jar;C:\Java\jdk1.6.0_21\jre\lib\charsets.jar;C:\Java\jdk1.6.0_21\jre\classes Thu Aug 11 12:05:17 PDT 2011: Class Path: C:\Users\Michael\blueprints-graph-cytoscapeMaster\target\test-classes;C:\Users\Michael\blueprints-graph-cytoscapeMaster\target\classes;C:\Users\Michael\workspace\api-parent\model-api\target\classes;C:\Users\Michael\.m2\repository\org\cytoscape\event-api\3.0.0-alpha6-SNAPSHOT\event-api-3.0.0-alpha6-SNAPSHOT.jar;C:\Users\Michael\.m2\repository\org\cytoscape\work-api\3.0.0-alpha6-SNAPSHOT\work-api-3.0.0-alpha6-SNAPSHOT.jar;C:\Users\Michael\.m2\repository\org\cytoscape\wrappers\tinkerpop-blueprints-core\0.9\tinkerpop-blueprints-core-0.9.jar;C:\Users\Michael\.m2\repository\org\cytoscape\wrappers\tinkerpop-blueprints-neo4j-graph\0.9\tinkerpop-blueprints-neo4j-graph-0.9.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-kernel\1.4.1\neo4j-kernel-1.4.1.jar;C:\Users\Michael\.m2\repository\org\apache\geronimo\specs\geronimo-jta_1.1_spec\1.1.1\geronimo-jta_1.1_spec-1.1.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-lucene-index\1.4.1\neo4j-lucene-index-1. 4.1.jar;C:\Users\Michael\.m2\repository\org\apache\lucene\lucene-core\3.1.0\lucene-core-3.1.0.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-graph-algo\1.4.1\neo4j-graph-algo-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-udc\1.4.1\neo4j-udc-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-graph-matching\1.4.1\neo4j-graph-matching-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-cypher\1.4.1\neo4j-cypher-1.4.1.jar;C:\Users\Michael\.m2\repository\org\scala-lang\scala-library\2.9.0-1\scala-library-2.9.0-1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-jmx\1.4.1\neo4j-jmx-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-kernel\1.4.1\neo4j-kernel-1.4.1-tests.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-ha\1.3\neo4j-ha-1.3.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-backup\1.3\neo4j-backup-1.3.jar;C:\Users\Michael\.m2\repository\org\apache\zookeeper\zookeeper\3.3.2\zookeeper-3.3.2.jar;C:\Users\Mi
[Neo4j] Finding paths between two nodes
Hello, i'm new in this list, I'm using neo4j REST API with PHP, i need to find a paths between two nodes, but crossing with other node. For example: i have: A link with B B link with C C link with D D link with E and A link with E can i find a path between A and E crossing with the node B or C ? Sorry, but i doit find it in the manual. Many thanks in advance ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Finding paths between two nodes
I guess you could do something like this. http://components.neo4j.org/neo4j-server/milestone/rest.html#Finding_a_path_between_two_nodes -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Finding-paths-between-two-nodes-tp3253279p3253284.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] Delete followed by traverse: possible race condition?
I'm deleting a node and then immediately doing a traverse, and the traverse sometimes returns the deleted node. Am I clearly at fault here? Or could this indeed be coming from the Neo4j server? (E.g. a caching issue?) This happens consistently, but not always, maybe around 50%-75% of the time. I'm using the REST API. The node is always truly deleted from the graph whenever I manually check after this happens, and if I re-traverse, the node is gone as it should be, so this suggests it's a caching or timing issue. Any ideas? I'll keep debugging to make sure it's not something I'm doing wrong... Thanks, Aseem ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Delete followed by traverse: possible race condition?
Related, I had noticed that immediately after adding a node (and connecting it), the same traverse doesn't usually return that node, but the next traverse always does. This feels like the same issue -- a caching or timing one -- just one that never caused an error in our app. The deleting does cause an error, because attempting to then do a second traverse from that deleted node invariably results in an error since the node has been deleted. Aseem On Sun, Aug 14, 2011 at 2:37 AM, Aseem Kishore aseem.kish...@gmail.comwrote: I'm deleting a node and then immediately doing a traverse, and the traverse sometimes returns the deleted node. Am I clearly at fault here? Or could this indeed be coming from the Neo4j server? (E.g. a caching issue?) This happens consistently, but not always, maybe around 50%-75% of the time. I'm using the REST API. The node is always truly deleted from the graph whenever I manually check after this happens, and if I re-traverse, the node is gone as it should be, so this suggests it's a caching or timing issue. Any ideas? I'll keep debugging to make sure it's not something I'm doing wrong... Thanks, Aseem ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Finding paths between two nodes
I had already read this, but i can not find how to specify an intermediate node. I am interested in finding a route between two cities crossing another city that I will choose. 2011/8/14 noppanit noppani...@gmail.com: I guess you could do something like this. http://components.neo4j.org/neo4j-server/milestone/rest.html#Finding_a_path_between_two_nodes -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Finding-paths-between-two-nodes-tp3253279p3253284.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] Delete followed by traverse: possible race condition?
Are the two operations executed serially? I.e. does the delete return with a correct response code (and the connection is closed afterwards). And then the traverse is started? Otherwise they might execute in parallel (multithreaded) and the traverse operation doesn't see the changes not yet committed by the delete operation. Michael Am 14.08.2011 um 11:42 schrieb Aseem Kishore: Related, I had noticed that immediately after adding a node (and connecting it), the same traverse doesn't usually return that node, but the next traverse always does. This feels like the same issue -- a caching or timing one -- just one that never caused an error in our app. The deleting does cause an error, because attempting to then do a second traverse from that deleted node invariably results in an error since the node has been deleted. Aseem On Sun, Aug 14, 2011 at 2:37 AM, Aseem Kishore aseem.kish...@gmail.comwrote: I'm deleting a node and then immediately doing a traverse, and the traverse sometimes returns the deleted node. Am I clearly at fault here? Or could this indeed be coming from the Neo4j server? (E.g. a caching issue?) This happens consistently, but not always, maybe around 50%-75% of the time. I'm using the REST API. The node is always truly deleted from the graph whenever I manually check after this happens, and if I re-traverse, the node is gone as it should be, so this suggests it's a caching or timing issue. Any ideas? I'll keep debugging to make sure it's not something I'm doing wrong... Thanks, Aseem ___ 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] n-ary relationships
Hi, I started looking into Neo4j this morning, and played with some domain models to see whether it really passes a whiteboard friendliness test. I'm really after a persistence solution that makes it straightforward to persist a domain model designed from a DDD perspective, and Neo4j is looking promising so far. The one aspect that's not too clear is how to model n-ary relationships, and I'm curious as to how those of you with experience with Neo4j and graph databases would approach it. An edge connects two vertices, so in a graph database, a relationship connects two nodes. But when modeling, there are frequently relationships between multiple entities. For example, student John attends a History course at university, and John was referred to the History course by Paul. This relationship relates John, Paul, and the History course. There are a few ways I can think of to model this. 1) A node John has an ATTENDS relationship with node History, and the relationship has a referrer property with Paul's ID. Simple, but keeping IDs as properties seems like an anti-pattern. 2) A node Referral has a CREATED_BY relationship with node Paul, a FOR_COURSE relationship with node History, and a TO_STUDENT relationship with node John. It's effectively a three-way join. 3) Same as 2, but with an additional ATTENDS relationship between John and History. This is particularly useful if a course attendant may attend a course without being referred. This might not be the best example in the world, but it should drive my point home: when relationships have a degree higher than 2, relationships need to be modelled as vertices to overcome the binary nature of edges. Is this expected behavior that's part and parcel of graph databases, or am I approaching the modeling incorrectly somehow? My concern is that traversals may become unnatural when this happens. Say I want to iterate over the attendants of a course, and show the name of who referred them when I do so. Will I have the graph database equivalent of n+1 selects because the data I want to extract (referrer name) is in a different node (Paul) to my node of interest (John), instead of in the relationship to it (attends)? Any tips and opinions would be appreciated. Cheers, Emerson ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] n-ary relationships
Hi Emerson, There is www.qi4j.org trying to implement DDD concepts in Java, with Neo4j as a backend, just FYI. As for hyperedges or N-ary relationships, Nils is right now looking at a good API and implementation on top, and partly below, the neo4j core API. The current status is reflected at https://github.com/peterneubauer/graph-collections/wiki/Enhanced-API Is this along the lines you are thinking? Feedback is most appreciated! /peter Sent from my phone. On Aug 14, 2011 6:57 PM, Emerson Farrugia emerson.farru...@gmail.com wrote: Hi, I started looking into Neo4j this morning, and played with some domain models to see whether it really passes a whiteboard friendliness test. I'm really after a persistence solution that makes it straightforward to persist a domain model designed from a DDD perspective, and Neo4j is looking promising so far. The one aspect that's not too clear is how to model n-ary relationships, and I'm curious as to how those of you with experience with Neo4j and graph databases would approach it. An edge connects two vertices, so in a graph database, a relationship connects two nodes. But when modeling, there are frequently relationships between multiple entities. For example, student John attends a History course at university, and John was referred to the History course by Paul. This relationship relates John, Paul, and the History course. There are a few ways I can think of to model this. 1) A node John has an ATTENDS relationship with node History, and the relationship has a referrer property with Paul's ID. Simple, but keeping IDs as properties seems like an anti-pattern. 2) A node Referral has a CREATED_BY relationship with node Paul, a FOR_COURSE relationship with node History, and a TO_STUDENT relationship with node John. It's effectively a three-way join. 3) Same as 2, but with an additional ATTENDS relationship between John and History. This is particularly useful if a course attendant may attend a course without being referred. This might not be the best example in the world, but it should drive my point home: when relationships have a degree higher than 2, relationships need to be modelled as vertices to overcome the binary nature of edges. Is this expected behavior that's part and parcel of graph databases, or am I approaching the modeling incorrectly somehow? My concern is that traversals may become unnatural when this happens. Say I want to iterate over the attendants of a course, and show the name of who referred them when I do so. Will I have the graph database equivalent of n+1 selects because the data I want to extract (referrer name) is in a different node (Paul) to my node of interest (John), instead of in the relationship to it (attends)? Any tips and opinions would be appreciated. Cheers, Emerson ___ 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] Defining relationships declaritavely or with annotations
Still not working even with the AspectJ plugin, here is what I did on Eclipse STS 2.7.1... I created an empty Dynamic Web Project, added the libraries for neo4j community and spring data graph, then added a simple entity class that uses spring data graph annotations and the persis() method. I could not download the AspectJ plugin from the documentation because the version I already have is from ajdt/37/dev/update...I'm assuming the later version should be ok? I converted the project to an AspectJ project from Eclipse, this added the AspectJ runtime libraries to the project, specifically.. org.aspectj.runtime_1.6.12.20110812122400; is that correct? Regarding the build path updates as per the documentation, I'm not using maven at the moment, but I did include **/*.aj on the src/java folder settings. Still getting the compile error on the persist() method. This is one nasty problem! Raffi -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Michael Hunger Sent: Sunday, August 14, 2011 4:59 AM To: Neo4j user discussions Subject: Re: [Neo4j] Defining relationships declaritavely or with annotations Have you enabled AspectJ support for your project? You should have the aspectj plugin installed and your project should show an AJ symbol on its icon. AspectJ will introduce this and other methods and functionality on classes annotated with @NodeEntity. Please look here for details: http://static.springsource.org/spring-data/data-graph/snapshot-site/referenc e/html/#reference:aspectj Please report back if it doesn't solve your problems. Thanks Michael Am 14.08.2011 um 00:55 schrieb etc1: Mike, Using Spring Data Graph, when defining a node entity using annotations... @NodeEntity public class User... ... the following code not work compileEclipse complains that the persist() method is not defined for class User, which is true, but in the imdb sample project it's coded the same way for Actor, Movie, etc. What am I missing? ..new User(...).persist(); -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Michael Hunger Sent: Monday, August 08, 2011 8:59 PM To: Neo4j user discussions Subject: Re: [Neo4j] Defining relationships declaritavely or with annotations What does make you think it not being very mature? As one of the project leads I'm very interested in your thorough evaluation. There are other libraries that follow a similar approach (annotation based mapping), like jo4neo. Neo4j itself is about the core-database, higher level bindings or drivers are provided mostly by the community. Michael Am 09.08.2011 um 02:44 schrieb etc1: Hi Michael, I saw that, but it does not look very mature. Does neo4j offer any other options aside from doing it in the code? XML config, etc, anything but hardcoding programmatically. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Michael Hunger Sent: Monday, August 08, 2011 8:41 PM To: Neo4j user discussions Subject: Re: [Neo4j] Defining relationships declaritavely or with annotations You might look into Spring Data Graph for a declarative object graph mapping. See: http://springsource.org/spring-data/neo4j http://bit.ly/sdg-html Cheers Michael Am 09.08.2011 um 02:34 schrieb etc1: Hi, Is it possible to define relationships using declarative configuration or annotations? The Getting Started guide illustrates how to do it programmatically, but I prefer to keep relationship mappings outside of the code, it will be easier to maintain. Thanks ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@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] How do I load data into IMDB web app?
I've got the IMDB sample project running in Eclipse STS; I'm using the spring data graph version. How do I load the data from the *.list files? Right now the graph appears to completely empty. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user