Re: [Neo4j] Fetching Nodes from Graph Database(which was created earlier)
Karthik, that is a very valid point. There are plans to produce a tutorial-style one-stop documentation, it has just not gotten underway yet. If you have input on topics to cover, I would be most interested to get a little table of content from you so we can do a better job when the community gets to it! Thanks for your time, Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Wed, Feb 2, 2011 at 2:35 PM, karthik aithal wrote: > Thanks for your reply. It resolved my problem. > > I think it is a basic question. But I found very difficult to find solution > online. So can you please provide any consolidated user guide to use > Neo4j(other than doc/videos in neo4j sites)? > > Thanks, > Karthik > On Wed, Feb 2, 2011 at 6:12 PM, Mattias Persson > wrote: > >> You mean copy nodes from one database to another? You can bring up two >> EmbeddedGraphDatabase instances, pointing to two different locations, and >> start getting nodes/relationships from one and creating them (not just >> adding) in the other. >> >> GraphDatabaseService gDB1 = new >> EmbeddedGraphDatabase("/NeoDB/store/db"); >> GraphDatabaseService gDB2 = new EmbeddedGraphDatabase("target/db"); >> >> for ( Node sourceNode : gDB1.getAllNodes() ) >> { >> // Insert the contents of that node in gDB2 >> } >> >> 2011/2/2 karthik aithal >> >> > Hi, >> > >> > I am biginner to Neo4j and eager to learn more about it. I am aware >> > of creating new Graph database with 1k to 10k nodes and relationship and >> > was >> > successfully traverse to specific nodes. But currently I am facing >> > difficult >> > to get node from existing graph DB and traverse to specific node in that >> > DB. >> > >> > For creating new Graph DB I am using: >> > >> > GraphDatabaseService gDB = new EmbeddedGraphDatabase("target/db"); >> > >> > So, if I have 10k nodes(with relationship) in Path: "/NeoDB/store/db" >> then >> > how can I retrive nodes from this DB? >> > >> > Thanks for your help in advance, >> > >> > Karthik >> > ___ >> > 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] Fetching Nodes from Graph Database(which was created earlier)
Thanks for your reply. It resolved my problem. I think it is a basic question. But I found very difficult to find solution online. So can you please provide any consolidated user guide to use Neo4j(other than doc/videos in neo4j sites)? Thanks, Karthik On Wed, Feb 2, 2011 at 6:12 PM, Mattias Persson wrote: > You mean copy nodes from one database to another? You can bring up two > EmbeddedGraphDatabase instances, pointing to two different locations, and > start getting nodes/relationships from one and creating them (not just > adding) in the other. > >GraphDatabaseService gDB1 = new > EmbeddedGraphDatabase("/NeoDB/store/db"); >GraphDatabaseService gDB2 = new EmbeddedGraphDatabase("target/db"); > >for ( Node sourceNode : gDB1.getAllNodes() ) >{ > // Insert the contents of that node in gDB2 >} > > 2011/2/2 karthik aithal > > > Hi, > > > > I am biginner to Neo4j and eager to learn more about it. I am aware > > of creating new Graph database with 1k to 10k nodes and relationship and > > was > > successfully traverse to specific nodes. But currently I am facing > > difficult > > to get node from existing graph DB and traverse to specific node in that > > DB. > > > > For creating new Graph DB I am using: > > > > GraphDatabaseService gDB = new EmbeddedGraphDatabase("target/db"); > > > > So, if I have 10k nodes(with relationship) in Path: "/NeoDB/store/db" > then > > how can I retrive nodes from this DB? > > > > Thanks for your help in advance, > > > > Karthik > > ___ > > 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] Fetching Nodes from Graph Database(which was created earlier)
Karthik, You can index the nodes you are interested in as start and/or end-nodes of your traversal and then retrieve them via the index. // to add them gDB.index().forNodes("indexName").add(node,"key","value"); nodeIndex.get("key","value") returns an IndexHits that you can iterate over or use getSingle() to retrieve a single matching node. See also: http://wiki.neo4j.org/content/Index_Framework Other ways of accessing nodes in the db are getById() or traversal using the traversal framework or manual traversal starting from the reference node (gDB.getReferenceNode()) that you should connect your graph to. Cheers Michael Am 02.02.2011 um 13:34 schrieb karthik aithal: > Hi, > > I am biginner to Neo4j and eager to learn more about it. I am aware > of creating new Graph database with 1k to 10k nodes and relationship and was > successfully traverse to specific nodes. But currently I am facing difficult > to get node from existing graph DB and traverse to specific node in that DB. > > For creating new Graph DB I am using: > > GraphDatabaseService gDB = new EmbeddedGraphDatabase("target/db"); > > So, if I have 10k nodes(with relationship) in Path: "/NeoDB/store/db" then > how can I retrive nodes from this DB? > > Thanks for your help in advance, > > Karthik > ___ > 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] Fetching Nodes from Graph Database(which was created earlier)
You mean copy nodes from one database to another? You can bring up two EmbeddedGraphDatabase instances, pointing to two different locations, and start getting nodes/relationships from one and creating them (not just adding) in the other. GraphDatabaseService gDB1 = new EmbeddedGraphDatabase("/NeoDB/store/db"); GraphDatabaseService gDB2 = new EmbeddedGraphDatabase("target/db"); for ( Node sourceNode : gDB1.getAllNodes() ) { // Insert the contents of that node in gDB2 } 2011/2/2 karthik aithal > Hi, > > I am biginner to Neo4j and eager to learn more about it. I am aware > of creating new Graph database with 1k to 10k nodes and relationship and > was > successfully traverse to specific nodes. But currently I am facing > difficult > to get node from existing graph DB and traverse to specific node in that > DB. > > For creating new Graph DB I am using: > > GraphDatabaseService gDB = new EmbeddedGraphDatabase("target/db"); > > So, if I have 10k nodes(with relationship) in Path: "/NeoDB/store/db" then > how can I retrive nodes from this DB? > > Thanks for your help in advance, > > Karthik > ___ > 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] Fetching Nodes from Graph Database(which was created earlier)
Hi, I am biginner to Neo4j and eager to learn more about it. I am aware of creating new Graph database with 1k to 10k nodes and relationship and was successfully traverse to specific nodes. But currently I am facing difficult to get node from existing graph DB and traverse to specific node in that DB. For creating new Graph DB I am using: GraphDatabaseService gDB = new EmbeddedGraphDatabase("target/db"); So, if I have 10k nodes(with relationship) in Path: "/NeoDB/store/db" then how can I retrive nodes from this DB? Thanks for your help in advance, Karthik ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user