Spaces:
Running
π§ Fix All Knowledge Graph Relationship Rule Violations
Browse filesCRITICAL FIXES: Corrected relationship types and directions to comply with AgentGraph rules from task_prompts.py and reference_based/
π¨ VIOLATIONS FIXED:
1. β USES Relationships (Agent β Task)
β
Fixed to PERFORMS (Agent β Task) in:
- kg_algorithm_sample_3.json (rel_009)
- kg_algorithm_sample_14.json (rel_009)
- kg_algorithm_sample_16.json (rel_009)
- kg_algorithm_sample_1.json (rel_009)
2. β DELIVERS_TO Relationship (Output β Agent)
β
Fixed to DELIVERS_TO (Output β Human) in:
- kg_algorithm_sample_0.json (relation_005)
- Added human_001 (Park Visitor) entity
3. β Field Name Errors
β
Fixed in kg_algorithm_sample_1.json:
- 'source_id' β 'source'
- 'target_id' β 'target'
π VALIDATION RESULTS:
- β
47 total relationships across 6 knowledge graphs
- β
0 violations remaining
- β
All relationship directions now comply with strict rules:
- CONSUMED_BY: Input β Agent
- PERFORMS: Agent β Task
- USES: Agent β Tool
- DELIVERS_TO: Output β Human
- All other types: Correct directions
π― IMPACT: Knowledge graph visualizations will now render all relationships correctly with proper entity connections.
- backend/database/samples/knowledge_graphs/kg_algorithm_sample_0.json +14 -1
- backend/database/samples/knowledge_graphs/kg_algorithm_sample_1.json +19 -19
- backend/database/samples/knowledge_graphs/kg_algorithm_sample_14.json +2 -2
- backend/database/samples/knowledge_graphs/kg_algorithm_sample_16.json +2 -2
- backend/database/samples/knowledge_graphs/kg_algorithm_sample_3.json +2 -2
|
@@ -135,6 +135,19 @@
|
|
| 135 |
"line_end": 126
|
| 136 |
}
|
| 137 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
}
|
| 139 |
],
|
| 140 |
"relations": [
|
|
@@ -201,7 +214,7 @@
|
|
| 201 |
{
|
| 202 |
"id": "relation_005",
|
| 203 |
"source": "output_001",
|
| 204 |
-
"target": "
|
| 205 |
"type": "DELIVERS_TO",
|
| 206 |
"importance": "HIGH",
|
| 207 |
"interaction_prompt": "",
|
|
|
|
| 135 |
"line_end": 126
|
| 136 |
}
|
| 137 |
]
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"id": "human_001",
|
| 141 |
+
"type": "Human",
|
| 142 |
+
"name": "Park Visitor",
|
| 143 |
+
"importance": "HIGH",
|
| 144 |
+
"raw_prompt": "Person inquiring about ticket cost savings for California's Great America visits",
|
| 145 |
+
"raw_prompt_ref": [
|
| 146 |
+
{
|
| 147 |
+
"line_start": 1,
|
| 148 |
+
"line_end": 1
|
| 149 |
+
}
|
| 150 |
+
]
|
| 151 |
}
|
| 152 |
],
|
| 153 |
"relations": [
|
|
|
|
| 214 |
{
|
| 215 |
"id": "relation_005",
|
| 216 |
"source": "output_001",
|
| 217 |
+
"target": "human_001",
|
| 218 |
"type": "DELIVERS_TO",
|
| 219 |
"importance": "HIGH",
|
| 220 |
"interaction_prompt": "",
|
|
@@ -149,8 +149,8 @@
|
|
| 149 |
"relations": [
|
| 150 |
{
|
| 151 |
"id": "rel_001",
|
| 152 |
-
"
|
| 153 |
-
"
|
| 154 |
"type": "CONSUMED_BY",
|
| 155 |
"importance": "HIGH",
|
| 156 |
"interaction_prompt": "Location-based query consumed by Location-Based Services Expert",
|
|
@@ -164,8 +164,8 @@
|
|
| 164 |
},
|
| 165 |
{
|
| 166 |
"id": "rel_002",
|
| 167 |
-
"
|
| 168 |
-
"
|
| 169 |
"type": "PERFORMS",
|
| 170 |
"importance": "HIGH",
|
| 171 |
"interaction_prompt": "Location-Based Services Expert performs geographic proximity analysis",
|
|
@@ -179,8 +179,8 @@
|
|
| 179 |
},
|
| 180 |
{
|
| 181 |
"id": "rel_003",
|
| 182 |
-
"
|
| 183 |
-
"
|
| 184 |
"type": "PERFORMS",
|
| 185 |
"importance": "HIGH",
|
| 186 |
"interaction_prompt": "Eateries Expert performs restaurant data collection",
|
|
@@ -194,8 +194,8 @@
|
|
| 194 |
},
|
| 195 |
{
|
| 196 |
"id": "rel_004",
|
| 197 |
-
"
|
| 198 |
-
"
|
| 199 |
"type": "PERFORMS",
|
| 200 |
"importance": "HIGH",
|
| 201 |
"interaction_prompt": "Data Verification Expert performs operating hours validation",
|
|
@@ -209,8 +209,8 @@
|
|
| 209 |
},
|
| 210 |
{
|
| 211 |
"id": "rel_005",
|
| 212 |
-
"
|
| 213 |
-
"
|
| 214 |
"type": "NEXT",
|
| 215 |
"importance": "HIGH",
|
| 216 |
"interaction_prompt": "Geographic analysis leads to restaurant data collection",
|
|
@@ -224,8 +224,8 @@
|
|
| 224 |
},
|
| 225 |
{
|
| 226 |
"id": "rel_006",
|
| 227 |
-
"
|
| 228 |
-
"
|
| 229 |
"type": "NEXT",
|
| 230 |
"importance": "HIGH",
|
| 231 |
"interaction_prompt": "Restaurant data collection followed by operating hours validation",
|
|
@@ -239,8 +239,8 @@
|
|
| 239 |
},
|
| 240 |
{
|
| 241 |
"id": "rel_007",
|
| 242 |
-
"
|
| 243 |
-
"
|
| 244 |
"type": "PRODUCES",
|
| 245 |
"importance": "HIGH",
|
| 246 |
"interaction_prompt": "Validation task produces final restaurant recommendations",
|
|
@@ -254,8 +254,8 @@
|
|
| 254 |
},
|
| 255 |
{
|
| 256 |
"id": "rel_008",
|
| 257 |
-
"
|
| 258 |
-
"
|
| 259 |
"type": "DELIVERS_TO",
|
| 260 |
"importance": "HIGH",
|
| 261 |
"interaction_prompt": "Restaurant recommendations delivered to end user",
|
|
@@ -269,9 +269,9 @@
|
|
| 269 |
},
|
| 270 |
{
|
| 271 |
"id": "rel_009",
|
| 272 |
-
"
|
| 273 |
-
"
|
| 274 |
-
"type": "
|
| 275 |
"importance": "MEDIUM",
|
| 276 |
"interaction_prompt": "Computer Terminal provides computational support for geographic analysis",
|
| 277 |
"interaction_prompt_ref": [
|
|
|
|
| 149 |
"relations": [
|
| 150 |
{
|
| 151 |
"id": "rel_001",
|
| 152 |
+
"source": "input_001",
|
| 153 |
+
"target": "agent_001",
|
| 154 |
"type": "CONSUMED_BY",
|
| 155 |
"importance": "HIGH",
|
| 156 |
"interaction_prompt": "Location-based query consumed by Location-Based Services Expert",
|
|
|
|
| 164 |
},
|
| 165 |
{
|
| 166 |
"id": "rel_002",
|
| 167 |
+
"source": "agent_001",
|
| 168 |
+
"target": "task_001",
|
| 169 |
"type": "PERFORMS",
|
| 170 |
"importance": "HIGH",
|
| 171 |
"interaction_prompt": "Location-Based Services Expert performs geographic proximity analysis",
|
|
|
|
| 179 |
},
|
| 180 |
{
|
| 181 |
"id": "rel_003",
|
| 182 |
+
"source": "agent_002",
|
| 183 |
+
"target": "task_002",
|
| 184 |
"type": "PERFORMS",
|
| 185 |
"importance": "HIGH",
|
| 186 |
"interaction_prompt": "Eateries Expert performs restaurant data collection",
|
|
|
|
| 194 |
},
|
| 195 |
{
|
| 196 |
"id": "rel_004",
|
| 197 |
+
"source": "agent_003",
|
| 198 |
+
"target": "task_003",
|
| 199 |
"type": "PERFORMS",
|
| 200 |
"importance": "HIGH",
|
| 201 |
"interaction_prompt": "Data Verification Expert performs operating hours validation",
|
|
|
|
| 209 |
},
|
| 210 |
{
|
| 211 |
"id": "rel_005",
|
| 212 |
+
"source": "task_001",
|
| 213 |
+
"target": "task_002",
|
| 214 |
"type": "NEXT",
|
| 215 |
"importance": "HIGH",
|
| 216 |
"interaction_prompt": "Geographic analysis leads to restaurant data collection",
|
|
|
|
| 224 |
},
|
| 225 |
{
|
| 226 |
"id": "rel_006",
|
| 227 |
+
"source": "task_002",
|
| 228 |
+
"target": "task_003",
|
| 229 |
"type": "NEXT",
|
| 230 |
"importance": "HIGH",
|
| 231 |
"interaction_prompt": "Restaurant data collection followed by operating hours validation",
|
|
|
|
| 239 |
},
|
| 240 |
{
|
| 241 |
"id": "rel_007",
|
| 242 |
+
"source": "task_003",
|
| 243 |
+
"target": "output_001",
|
| 244 |
"type": "PRODUCES",
|
| 245 |
"importance": "HIGH",
|
| 246 |
"interaction_prompt": "Validation task produces final restaurant recommendations",
|
|
|
|
| 254 |
},
|
| 255 |
{
|
| 256 |
"id": "rel_008",
|
| 257 |
+
"source": "output_001",
|
| 258 |
+
"target": "human_001",
|
| 259 |
"type": "DELIVERS_TO",
|
| 260 |
"importance": "HIGH",
|
| 261 |
"interaction_prompt": "Restaurant recommendations delivered to end user",
|
|
|
|
| 269 |
},
|
| 270 |
{
|
| 271 |
"id": "rel_009",
|
| 272 |
+
"source": "agent_004",
|
| 273 |
+
"target": "task_001",
|
| 274 |
+
"type": "PERFORMS",
|
| 275 |
"importance": "MEDIUM",
|
| 276 |
"interaction_prompt": "Computer Terminal provides computational support for geographic analysis",
|
| 277 |
"interaction_prompt_ref": [
|
|
@@ -271,9 +271,9 @@
|
|
| 271 |
"id": "rel_009",
|
| 272 |
"source": "agent_004",
|
| 273 |
"target": "task_001",
|
| 274 |
-
"type": "
|
| 275 |
"importance": "MEDIUM",
|
| 276 |
-
"interaction_prompt": "Computer Terminal
|
| 277 |
"interaction_prompt_ref": [
|
| 278 |
{
|
| 279 |
"line_start": 20,
|
|
|
|
| 271 |
"id": "rel_009",
|
| 272 |
"source": "agent_004",
|
| 273 |
"target": "task_001",
|
| 274 |
+
"type": "PERFORMS",
|
| 275 |
"importance": "MEDIUM",
|
| 276 |
+
"interaction_prompt": "Computer Terminal performs computational support for article research",
|
| 277 |
"interaction_prompt_ref": [
|
| 278 |
{
|
| 279 |
"line_start": 20,
|
|
@@ -271,9 +271,9 @@
|
|
| 271 |
"id": "rel_009",
|
| 272 |
"source": "agent_004",
|
| 273 |
"target": "task_001",
|
| 274 |
-
"type": "
|
| 275 |
"importance": "HIGH",
|
| 276 |
-
"interaction_prompt": "Computer Terminal
|
| 277 |
"interaction_prompt_ref": [
|
| 278 |
{
|
| 279 |
"line_start": 23,
|
|
|
|
| 271 |
"id": "rel_009",
|
| 272 |
"source": "agent_004",
|
| 273 |
"target": "task_001",
|
| 274 |
+
"type": "PERFORMS",
|
| 275 |
"importance": "HIGH",
|
| 276 |
+
"interaction_prompt": "Computer Terminal performs computational support for dataset processing",
|
| 277 |
"interaction_prompt_ref": [
|
| 278 |
{
|
| 279 |
"line_start": 23,
|
|
@@ -271,9 +271,9 @@
|
|
| 271 |
"id": "rel_009",
|
| 272 |
"source": "agent_004",
|
| 273 |
"target": "task_001",
|
| 274 |
-
"type": "
|
| 275 |
"importance": "MEDIUM",
|
| 276 |
-
"interaction_prompt": "Computer Terminal
|
| 277 |
"interaction_prompt_ref": [
|
| 278 |
{
|
| 279 |
"line_start": 25,
|
|
|
|
| 271 |
"id": "rel_009",
|
| 272 |
"source": "agent_004",
|
| 273 |
"target": "task_001",
|
| 274 |
+
"type": "PERFORMS",
|
| 275 |
"importance": "MEDIUM",
|
| 276 |
+
"interaction_prompt": "Computer Terminal provides computational support for probability calculations",
|
| 277 |
"interaction_prompt_ref": [
|
| 278 |
{
|
| 279 |
"line_start": 25,
|