main
黄海 5 months ago
parent 2f9c85e6da
commit 6a6a9b4cf0

@ -199,22 +199,3 @@ class KnowledgeGraph:
print(f"\n\n❌ 生成失败:{error_msg}")
return False, error_msg, ""
if __name__ == '__main__':
# 准备执行
executor = K2_Neo4jExecutor(
uri=NEO4J_URI,
auth=NEO4J_AUTH
)
# 测试用例
test_content = '''
题目一个长方体的长是8厘米宽是5厘米高是3厘米求它的表面积是多少平方厘米
'''
try:
kg = KnowledgeGraph(test_content)
success, cypher = kg.run()
res = executor.execute_cypher_text(cypher)
print("恭喜,执行数据插入完成!")
except Exception as e:
print(f"程序初始化失败: {str(e)}")

@ -0,0 +1,21 @@
from K1_KnowledgeGraph import *
from K2_Neo4jExecutor import *
if __name__ == '__main__':
# 准备执行
executor = K2_Neo4jExecutor(
uri=NEO4J_URI,
auth=NEO4J_AUTH
)
# 测试用例
test_content = '''
题目一个长方体的长是8厘米宽是5厘米高是3厘米求它的表面积是多少平方厘米
'''
try:
kg = KnowledgeGraph(test_content)
success, cypher = kg.run()
res = executor.execute_cypher_text(cypher)
print("恭喜,执行数据插入完成!")
except Exception as e:
print(f"程序初始化失败: {str(e)}")
Loading…
Cancel
Save