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

All Samples(22)  |  Call(22)  |  Derive(0)  |  Import(0)

src/o/c/ocean-HEAD/scripts/ocean_small_exemplary_data.py   ocean(Download)
    ]
 
    type_list = graph_db.create(*type_list)
    for item in type_list:
        item.add_labels('Model', 'Node')
 
    # Creates type relations
    graph_db.create(
        rel(root, HAS_TYPE_RELATION, type_list[0]),
    ]
 
    user_list = graph_db.create(*user_list)
    for item in user_list:
        item.add_labels(NEOUSER_TYPE_MODEL_NAME, 'Node')
 
    # Creates instance relations
    graph_db.create(
        rel(type_list[0], HAS_INSTANCE_RELATION, user_list[0]),
    ]
 
    tag_list = graph_db.create(*tag_list)
    for item in tag_list:
        item.add_labels(TAG_TYPE_MODEL_NAME, 'Node')

src/o/c/ocean-HEAD/scripts/ocean_init_graph.py   ocean(Download)
    if nodes_count == [0]:
        # Create root
        graph_db.create(node())
 
    my_batch = neo4j.WriteBatch(graph_db)
    ]
 
    types = graph_db.create(*types)
    for item in types:
        item.add_labels('Model', 'Node')
        node(uuid='974eec34-a07d-11e3-9f3a-2cd05ae1c39b', username='szymon')
    ]
    users = graph_db.create(*users)
    for item in users:
        item.add_labels('NeoUser', 'Node')
 
    # Create instance relations
    graph_db.create(
        rel(types[1], HAS_INSTANCE_RELATION, users[0]),

src/o/c/ocean-HEAD/scripts/ocean_small_exemplary_init.py   ocean(Download)
        ),
    ]
    websites = graph_db.create(*websites)
    for item in websites:
        item.add_labels('Node', 'Website')
 
    # Create content sources
    content_sources = graph_db.create(*content_sources_list)
    for item in content_sources:
        item.add_labels('Node', 'ContentSource')
    # Create Website __has__ ContentSource relations
    graph_db.create(
        rel(websites[0], HAS_RELATION, content_sources[0]),
        rel(websites[1], HAS_RELATION, content_sources[1]),
        rel(websites[2], HAS_RELATION, content_sources[2])