Neo4j(一)

01-windows下载与安装neo4j

https://blog.csdn.net/qq_21383435/article/details/78807024

 

neo4j的配置文件(图文详解)

https://www.cnblogs.com/zlslch/p/6933800.html

 

Neo4j 查询某标签节点个数语句 删除某标签全部节点语句

 

查询:MATCH (n:标签名) RETURN count(n)

删除:MATCH (n:标签名) DELETE n

 

python 连接 neo4j

#coding:utf-8
from py2neo import Graph,Node,Relationship


# 根据属性进行查询
def findOne(label, propertyName, propertyValue):
    foundNode = graph.find_one(
        label = label,
        property_key = propertyName,
        property_value = propertyValue
    )

    return foundNode


graph = Graph("http://localhost:7474", username="neo4j", password="123456")

#创建节点
# temp_node = Node('Person', name='张红')# 节点标签名,节点属性
# graph.create(temp_node)

#建立关系
# fa = findOne('Person', 'name', '张海洋')
# da = findOne('Person', 'name', '张红')
# if(fa != None and da!= Node):
#     fa_da = Relationship(fa, 'call', da)
#     fa_da['count'] = 1
#     graph.create(fa_da)
#
#     da_fa = Relationship(da, 'call', fa)
#     da_fa['count'] = 3
#     graph.create(da_fa)

print findOne('call','count','1')

 

posted @ 2018-05-09 13:59  quietwalk  阅读(490)  评论(1编辑  收藏  举报