GraphDatabase_action
https://neo4j.com/docs/
#https://pypi.python.org/pypi/neo4j-driver/1.5.3
from neo4j.v1 import GraphDatabase driver = GraphDatabase.driver("bolt://localhost:7687", auth=("my@my.com","mypwd")) def add_friends(tx, name, friend_name):
tx.run("MERGE (a:Person {name: $name}) "
"MERGE (a)-[:KNOWS]->(friend:Person {name: $friend_name})",
name=name, friend_name=friend_name) def print_friends(tx, name):
for record in tx.run("MATCH (a:Person)-[:KNOWS]->(friend) WHERE a.name = $name "
"RETURN friend.name ORDER BY friend.name", name=name):
print(record["friend.name"]) with driver.session() as session:
session.write_transaction(add_friends, "Arthur", "Guinevere")
session.write_transaction(add_friends, "Arthur", "Lancelot")
session.write_transaction(add_friends, "Arthur", "Merlin")
session.write_transaction(add_friends, "Arthur", "MyinputF")
session.read_transaction(print_friends, "Arthur")
| Server version | Neo4j/3.3.1 |
| Server address | 127.0.0.1:7687 |
| Query | MATCH (a:Person)-[:KNOWS]->(friend) WHERE a.name ="Arthur" RETURN friend.name ORDER BY friend.name |
| Response |
[ |
删除
GraphDatabase_action的更多相关文章
随机推荐
- 利用jQuery对li标签操作
<ul class="con" id="products"> <li i=" class=""> < ...
- note for git
1.download https://git-for-windows.github.io/ 2.command add file to git: git add filename & git ...
- Spring Boot . 3 -- Spring Boot Auto_configuration 是如何实现的?
配置是Spring 框架的重要核心之一,所以Spring 应用能够正常的跑起来肯定是需要配置的,但是使用的Spring Boot 后很多配置没有做,那么AUTO-CONFIGURATION 到底是怎么 ...
- HTML5 history API与ajax分页实例页面
<ul id="choMenu" class="rel cho_menu"> <li><a href="ajax.php ...
- swiper 旋转木马效果
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...
- 神经网络(NN)+反向传播算法(Backpropagation/BP)+交叉熵+softmax原理分析
神经网络如何利用反向传播算法进行参数更新,加入交叉熵和softmax又会如何变化? 其中的数学原理分析:请点击这里.
- python 3 廖雪峰博客笔记(一) python特性
python 是一种解释性语言,代码在执行时会一行一行翻译成CPU能理解的机器语言. python 的特点是简单优雅. python 的优点是 代码优雅 基础代码库丰富,包括网络.文件.GUI.数据库 ...
- Pycharm下GitHub配置使用
1.下载并安装git 要连接GitHub,首先git是必不可少的,git的安装的基本使用很简单,这里略过.. 2.如图所示,进入Pycharm的Setting>>> Version ...
- php.ini中date.timezone设置分析
date.timezone设置php5默认date.timezone为utc,改为date.timezone = PRC即可解决时间相差八小时的问题,但我在php的官方文档中看了半天也没找到这个参数啊 ...
- 【bzoj2527】[Poi2011]Meteors(树状数组(单点查询,区间修改)+整体二分)
[bzoj2527][Poi2011]Meteors Description Byteotian Interstellar Union (BIU) has recently discovered a ...