fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 (816+ 处) - 添加缺失的导入 (json, re) - 统一SQL查询格式 - 修复赋值语句空格问题 修复文件: - db_manager.py (96处) - search_manager.py (77处) - ops_manager.py (66处) - developer_ecosystem_manager.py (68处) - growth_manager.py (60处) - enterprise_manager.py (61处) - tenant_manager.py (57处) - plugin_manager.py (48处) - subscription_manager.py (46处) - security_manager.py (29处) - workflow_manager.py (32处) - localization_manager.py (31处) - api_key_manager.py (20处) - ai_manager.py (23处) - performance_manager.py (24处) - neo4j_manager.py (25处) - collaboration_manager.py (33处) - test_phase8_task8.py (16处) - test_phase8_task6.py (4处) - knowledge_reasoner.py (添加import json) - llm_client.py (添加import json)
This commit is contained in:
@@ -189,9 +189,9 @@ class Neo4jManager:
|
||||
session.run(
|
||||
"""
|
||||
MERGE (p:Project {id: $project_id})
|
||||
SET p.name = $name,
|
||||
p.description = $description,
|
||||
p.updated_at = datetime()
|
||||
SET p.name = $name,
|
||||
p.description = $description,
|
||||
p.updated_at = datetime()
|
||||
""",
|
||||
project_id=project_id,
|
||||
name=project_name,
|
||||
@@ -208,12 +208,12 @@ class Neo4jManager:
|
||||
session.run(
|
||||
"""
|
||||
MERGE (e:Entity {id: $id})
|
||||
SET e.name = $name,
|
||||
e.type = $type,
|
||||
e.definition = $definition,
|
||||
e.aliases = $aliases,
|
||||
e.properties = $properties,
|
||||
e.updated_at = datetime()
|
||||
SET e.name = $name,
|
||||
e.type = $type,
|
||||
e.definition = $definition,
|
||||
e.aliases = $aliases,
|
||||
e.properties = $properties,
|
||||
e.updated_at = datetime()
|
||||
WITH e
|
||||
MATCH (p:Project {id: $project_id})
|
||||
MERGE (e)-[:BELONGS_TO]->(p)
|
||||
@@ -251,12 +251,12 @@ class Neo4jManager:
|
||||
"""
|
||||
UNWIND $entities AS entity
|
||||
MERGE (e:Entity {id: entity.id})
|
||||
SET e.name = entity.name,
|
||||
e.type = entity.type,
|
||||
e.definition = entity.definition,
|
||||
e.aliases = entity.aliases,
|
||||
e.properties = entity.properties,
|
||||
e.updated_at = datetime()
|
||||
SET e.name = entity.name,
|
||||
e.type = entity.type,
|
||||
e.definition = entity.definition,
|
||||
e.aliases = entity.aliases,
|
||||
e.properties = entity.properties,
|
||||
e.updated_at = datetime()
|
||||
WITH e, entity
|
||||
MATCH (p:Project {id: entity.project_id})
|
||||
MERGE (e)-[:BELONGS_TO]->(p)
|
||||
@@ -275,10 +275,10 @@ class Neo4jManager:
|
||||
MATCH (source:Entity {id: $source_id})
|
||||
MATCH (target:Entity {id: $target_id})
|
||||
MERGE (source)-[r:RELATES_TO {id: $id}]->(target)
|
||||
SET r.relation_type = $relation_type,
|
||||
r.evidence = $evidence,
|
||||
r.properties = $properties,
|
||||
r.updated_at = datetime()
|
||||
SET r.relation_type = $relation_type,
|
||||
r.evidence = $evidence,
|
||||
r.properties = $properties,
|
||||
r.updated_at = datetime()
|
||||
""",
|
||||
id=relation.id,
|
||||
source_id=relation.source_id,
|
||||
@@ -312,10 +312,10 @@ class Neo4jManager:
|
||||
MATCH (source:Entity {id: rel.source_id})
|
||||
MATCH (target:Entity {id: rel.target_id})
|
||||
MERGE (source)-[r:RELATES_TO {id: rel.id}]->(target)
|
||||
SET r.relation_type = rel.relation_type,
|
||||
r.evidence = rel.evidence,
|
||||
r.properties = rel.properties,
|
||||
r.updated_at = datetime()
|
||||
SET r.relation_type = rel.relation_type,
|
||||
r.evidence = rel.evidence,
|
||||
r.properties = rel.properties,
|
||||
r.updated_at = datetime()
|
||||
""",
|
||||
relations=relations_data,
|
||||
)
|
||||
@@ -371,7 +371,7 @@ class Neo4jManager:
|
||||
with self._driver.session() as session:
|
||||
result = session.run(
|
||||
"""
|
||||
MATCH path = shortestPath(
|
||||
MATCH path = shortestPath(
|
||||
(source:Entity {id: $source_id})-[*1..$max_depth]-(target:Entity {id: $target_id})
|
||||
)
|
||||
RETURN path
|
||||
@@ -428,7 +428,7 @@ class Neo4jManager:
|
||||
with self._driver.session() as session:
|
||||
result = session.run(
|
||||
"""
|
||||
MATCH path = (source:Entity {id: $source_id})-[*1..$max_depth]-(target:Entity {id: $target_id})
|
||||
MATCH path = (source:Entity {id: $source_id})-[*1..$max_depth]-(target:Entity {id: $target_id})
|
||||
WHERE source <> target
|
||||
RETURN path
|
||||
LIMIT $limit
|
||||
|
||||
Reference in New Issue
Block a user