Skip to content

Commit 545723d

Browse files
committed
Merge branch 'main' of https://github.com/xerrors/Yuxi-Know
2 parents b8e83b7 + 310fda7 commit 545723d

File tree

22 files changed

+1708
-2026
lines changed

22 files changed

+1708
-2026
lines changed

docs/latest/intro/knowledge-base.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,32 @@ LIMIT $num
9797

9898
### 1. 以三元组形式导入
9999

100+
系统支持通过网页导入 `jsonl` 格式的知识图谱数据,支持**简单三元组****带属性三元组**两种格式。
100101

101-
系统支持通过网页导入 `jsonl` 格式的知识图谱数据
102+
**简单格式(兼容旧版)**
102103

103104
```jsonl
104105
{"h": "北京", "t": "中国", "r": "首都"}
105106
{"h": "上海", "t": "中国", "r": "直辖市"}
106-
{"h": "深圳", "t": "广东", "r": "省会"}
107107
```
108108

109-
**格式说明**,每行一个三元组,系统自动验证数据格式,并自动导入到 Neo4j 数据库,添加 `Upload``Entity``Relation` 标签,会自动处理重复的三元组。
109+
**扩展格式(支持属性)**
110+
111+
支持 `h`(头节点)、`t`(尾节点)和 `r`(关系)为对象结构,其中:
112+
- 节点对象必须包含 `name` 字段。
113+
- 关系对象必须包含 `type` 字段。
114+
- 其他字段将作为**属性**存储在 Neo4j 中。
115+
116+
```jsonl
117+
{"h": {"name": "孙悟空", "title": "齐天大圣", "weapon": "如意金箍棒"}, "t": {"name": "唐僧", "species": ""}, "r": {"type": "徒弟", "order": 1}}
118+
{"h": "猪八戒", "t": {"name": "唐僧"}, "r": {"type": "徒弟", "order": 2}}
119+
```
120+
121+
**格式说明**
122+
- 每行一个数据项。
123+
- 系统自动验证数据格式,并自动导入到 Neo4j 数据库。
124+
- 自动添加 `Upload``Entity` 标签(节点)和 `RELATION` 类型(关系)。
125+
- 自动处理重复实体和关系,并合并属性。
110126

111127
Neo4j 访问信息可以参考 `docker-compose.yml` 中配置对应的环境变量来覆盖。
112128

@@ -116,7 +132,9 @@ Neo4j 访问信息可以参考 `docker-compose.yml` 中配置对应的环境变
116132
- **连接地址**: bolt://localhost:7687
117133

118134
::: tip 测试数据
119-
可以使用 `test/data/A_Dream_of_Red_Mansions_tiny.jsonl` 文件进行测试导入。
135+
可以使用以下文件进行测试导入:
136+
- 简单格式:`test/data/A_Dream_of_Red_Mansions_tiny.jsonl`
137+
- 扩展属性格式:`test/data/complex_graph_test.jsonl`
120138
:::
121139

122140
### 2. 接入已有 Neo4j 实例

0 commit comments

Comments
 (0)