|
|
@ -1,5 +1,7 @@
|
|
|
|
from py2neo import Graph, Node, Relationship, Subgraph
|
|
|
|
from py2neo import Graph, Node, Relationship, Subgraph
|
|
|
|
from Config.Config import *
|
|
|
|
from Config.Config import *
|
|
|
|
|
|
|
|
from Util.Neo4jExecutor import Neo4jExecutor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 连接到 Neo4j 数据库
|
|
|
|
# 连接到 Neo4j 数据库
|
|
|
|
graph = Graph(NEO4J_URI, auth=NEO4J_AUTH)
|
|
|
|
graph = Graph(NEO4J_URI, auth=NEO4J_AUTH)
|
|
|
@ -145,5 +147,9 @@ def create_knowledge_graph():
|
|
|
|
print("知识图谱创建成功!")
|
|
|
|
print("知识图谱创建成功!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 调用函数创建知识图谱
|
|
|
|
if __name__ == '__main__':
|
|
|
|
create_knowledge_graph()
|
|
|
|
executor = Neo4jExecutor.create_default()
|
|
|
|
|
|
|
|
# 清库
|
|
|
|
|
|
|
|
executor.graph.run("MATCH (n) DETACH DELETE n")
|
|
|
|
|
|
|
|
# 调用函数创建知识图谱
|
|
|
|
|
|
|
|
create_knowledge_graph()
|
|
|
|