Skip to content

Commit

Permalink
Do not update created relationships - avoids lots of gets
Browse files Browse the repository at this point in the history
  • Loading branch information
panisson committed May 18, 2012
1 parent d99e0bd commit f647efb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions load_gexf_to_neo4j.py
Expand Up @@ -217,24 +217,24 @@ def add_to_timeline(root_node, node, timestamp):
edge.relationships.create("EDGE_TAG", tag2)
RUN.relationships.create("RUN_EDGE", edge)

tx = gdb.transaction()
tx = gdb.transaction(update=False)
print 'Adding %s tags to frames'%len(frame_tags)
for i, (frame, tag) in enumerate(frame_tags):
if i%1000 == 0:
sys.stdout.write('.')
sys.stdout.flush()
tx.commit()
tx = gdb.transaction()
tx = gdb.transaction(update=False)
frame.relationships.create("FRAME_TAG", TAG_DICT[tag_id])
tx.commit()

tx = gdb.transaction()
tx = gdb.transaction(update=False)
print 'Adding %s edges to frames'%len(frame_edges)
for i, (frame, edge) in enumerate(frame_edges):
if i%1000 == 0:
sys.stdout.write('.')
sys.stdout.flush()
tx.commit()
tx = gdb.transaction()
tx = gdb.transaction(update=False)
frame.relationships.create("FRAME_EDGE", EDGE_DICT[(id1,id2)], weight=1)
tx.commit()

0 comments on commit f647efb

Please sign in to comment.