Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(16)  |  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
 
    my_batch = neo4j.WriteBatch(graph_db)
    my_batch.append_cypher('match (a)-[r]-(b) delete r;')
    # 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);')
    # Clear root
    my_batch.append_cypher(
        'MATCH (r) WHERE id(r) = 0 SET r = {};'
    )
    my_batch.submit()

src/o/c/ocean-HEAD/scripts/ocean_small_exemplary_data.py   ocean(Download)
    # Erases database data without the Root node
    write_batch = neo4j.WriteBatch(graph_db)
    write_batch.append_cypher('MATCH ()-[r]-() DELETE r')
    write_batch.append_cypher('MATCH n DELETE n')
    write_batch.submit()
 
    # 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()
 

src/o/c/ocean-HEAD/scripts/ocean_small_exemplary_init.py   ocean(Download)
        HAS_INSTANCE_RELATION,
    )
    write_batch.append_cypher(query)
    write_batch.submit()
 
        HAS_INSTANCE_RELATION,
    )
    write_batch.append_cypher(query)
    write_batch.submit()
 
 
    my_batch = neo4j.WriteBatch(graph_db)
    my_batch.append_cypher('create index on :Node(uuid)')
    my_batch.append_cypher('create index on :ContentSource(link)')
    my_batch.submit()