Hello Sir, I am trying to create a TPC-H database in Neo4j via csv files. There are 8 tables in tpch-h. Two tables lineitem and orders has 60 lakh and 15 lakh records. I created the nodes in neo4j by loading from csv filles. Now to create the relationship i have to match on orderid in both the table. It will do cross product on both and find the exact match to create relationships between two tables. Server is hanging and not responding in between this.
can you please tell me how can i do this? On Sun, Sep 11, 2016 at 11:33 AM, 'Michael Hunger' via Neo4j < [email protected]> wrote: > I don't think that the cypher run method returns a node in the first > place. It returns a result object which you have to access to get its > content. > > I'm not that well versed in py2neo, there might be other issues in the > code example. > > Michael > > Von meinem iPhone gesendet > > Am 11.09.2016 um 04:48 schrieb Jeff Bradbury <[email protected]>: > > Hello, > I'm trying to create a database with nodes (A)-(B)-(C) and later add node > (D) and connect it to (C). Unfortunately, on the second run my code > creates creates (D), a new node ( ) that I wasn't expecting, and connects > them. The first time my code is run it clears out the database and create > nodes A,B, and C, and their relationships. The second time it is run it > creates the new ( ) node and (D), and a relationship between them. I was > expecting a result of (A)-(B)-(C)-(D), but I'm getting (A)-(B)-(C) and ( > )-(D). > > Any help would be greatly appreciated! Thank you! > > from py2neo import Graph, Node, Relationship > session = Graph("bolt://localhost") > neo4j = session.begin() > > # Check for Node C > existing_node = neo4j.run("MATCH (n) WHERE n.name=\"NODE_C\" RETURN n") > > if existing_node: > print('Node Exists') > # Create Node D > neo_data_d = Node("NODE_D", name="NODE_D") > neo4j.create(neo_data_d) > # Create Relationship > rel = Relationship(existing_node, "REL", neo_data_d) > neo4j.create(rel) > neo4j.commit() > else: > print('Node Does Not Exist') > # Wipe Database > session.delete_all() > # Create Nodes A,B,C > neo_data_a = Node("NODE_A", name="NODE_A") > neo4j.create(neo_data_a) > neo_data_b = Node("NODE_B", name="NODE_B") > neo4j.create(neo_data_b) > neo_data_c = Node("NODE_C", name="NODE_C") > neo4j.create(neo_data_c) > # Create Relationships A-B-C > rel = Relationship(neo_data_a, "REL", neo_data_b) > neo4j.create(rel) > rel = Relationship(neo_data_b, "REL", neo_data_c) > neo4j.create(rel) > neo4j.commit() > > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
