feat: 增加简化版json数据

This commit is contained in:
2026-04-15 14:52:33 +08:00
parent 37cd2171b1
commit 8c5cd3705a
9 changed files with 310 additions and 1 deletions
+78
View File
@@ -125,6 +125,29 @@
}
}
},
"/api/graph/simpleJson": {
"get": {
"description": "获取知识图谱的全部节点和边数据(仅保留核心信息,适合LLM处理)",
"produces": [
"application/json"
],
"summary": "获取简化图数据",
"responses": {
"200": {
"description": "成功",
"schema": {
"$ref": "#/definitions/models.SimpleGraphData"
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/models.ErrorResponse"
}
}
}
}
},
"/api/graph/stats": {
"get": {
"description": "获取知识图谱的节点数、边数等统计信息",
@@ -688,6 +711,61 @@
}
}
},
"models.SimpleEdge": {
"type": "object",
"properties": {
"label": {
"type": "string",
"example": "包含"
},
"source": {
"type": "string",
"example": "1"
},
"target": {
"type": "string",
"example": "2"
},
"type": {
"type": "string",
"example": "CONTAINS"
}
}
},
"models.SimpleGraphData": {
"type": "object",
"properties": {
"edges": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SimpleEdge"
}
},
"nodes": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SimpleNode"
}
}
}
},
"models.SimpleNode": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "1"
},
"label": {
"type": "string",
"example": "人工智能"
},
"type": {
"type": "string",
"example": "概念"
}
}
},
"models.UpdateNodeRequest": {
"type": "object",
"properties": {