Did I find the right examples for you? yes no Crawl my project Python Jobs
All Samples(12) | Call(12) | Derive(0) | Import(0)
src/o/c/ocean-HEAD/scripts/ocean_init_graph.py ocean(Download)
my_batch = neo4j.ReadBatch(graph_db) my_batch.append_cypher('match (n) return count(n);') nodes_count = my_batch.submit() print 'Nodes in graph initially', nodes_count print 'Erasing nodes and relations'
# fix: do not delete the root my_batch.append_cypher('match (n) where id(n) <> 0 delete n ;') my_batch.submit() my_batch = neo4j.ReadBatch(graph_db) my_batch.append_cypher('match (n) return count(n);') result = my_batch.submit()
'MATCH (r) WHERE id(r) = 0 SET r = {};' ) my_batch.submit() my_batch = neo4j.WriteBatch(graph_db) my_batch.append_cypher('match (e:Root) set e:Node;') my_batch.append_cypher('match (e:Root) set e.uuid="root";') my_batch.submit()
src/o/c/ocean-HEAD/scripts/ocean_small_exemplary_data.py ocean(Download)
write_batch.append_cypher('MATCH ()-[r]-() DELETE r') write_batch.append_cypher('MATCH n DELETE n') write_batch.submit() write_batch.clear()
# Configures the Root node write_batch.append_cypher('CREATE (n:Root {uuid: "root"}) RETURN id(n)') root_result = write_batch.submit() write_batch.clear()
batch = neo4j.WriteBatch(graph_db) batch.append_cypher('CREATE INDEX ON :Node(uuid)') batch.submit() print 'Graph populated successfully!'
src/o/c/ocean-HEAD/scripts/ocean_small_exemplary_init.py ocean(Download)
) write_batch.append_cypher(query) write_batch.submit() # Create nodes
) write_batch.append_cypher(query) write_batch.submit() # Create Website __has__ ContentSource relations
my_batch.append_cypher('create index on :Node(uuid)') my_batch.append_cypher('create index on :ContentSource(link)') my_batch.submit() print 'Graph populated successfully!'