You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

5 months ago
// 约束
CREATE CONSTRAINT IF NOT EXISTS FOR (kp:KnowledgePoint) REQUIRE kp.id IS UNIQUE;
CREATE CONSTRAINT IF NOT EXISTS FOR (ab:AbilityPoint) REQUIRE ab.id IS UNIQUE;
// 索引 (修正版)
CREATE FULLTEXT INDEX questionContent IF NOT EXISTS
FOR (q:Question)
ON EACH [q.content];
// 节点 (替换参数)
MERGE (q:Question {id: "a1b2c3d4"})
SET q.content = "巧求周长7个相同小长方形拼成大长方形小长方形长10厘米求大长方形周长",
q.difficulty = 3;
MERGE (kp:KnowledgePoint {id: "KP_101"})
SET kp.name = "长方形周长计算",
kp.level = "小学";
MERGE (ab:AbilityPoint {id: "AB_025"})
SET ab.name = "图形拼接分析",
ab.category = "几何推理";
// 关系 (使用具体ID)
MATCH (q:Question {id: "a1b2c3d4"}), (kp:KnowledgePoint {id: "KP_101"})
MERGE (q)-[r:TESTS_KNOWLEDGE]->(kp)
SET r.weight = 0.8,
r.created_at = timestamp();
MATCH (q:Question {id: "a1b2c3d4"}), (ab:AbilityPoint {id: "AB_025"})
MERGE (q)-[r:REQUIRES_ABILITY]->(ab)
SET r.weight = 0.7,
r.created_at = timestamp();
MERGE (s:Shape {id: "FIG_007"})
SET s.type = "复合长方形结构";
MATCH (q:Question {id: "a1b2c3d4"}), (s:Shape {id: "FIG_007"})
MERGE (q)-[c:CONSISTS_OF]->(s)
SET c.weight = 1.0;