diff --git a/AI/Neo4j/K1_KnowledgeGraph.py b/AI/Neo4j/K1_KnowledgeGraph.py index 70445d55..e3dfa336 100644 --- a/AI/Neo4j/K1_KnowledgeGraph.py +++ b/AI/Neo4j/K1_KnowledgeGraph.py @@ -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)}") diff --git a/AI/Neo4j/K3_Start.py b/AI/Neo4j/K3_Start.py new file mode 100644 index 00000000..106d83f4 --- /dev/null +++ b/AI/Neo4j/K3_Start.py @@ -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)}") diff --git a/AI/Neo4j/__pycache__/K1_KnowledgeGraph.cpython-310.pyc b/AI/Neo4j/__pycache__/K1_KnowledgeGraph.cpython-310.pyc new file mode 100644 index 00000000..f54f79db Binary files /dev/null and b/AI/Neo4j/__pycache__/K1_KnowledgeGraph.cpython-310.pyc differ