Hi all, Indeed, none of the nodes are connected to a reference node. I'd like the graph to keep containing subgraphs. I'll give a try with the new neoclipse, I was using 3.0.
Thanks for you help, Pierre ------------------------------ Date: Tue, 16 Feb 2010 19:42:00 +0100 From: Anders Nawroth <and...@neotechnology.com> Subject: Re: [Neo] Create/Modify Graph To: Neo user discussions <user@lists.neo4j.org> Hi Pierre! > 1. How do I add nodes to an existing graph? So far, I created a simple graph > which stored in var/base and visible from neoclipse, however when I modify my > script to create additional nodes and relationship, changes are not visible > in neoclipse, although I quit neoclise prior to adding nodes and edges. Older Neoclipse versions have problems finding the nodes if they are not connected somehow to the reference node. If you're not using it already, try the snapshot version: http://eclipse.neo4j.org/neoclipse/snapshot/ or try a recent standalone version: http://eclipse.neo4j.org/neoclipse-standalone/ If that's not the problem, it could be that you forgot to mark the transaction as successful, see: http://api.neo4j.org/current/org/neo4j/graphdb/Transaction.html > 2. How do I list overall relationship? I found graphDb.getAllNodes() but not > graphDb.getAllRelationship(), nor graphDb.getNumberOfRelationship() to loop > through. Of course I understand that the prefered solution would be to > traverse the graph, but before going further in learning about neo4j, I just > wanted to check that node and edge creations succeeded. You'll have to either find the relationships through traversal, from the nodes or by using GraphDatabaseService.getRelationshipById(). > 3. What happen if I create a node that already exists - for instance when I > rerun my code? I get no error message on existing nodes, but new nodes are > not created either or at list not visible in neoclipse. If you rerun your code using the same neo4j store, you'll end up with lots of nodes in it! You can't technically add "the same node twice", as the Ids of the nodes will differ. HTH, Anders _______________________________________________ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user