gitlink-cli/doc/sub-task4-module-d/knowledge-graph.md

124 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 科研知识图谱 — 模板与说明
## 用途
知识图谱是 `gitlink-research-hotspot` Skill 的输出之一,以 Mermaid.js 流程图的形式展示科研领域内的项目、主题、技术栈和组织之间的关联关系。
---
## 使用方式
```bash
# 知识图谱由 hotspot-tracker-full.sh 自动生成
# 输出位置:
# skills/gitlink-research-hotspot/scripts/_output/knowledge-graph-<domain>.md
```
## 图谱结构
```mermaid
flowchart LR
%% ========== 实体定义 ==========
subgraph Projects["🔬 研究项目"]
P1["项目名称<br/>(owner/repo)"]
P2["项目名称<br/>(owner/repo)"]
P3["项目名称<br/>(owner/repo)"]
end
subgraph Topics["📚 研究主题"]
T1["主题标签 A"]
T2["主题标签 B"]
T3["主题标签 C"]
end
subgraph Techs["💻 技术栈"]
S1["编程语言/框架 X"]
S2["编程语言/框架 Y"]
S3["编程语言/框架 Z"]
end
subgraph Orgs["🏛️ 组织机构"]
O1["组织/用户 1"]
O2["组织/用户 2"]
end
%% ========== 关系定义 ==========
P1 -->|topic| T1
P1 -->|topic| T2
P1 -->|uses| S1
P1 -->|uses| S2
P1 -->|belongs_to| O1
P2 -->|topic| T2
P2 -->|topic| T3
P2 -->|uses| S2
P2 -->|belongs_to| O1
P3 -->|topic| T1
P3 -->|uses| S3
P3 -->|belongs_to| O2
P2 -.->|related_to| P1
%% ========== 样式定义 ==========
classDef project fill:#e1f5fe,stroke:#01579b,color:#01579b
classDef topic fill:#f3e5f5,stroke:#7b1fa2,color:#7b1fa2
classDef tech fill:#e8f5e9,stroke:#2e7d32,color:#2e7d32
classDef org fill:#fff3e0,stroke:#e65100,color:#e65100
class P1,P2,P3 project
class T1,T2,T3 topic
class S1,S2,S3 tech
class O1,O2 org
```
## 实体与关系说明
### 实体类型
| 图标 | 类型 | 说明 | 数据来源 |
|------|------|------|----------|
| 🔬 | 项目 (Project) | GitLink 上的仓库 | `search +repos`, `repo +info` |
| 📚 | 主题 (Topic) | 仓库的研究主题标签 | `repo +topics` |
| 💻 | 技术栈 (Tech) | 编程语言和框架 | `repo +languages` |
| 🏛️ | 组织 (Org) | 所属组织或个人 | `repo +info → owner` |
### 关系类型
| 关系 | 箭头 | 说明 |
|------|------|------|
| `topic` | `项目 → 主题` | 项目涉及的研究主题 |
| `uses` | `项目 → 技术栈` | 项目使用的编程语言/框架 |
| `belongs_to` | `项目 → 组织` | 项目所属的组织/用户 |
| `related_to` | `项目 → 项目` | 项目之间的关联关系(共现主题标签) |
## 自动生成流程
```
搜索结果 JSON 文件
AI Agent 提取实体(项目/主题/技术栈/组织)
AI Agent 识别关系topic/uses/belongs_to/related_to
生成 Mermaid.js 语法
写入 knowledge-graph-<domain>.md 文件
用户可在支持 Mermaid 的 Markdown 渲染器中查看
```
## 解读方法
1. **密集连接的节点**代表该领域的核心项目或主题
2. **跨领域连接的节点**代表交叉研究方向
3. **孤立节点**可能代表新兴但尚未被广泛关联的方向
4. **组织归属**可帮助发现特定机构的研究重点
---
*生成工具gitlink-research-hotspot Skill | Mermaid.js 版本10.x+*