-
Notifications
You must be signed in to change notification settings - Fork 2
docs: refactor docs of loader & client for new version(1.7.0) #4
docs: refactor docs of loader & client for new version(1.7.0) #4
Conversation
added graphspace part for docs of client changed client examples to NEWER version fixed parameters in loader docs
|
@codecov-ai-reviewer review |
This comment has been minimized.
This comment has been minimized.
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Walkthrough将文档与示例改为引入 GraphSpace 概念,统一把 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as 应用
participant Builder as HugeClient.Builder
participant Client as HugeClient
participant GSM as GraphSpaceManager
participant Server as HugeGraph 服务
participant GM as GraphsManager
Dev->>Builder: builder(host, space, graph)\n.configUser(...)\n.build()
Builder->>Client: 返回已配置的 HugeClient
note over Builder,Client: 若未显式提供 space 则使用 "DEFAULT"
Dev->>GSM: createGraphSpace(GraphSpace)
GSM->>Server: POST /graphspaces
Server-->>GSM: 201 Created
Dev->>GM: createGraph(space, Graph)
GM->>Server: POST /graphspaces/{space}/graphs
Server-->>GM: 201 Created
sequenceDiagram
autonumber
actor Dev as 应用
participant GSM as GraphSpaceManager
participant GM as GraphsManager
participant Server as HugeGraph 服务
Dev->>GSM: listGraphSpaces()
GSM->>Server: GET /graphspaces
Server-->>GSM: 200 [spaces]
Dev->>GM: listGraphs(space)
GM->>Server: GET /graphspaces/{space}/graphs
Server-->>GM: 200 [graphs]
Dev->>GM: getGraph(space, name)
GM->>Server: GET /graphspaces/{space}/graphs/{name}
Server-->>GM: 200 Graph
Dev->>GSM: removeGraphSpace(name, force?)
alt 强制删除
GSM->>Server: DELETE /graphspaces/{name}?force=true
else 非强制删除
GSM->>Server: DELETE /graphspaces/{name}
end
Server-->>GSM: 204 No Content
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 需额外关注:
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)content/**/*.md📄 CodeRabbit inference engine (AGENTS.md)
Files:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
content/en/docs/quickstart/toolchain/hugegraph-loader.md (3)
54-55: “User Docker” 拼写错误,应为 “Use Docker”链接文字与锚点表述需统一。
-The specific data loading process can be referenced under [4.5 User Docker to load data](#45-use-docker-to-load-data) +The specific data loading process can be referenced under [4.5 Use Docker to load data](#45-use-docker-to-load-data)
83-95: “hwo to install ojdbc” 拼写错误;标题表述不规范将 “hwo” 更正为 “how”,并建议首字母大写。
-<summary>click to fold/collapse hwo to install ojdbc</summary> +<summary>Click to fold/collapse how to install ojdbc</summary>
1-1141: 统一文档中 HugeGraph-Loader 镜像版本
content/en/docs/quickstart/toolchain/hugegraph-loader.md 行32 使用hugegraph/loader:1.5.0,但行41、47 使用hugegraph/loader:1.3.0;content/cn/docs/quickstart/toolchain/hugegraph-loader.md 同样存在 1.5.0 与 1.3.0 混用。请统一所有示例为同一稳定版(建议 1.5.0)。content/cn/docs/quickstart/client/hugegraph-client.md (1)
12-15: 小错别字与本地化一致性
- “READEME” 应为 “README”。
-后文主要是 Java 使用示例 (其他语言 SDK 可参考对应 `READEME` 页面) +后文主要是 Java 使用示例(其他语言 SDK 可参考对应 `README` 页面)content/en/docs/clients/hugegraph-client.md (1)
18-24: 仍使用旧的两参 builder,需与 GraphSpace 统一为三参此处应更新为
builder(host, space, graph),并可示例默认空间 “DEFAULT”。-// HugeGraphServer address: "http://localhost:8080" -// Graph Name: "hugegraph" -HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "hugegraph") +// HugeGraphServer address: "http://localhost:8080" +// GraphSpace: "DEFAULT" (if not specified) +// Graph Name: "hugegraph" +HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph") .configTimeout(20) // 20s timeout .configUser("**", "**") // enable auth .build();content/cn/docs/clients/hugegraph-client.md (1)
16-21: “无法自定义图进行创建”与后文 GraphsManager 示例矛盾文中后续已提供
graphsManager.createGraph(...)示例,应修正文案以避免读者误解。-目前 HugeGraph-Client 只允许连接服务端已存在的图,无法自定义图进行创建。其创建方法如下: +HugeGraph-Client 支持在指定 GraphSpace 下管理与创建图(需服务端版本与权限支持)。连接示例如下:
🧹 Nitpick comments (10)
content/cn/docs/quickstart/toolchain/hugegraph-loader.md (2)
793-797: 补充 -gs/-g 语义,统一 host 简写写法
- 建议在 -g/-gs 的描述中明确两者关系:-g 指“图名称”,-gs 指“图空间(默认 DEFAULT)”。
- “-i” 作为 host 的别名已加入,建议在描述中点明为与 server 在同一 docker 网络时可用容器名。
-| `-gs` 或 `--graphspace` | DEFAULT | | 图空间 | +| `-gs` 或 `--graphspace` | DEFAULT | | 图空间(GraphSpace,未指定时默认 DEFAULT) |
860-862: 示例命令建议展示 -gs 以避免读者误解默认空间当前示例均未体现 -gs,读者可能忽略图空间概念。建议在示例中显式加入
-gs DEFAULT(或自定义空间名)。-bin/hugegraph-loader -g {GRAPH_NAME} -f ${INPUT_DESC_FILE} -s ${SCHEMA_FILE} -h {HOST} -p {PORT} +bin/hugegraph-loader -gs DEFAULT -g {GRAPH_NAME} -f ${INPUT_DESC_FILE} -s ${SCHEMA_FILE} -h {HOST} -p {PORT}-docker exec -it loader bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h server -p 8080 +docker exec -it loader bin/hugegraph-loader.sh -gs DEFAULT -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h server -p 8080-sh bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h server -p 8080 +sh bin/hugegraph-loader.sh -gs DEFAULT -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h server -p 8080Also applies to: 1073-1081, 1129-1131
content/en/docs/quickstart/toolchain/hugegraph-loader.md (2)
41-48: docker 镜像版本与中文文档不一致(1.3.0 vs 1.5.0)请在中英文文档中统一镜像版本,避免读者混淆。若以 1.5.0 为推荐,请同步至本段。
- image: hugegraph/hugegraph:1.3.0 + image: hugegraph/hugegraph:1.5.0 ... - image: hugegraph/loader:1.3.0 + image: hugegraph/loader:1.5.0
848-850: 示例命令建议显式加入 -gs为强化 GraphSpace 概念,建议在英文示例中加入
-gs DEFAULT。-bin/hugegraph-loader -g {GRAPH_NAME} -f ${INPUT_DESC_FILE} -s ${SCHEMA_FILE} -h {HOST} -p {PORT} +bin/hugegraph-loader -gs DEFAULT -g {GRAPH_NAME} -f ${INPUT_DESC_FILE} -s ${SCHEMA_FILE} -h {HOST} -p {PORT}-docker exec -it loader bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h server -p 8080 +docker exec -it loader bin/hugegraph-loader.sh -gs DEFAULT -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h server -p 8080-sh bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h server -p 8080 +sh bin/hugegraph-loader.sh -gs DEFAULT -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h server -p 8080Also applies to: 1063-1071, 1118-1120
content/en/docs/quickstart/client/hugegraph-client.md (2)
349-353: 链接前缺空格,影响可读性在 “see/See” 与
[之间补空格。-Before running Example, you need to start the Server. For the startup process, see[HugeGraph-Server Quick Start](/docs/quickstart/hugegraph/hugegraph-server). +Before running the example, you need to start the Server. For the startup process, see [HugeGraph-Server Quick Start](/docs/quickstart/hugegraph/hugegraph-server).-See[Introduce basic API of HugeGraph-Client](/docs/clients/hugegraph-client). +See [Introduce basic API of HugeGraph-Client](/docs/clients/hugegraph-client).
222-225: 主机地址一致性(nitpick)两个示例分别使用 127.0.0.1 与 localhost,建议统一,以减少初学者困惑。
Also applies to: 76-79
content/cn/docs/quickstart/client/hugegraph-client.md (3)
81-85: SingleExample 建议补充认证示例或注释英文版示例加入了
.configUser("admin", "admin"),中文可添加一句说明“如开启认证需配置用户名密码”。- HugeClient hugeClient = HugeClient.builder("http://127.0.0.1:8080", - "DEFAULT", - "hugegraph") - .build(); + HugeClient hugeClient = HugeClient.builder("http://127.0.0.1:8080", + "DEFAULT", + "hugegraph") + // 若服务端开启了鉴权,请配置用户名密码 + // .configUser("admin", "admin") + .build();
226-230: 英文注释语法问题(或应本地化)“If connect failed will throw a exception.” 建议改为中文或修正英文语法。
- // If connect failed will throw a exception. + // If the connection fails, an exception will be thrown. + // 若连接失败将抛出异常。
30-31: 产品名连字符用法不一致“HugeGraph - Hubble” 建议统一为 “HugeGraph-Hubble”。
-在`HugeGraph - Hubble`中通过`gremlin`来操作时,不需要使用`HugeClient`,可以忽略。 +在`HugeGraph-Hubble`中通过`gremlin`来操作时,不需要使用`HugeClient`,可以忽略。content/cn/docs/clients/hugegraph-client.md (1)
459-463: 标题与文案微调(空格与一致性)
- “client支持”前后加空格;“创建GraphSpace”中英之间加空格。
-### 4 图空间(GraphSpace) -client支持一个物理部署中多个 GraphSpace,每个 GraphSpace 下可以含多个图(graph)。 -- 兼容:不指定 GraphSpace 时,默认使用 "DEFAULT" 空间 +### 4 图空间(GraphSpace) +client 支持在单一物理部署中创建多个 GraphSpace,每个 GraphSpace 下可以包含多个图(graph)。 +- 兼容:不指定 GraphSpace 时,默认使用 "DEFAULT" 空间-#### 4.1 创建GraphSpace +#### 4.1 创建 GraphSpace
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
content/cn/docs/clients/hugegraph-client.md(2 hunks)content/cn/docs/quickstart/client/hugegraph-client.md(4 hunks)content/cn/docs/quickstart/toolchain/hugegraph-loader.md(1 hunks)content/en/docs/clients/hugegraph-client.md(1 hunks)content/en/docs/quickstart/client/hugegraph-client.md(4 hunks)content/en/docs/quickstart/toolchain/hugegraph-loader.md(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
content/cn/docs/quickstart/toolchain/hugegraph-loader.md
795-795: Table column count
Expected: 4; Actual: 5; Too many cells, extra data will be missing
(MD056, table-column-count)
content/en/docs/clients/hugegraph-client.md
467-467: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
content/cn/docs/clients/hugegraph-client.md
467-467: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🔇 Additional comments (4)
content/en/docs/quickstart/client/hugegraph-client.md (3)
47-48: 依赖版本更新 LGTM已更新到 1.7.0,符合 PR 目标。
76-80: 三参 builder 与 configUser 示例 LGTM与 GraphSpace 设计一致。
223-225: BatchExample 三参 builder LGTM与新版签名一致。
content/cn/docs/quickstart/client/hugegraph-client.md (1)
51-52: 依赖版本更新 LGTM已更新到 1.7.0。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
content/cn/docs/clients/hugegraph-client.md (1)
21-22: 在代码注释中明确第二个参数为 GraphSpace,避免读者困惑当前示例仅标注了地址与图名,未对
"DEFAULT"的含义进行说明。建议在示例注释中补充“图空间名称”。-// HugeGraphServer 地址:"http://localhost:8080" -// 图的名称:"hugegraph" +// HugeGraphServer 地址:"http://localhost:8080" +// 图空间名称:"DEFAULT"(默认图空间) +// 图的名称:"hugegraph" HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph")
🧹 Nitpick comments (3)
content/cn/docs/quickstart/toolchain/hugegraph-loader.md (2)
793-796: 参数行总体正确,但建议细化 -gs 与 -h/-i 描述以减少歧义
- 建议把 DEFAULT 用行内代码包裹,突出其为字面默认值。
- 建议在 host 行明确 “-i 等价于 -h,支持域名或 IP”,避免把 -i 误解为其他含义。
可在表内做最小修订:
-| `-gs` 或 `--graphspace` | DEFAULT | | 图空间 | +| `-gs` 或 `--graphspace` | `DEFAULT` | | 图空间 |-| `-h` 或 `--host` 或 `-i` | localhost | | HugeGraphServer 的地址 | +| `-h` 或 `--host` 或 `-i` | localhost | | HugeGraphServer 的地址(支持域名或 IP,-i 为 -h 的别名) |
793-796: 示例命令建议补充 -gs 用法,增强与参数表的一致性虽然有默认空间,但建议在示例中至少出现一次显式 -gs 用法,降低读者在多空间场景下的误用概率。
以下为需在文中对应代码块处(不在当前选中行范围内)同步更新的示例(示例仅演示,具体位置请按文中相应代码块替换):
- bin/hugegraph-loader -g {GRAPH_NAME} -f ${INPUT_DESC_FILE} -s ${SCHEMA_FILE} -h {HOST} -p {PORT} + bin/hugegraph-loader -gs DEFAULT -g {GRAPH_NAME} -f ${INPUT_DESC_FILE} -s ${SCHEMA_FILE} -h {HOST} -p {PORT}- sh bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy + sh bin/hugegraph-loader.sh -gs DEFAULT -g hugegraph -f example/file/struct.json -s example/file/schema.groovy- docker exec -it loader bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h server -p 8080 + docker exec -it loader bin/hugegraph-loader.sh -gs DEFAULT -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h server -p 8080- docker exec -it loader bin/hugegraph-loader.sh -g hugegraph -f /loader/dataset/struct.json -s /loader/dataset/schema.groovy -h server -p 8080 + docker exec -it loader bin/hugegraph-loader.sh -gs DEFAULT -g hugegraph -f /loader/dataset/struct.json -s /loader/dataset/schema.groovy -h server -p 8080content/cn/docs/clients/hugegraph-client.md (1)
459-462: 小排版:中英文混排处补空格“client支持”建议改为“client 支持”,提高可读性。
- client支持一个物理部署中多个 GraphSpace,每个 GraphSpace 下可以含多个图(graph)。 + client 支持一个物理部署中多个 GraphSpace,每个 GraphSpace 下可以含多个图(graph)。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
content/cn/docs/clients/hugegraph-client.md(2 hunks)content/cn/docs/quickstart/toolchain/hugegraph-loader.md(1 hunks)content/en/docs/clients/hugegraph-client.md(1 hunks)content/en/docs/quickstart/toolchain/hugegraph-loader.md(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- content/en/docs/clients/hugegraph-client.md
- content/en/docs/quickstart/toolchain/hugegraph-loader.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
content/cn/docs/clients/hugegraph-client.md (1)
397-401: 更正索引示例中的 onE/ onV 用法
personByLived针对顶点属性通常应使用onV("person"),当前文档写成onE("person")容易误导用户,并在实际调用时报错。-schema.indexLabel("personByLived").onE("person").by("lived").search().ifNotExist().create(); +schema.indexLabel("personByLived").onV("person").by("lived").search().ifNotExist().create();
♻️ Duplicate comments (1)
content/cn/docs/clients/hugegraph-client.md (1)
19-25: 在示例中补充 GraphSpace 参数注释与迁移提示当前注释只解释了 host 与图名,未说明第二个参数“DEFAULT”为 GraphSpace,读者容易误解;建议在示例旁补充中文注释,并简要给出从 1.5.x → 1.7.0 的构造器迁移说明。
-// HugeGraphServer 地址:"http://localhost:8080" -// 图的名称:"hugegraph" -HugeClient hugeClient = HugeClient.builder("http://localhost:8080", - "DEFAULT", "hugegraph") +// HugeGraphServer 地址:"http://localhost:8080" +// 图空间名称:"DEFAULT"(默认图空间) +// 图名称:"hugegraph" +HugeClient hugeClient = HugeClient.builder("http://localhost:8080", + "DEFAULT", "hugegraph") .configTimeout(20) // 默认 20s 超时 .configUser("**", "**") // 默认未开启用户权限 .build(); + +// 迁移提示(1.5.x → 1.7.0): +// 旧版:HugeClient.builder(host, graph) +// 新版:HugeClient.builder(host, graphSpace, graph),未指定时使用 "DEFAULT" 图空间
🧹 Nitpick comments (3)
content/cn/docs/clients/hugegraph-client.md (3)
459-463: 在 GraphSpace 章节开头注明版本要求与兼容性范围建议显式标注“客户端自 1.7.0 起引入 GraphSpace”,并提示服务端版本/依赖需匹配,以免用户在较旧集群上按本文操作失败。
是否需要我补一段“版本兼容矩阵”小表格(client/server/loader)?
498-514: 为删除操作增加强提示,避免误删生产数据removeGraph(...) 与带 force 的 removeGraphSpace(...) 风险较高,建议在示例后加一行“危险操作”提示,提醒先备份并在测试环境验证。
graphsManager.removeGraph("myGraphSpace", "businessGraph"); + +// 注意:删除操作不可逆,建议先在测试环境验证,生产环境执行前完成数据备份。
461-461: 将“兼容”说明扩展为“迁移指南”小节并给出前后对比当前仅一句话提到默认 "DEFAULT"。建议补充旧/新构造器对比代码,减少用户迁移成本。
-- 兼容:不指定 GraphSpace 时,默认使用 "DEFAULT" 空间 +- 迁移指南: + - 旧版(≤1.5.x):HugeClient.builder(host, graph) + - 新版(≥1.7.0):HugeClient.builder(host, graphSpace, graph) + - 不指定 GraphSpace 时默认使用 "DEFAULT"(保持向后兼容)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
content/cn/docs/clients/hugegraph-client.md(2 hunks)content/cn/docs/quickstart/toolchain/hugegraph-loader.md(1 hunks)content/en/docs/clients/hugegraph-client.md(1 hunks)content/en/docs/quickstart/toolchain/hugegraph-loader.md(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- content/en/docs/clients/hugegraph-client.md
- content/en/docs/quickstart/toolchain/hugegraph-loader.md
- content/cn/docs/quickstart/toolchain/hugegraph-loader.md
🔇 Additional comments (1)
content/cn/docs/clients/hugegraph-client.md (1)
518-518: 校验结尾链接有效性与指向是否已更新为三参构造请确认
/cn/docs/quickstart/client/hugegraph-client存在且示例已切换为三参builder(host, space, graph)。#!/bin/bash # 验证目标文档是否存在,并检查是否包含三参构造示例 fd -a 'hugegraph-client.md' content | rg -n '/cn/docs/quickstart/client/hugegraph-client' -n || true rg -n -C2 'HugeClient\.builder\(' content/cn/docs/quickstart/client/hugegraph-client.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
content/cn/docs/clients/hugegraph-client.md (2)
21-22: 在示例旁明确“DEFAULT”为 GraphSpace 参数,避免三参签名误读建议在示例上方补充一行注释,标明第二个参数为 GraphSpace 名称;同时这属于 1.7.0 的潜在破坏式变更,需在此处点明迁移要点(未指定空间时使用 "DEFAULT")。
// HugeGraphServer 地址:"http://localhost:8080" -// 图的名称:"hugegraph" +// 图空间名称:"DEFAULT"(默认图空间) +// 图的名称:"hugegraph" HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph") .configTimeout(20) // 默认 20s 超时 .configUser("**", "**") // 默认未开启用户权限 .build();如需,我可以在“1 HugeGraph-Client”小节末补一段“从 1.5.0 迁移到 1.7.0”的简短指引。
此外,请核对 1.7.0 客户端实际签名是否为 builder(host, space, graph)。
480-491: 接口表错误与描述不当:修正方法名复数与角色数量描述,并补充强制删除接口
- 方法名应为 listGraphSpaces(复数)。
- setMaxRoleNumber 的说明应为“最大角色数量”。
- 如客户端提供强制删除空间(force)重载,建议在“删除”分类一并列出。
-| 查询 | listGraphSpace() | 获取所有 GraphSpace 列表 | +| 查询 | listGraphSpaces() | 获取所有 GraphSpace 列表 | @@ -| | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大图数量 | +| | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大角色数量 | @@ -| 删除 | removeGraphSpace(String name) | 删除指定 GraphSpace | +| 删除 | removeGraphSpace(String name) | 删除指定 GraphSpace | +| | removeGraphSpace(String name, boolean force) | 强制删除 GraphSpace(包含所有图数据) |若实际并未提供 force 重载,请忽略最后一行并在文中说明删除行为与后果。
此外,可考虑将 space.getName() 等实例访问器另起一类“GraphSpace 实例方法”,避免与 Manager 方法混排。
🧹 Nitpick comments (2)
content/cn/docs/clients/hugegraph-client.md (2)
459-462: 措辞与术语微调,突出默认空间行为建议统一术语书写与表述,强调未指定 GraphSpace 时的等价行为。
-### 4 图管理 -client支持一个物理部署中多个 GraphSpace,每个 GraphSpace 下可以含多个图(graph)。 -- 兼容:不指定 GraphSpace 时,默认使用 "DEFAULT" 空间 +### 4 图管理 +HugeGraph-Client 支持在一个物理部署中创建多个 GraphSpace,每个 GraphSpace 下可以包含多个图(graph)。 +- 兼容性:未显式指定 GraphSpace 时,默认使用 "DEFAULT" 空间(等价于在 DEFAULT 空间中操作)
463-477: 确认示例 API 与 1.7.0 实现一致(GraphSpace/GraphSpaceManager)示例采用 new GraphSpace() + setter 的方式配置空间,请确认 1.7.0 提供无参构造与这些 setter;若推荐 Builder/静态工厂,请同步示例。
我可以根据实际 API 生成一版等价的 Builder 写法示例,便于与后续“更新空间配置”示例(updateGraphSpace)串联。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
content/cn/docs/clients/hugegraph-client.md(2 hunks)content/en/docs/clients/hugegraph-client.md(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- content/en/docs/clients/hugegraph-client.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (5)
content/cn/docs/quickstart/client/hugegraph-client.md (3)
81-85: GraphSpace 参数 "DEFAULT" 需要在文档中解释。HugeClient.builder() 的签名已更新为三参形式 (url, graphspace, graph),其中 "DEFAULT" 是新引入的 GraphSpace 参数。虽然代码示例已更新,但文档中缺少对 GraphSpace 概念的解释和 "DEFAULT" 值的说明。建议在文档中补充以下内容:
- GraphSpace 的概念和作用
- "DEFAULT" GraphSpace 的含义
- 如何使用自定义 GraphSpace
同时,第11行提及的
/cn/docs/clients/hugegraph-client应包含详细的 GraphSpace API 文档。
228-230: BatchExample 缺少认证配置,与 SingleExample 不一致。SingleExample(第81-85行)包含
.configUser("admin", "admin")的认证配置,但 BatchExample(第228-230行)没有。这种不一致可能误导用户,特别是在生产环境中。建议检查:
- 是否需要在 BatchExample 中也添加认证配置?
- 如果 BatchExample 的无认证方式是有意设计,应在注释中说明为什么会有差异。
为保持文档的一致性和清晰性,建议两个示例使用相同的认证模式。
1-360: 建议添加 GraphSpace 概念的简要介绍。本文档是快速开始指南,现在引入了 GraphSpace 参数 "DEFAULT",但没有对此概念的任何解释。虽然详细说明应该在专门的 API 文档(第11行提及的
/cn/docs/clients/hugegraph-client)中提供,但在本文件中建议在"### 1 HugeGraph-Client 概述"或"#### 4.3 Example"前添加一句简要说明,例如:注:从 v1.7.0 开始,HugeClient 引入了 GraphSpace 的概念。连接时需要指定 GraphSpace(如 "DEFAULT")和 Graph 名称。
这样可以帮助用户理解 API 变更的原因,减少困惑。
content/en/docs/quickstart/client/hugegraph-client.md (1)
77-81: Builder signature change: explain the new parameter.The three-parameter builder signature (host, space, graph) is a breaking change from the prior two-parameter form. While the examples correctly show "DEFAULT" as the GraphSpace parameter, the code comment should clarify what this parameter represents for readers unfamiliar with the new GraphSpace concept.
Consider adding an inline comment to explain the GraphSpace parameter:
// If connect failed will throw a exception. +// Parameters: server address, GraphSpace name ("DEFAULT" is the default space), graph name HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph")content/cn/docs/clients/hugegraph-client.md (1)
21-25: 新的三参数 builder 签名已正确实现。HugeClient.builder 现在接受三个参数(主机地址、图空间名、图名称),并链式调用 configTimeout 和 configUser。签名更新与 PR 目标保持一致。建议添加注释说明 "DEFAULT" 参数的含义,帮助读者理解新增的图空间概念。
考虑添加行内注释以解释各参数含义:
// HugeGraphServer 地址:"http://localhost:8080" +// 图空间名称:"DEFAULT"(默认图空间) +// 图的名称:"hugegraph" HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
content/cn/docs/clients/hugegraph-client.md(2 hunks)content/cn/docs/quickstart/client/hugegraph-client.md(4 hunks)content/en/docs/quickstart/client/hugegraph-client.md(4 hunks)
🔇 Additional comments (7)
content/cn/docs/quickstart/client/hugegraph-client.md (2)
50-52: 版本号更新符合 PR 目标。依赖版本从 1.5.0 升级到 1.7.0,与 PR 目标一致。
353-358: 标题层级调整合理。将 "### 4.4" 和 "### 4.5" 调整为 "#### 4.4" 和 "#### 4.5",使文档层级结构更加一致和清晰,符合 Markdown 规范。
content/en/docs/quickstart/client/hugegraph-client.md (3)
47-47: Dependency version updated correctly.The version bump from 1.5.0 to 1.7.0 aligns with the PR objectives for the new GraphSpace feature set.
223-225: BatchExample builder usage is consistent.The three-parameter builder signature is applied consistently across both SingleExample and BatchExample. The ".build()" invocation correctly follows the new signature format.
348-348: Section heading levels updated appropriately.The shift from ### to #### for "4.4 Run The Example" and "4.5 More Information About Client-API" maintains correct markdown hierarchy under the parent section.
Also applies to: 352-352
content/cn/docs/clients/hugegraph-client.md (2)
463-477: GraphSpace 创建示例代码结构清晰。示例正确演示了如何创建 GraphSpaceManager 实例、配置 GraphSpace 属性(包括 maxGraphNumber 和 maxRoleNumber)以及创建图空间。代码逻辑正确。
478-492: GraphSpace 接口汇总表结构清晰,分类明确。表格正确分为"查询"、"更新"、"删除"三个类别,包含了 setMaxRoleNumber 方法且无重复条目。方法名拼写(maxNumber、force)已正确修正。使用四级标题(####)符合 markdown 规范。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates documentation to reflect version 1.7.0 of HugeGraph, introducing GraphSpace functionality and updating client/loader usage patterns.
- Maven dependency updated from 1.5.0 to 1.7.0
- Introduced GraphSpace concept with comprehensive API documentation
- Updated client connection examples to include GraphSpace parameter ("DEFAULT")
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| content/en/docs/quickstart/toolchain/hugegraph-loader.md | Updated loader CLI parameters to clarify graph vs graphspace distinction and add -i host alias |
| content/en/docs/quickstart/client/hugegraph-client.md | Updated Maven version, added GraphSpace parameter to client builder examples, adjusted heading levels |
| content/en/docs/clients/hugegraph-client.md | Added comprehensive GraphSpace API documentation with creation examples and interface reference table |
| content/cn/docs/quickstart/toolchain/hugegraph-loader.md | Chinese version of loader parameter updates matching English documentation |
| content/cn/docs/quickstart/client/hugegraph-client.md | Chinese version of client examples with GraphSpace parameter updates |
| content/cn/docs/clients/hugegraph-client.md | Chinese version of GraphSpace API documentation with interface reference table |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
/gemini review |
| HugeClient hugeClient = HugeClient.builder("http://localhost:8080", | ||
| "DEFAULT", | ||
| "hugegraph") | ||
| .configUser("admin", "admin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.configUser("admin", "admin")问题:
- 直接在文档示例中使用默认管理员账号密码存在安全风险
- 可能误导用户在生产环境中使用默认凭证
建议:
- 使用占位符替代实际凭证:
.configUser("username", "password") - 在注释中明确说明这是示例,生产环境需要使用安全的凭证
- 考虑添加安全提示说明
| // HugeGraphServer 地址:"http://localhost:8080" | ||
| // 图的名称:"hugegraph" | ||
| HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "hugegraph") | ||
| HugeClient hugeClient = HugeClient.builder("http://localhost:8080", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在 HugeClient.builder() 中新增了 GraphSpace 参数,从:
builder(host, graph)变更为:
builder(host, space, graph)问题:
- 这是一个破坏性的 API 变更,会导致现有代码编译失败
- PR 描述中提到"兼容:不指定 GraphSpace 时,默认使用 DEFAULT 空间",但实际上 API 签名已经改变,并不向后兼容
- 缺少迁移指南帮助用户升级
建议:
- 在文档中添加明确的版本迁移章节,说明从 1.5.0 升级到 1.7.0 的代码变更要点
- 如果有重载方法保持向后兼容,应该在文档中说明
- 建议在 PR 描述或 CHANGELOG 中明确标注这是 breaking change
|
|
||
| ```java | ||
| GraphSpaceManager spaceManager = hugeClient.graphSpace(); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
创建 GraphSpace 的示例代码过于简化:
GraphSpaceManager spaceManager = hugeClient.graphSpace();
GraphSpace graphSpace = new GraphSpace();
graphSpace.setName("myGraphSpace");
spaceManager.createGraphSpace(graphSpace);问题:
- 没有展示如何处理 GraphSpace 已存在的情况
- 没有展示参数验证(如名称格式、最大数量限制)
- 实际使用中需要判断创建是否成功
建议补充完整示例:
try {
GraphSpaceManager spaceManager = hugeClient.graphSpace();
// 检查是否已存在
if (spaceManager.getGraphSpace("myGraphSpace") != null) {
System.out.println("GraphSpace already exists");
return;
}
GraphSpace graphSpace = new GraphSpace();
graphSpace.setName("myGraphSpace");
graphSpace.setDescription("Business data graph space");
graphSpace.setMaxGraphNumber(10);
graphSpace.setMaxRoleNumber(100);
spaceManager.createGraphSpace(graphSpace);
System.out.println("GraphSpace created successfully");
} catch (Exception e) {
System.err.println("Failed to create GraphSpace: " + e.getMessage());
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分有些冗余了,没有必要吧
| | `-g` 或 `--graph` | | Y | 图数据库空间 | | ||
| | `-s` 或 `--schema` | | Y | schema 文件路径 | | | ||
| | `-h` 或 `--host` | localhost | | HugeGraphServer 的地址 | | ||
| | `-g` 或 `--graph` | | Y | 图名称 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-g 参数的语义从「图数据库空间」改为「图名称」,但缺少说明:
问题:
- 新的
-gs/--graphspace参数默认值为 DEFAULT,但没有说明 DEFAULT 是保留关键字还是用户可以修改 - 参数变更对现有脚本的影响没有说明
-h参数新增别名-i,但没有说明为什么需要两个别名,使用场景是什么
建议:
- 添加版本迁移说明:
版本 1.7.0 变更: - -g 参数含义从"图空间"改为"图名称" - 新增 -gs 参数指定图空间(默认:DEFAULT) - 如果您的脚本使用 -g 指定图空间,请更新为使用 -gs 参数 - 说明 -i 别名的使用场景(例如:与其他工具保持一致?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是之前写错了,改成图名称
| **注意:当 frequency 为 multiple 时必须要设置 sortKeys 对应属性类型的值。** | ||
|
|
||
| ### 4 简单示例 | ||
| ### 4 图管理 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Minor: 中英文文档表述不一致
中文版:
client支持一个物理部署中多个 GraphSpace,每个 GraphSpace 下可以含多个图(graph)
英文版:
The client supports multiple GraphSpaces in one physical deployment, and each GraphSpace can contain multiple graphs.
问题:
- 中文用「含」,英文用「contain」,但后续接口描述中使用「管理」的概念
- 中文版开头「client支持」首字母小写
建议统一表述:
- 中文:「HugeGraph Client 支持在单个物理部署中创建多个 GraphSpace,每个 GraphSpace 可以管理多个图(graph)。」
- 保持中英文表述的概念一致性
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
表述是一致的其实
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the documentation for the new 1.7.0 version, primarily introducing the GraphSpace concept and updating client/loader examples. The changes are generally good and align with the new features. My review focuses on improving the formatting of code examples and Markdown tables in both the Chinese and English documentation to enhance readability and maintain consistency across the files. All suggestions are aimed at improving documentation quality and have been assigned a medium severity.
| ``` | ||
|
|
||
| ### 4.4 运行 Example | ||
| #### 4.4 运行 Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Minor: 标题层级调整不一致
在 quickstart 文档中:
- 原
### 4.4 运行 Example和### 4.5 详细 API 说明改为#### 4.4和#### 4.5 - 但父级章节仍是
### 4,而不是新增的#### 4.x
问题:
这种改动表明原本的章节编号体系需要调整,但 PR 中没有说明为何要降级这两个小节的标题。
建议:
- 如果是为了在「4」下新增子章节,应该重新规划章节编号
- 或者保持原有的三级标题,在前面插入新的三级标题
- 统一检查中英文文档的标题层级是否一致
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为了和之前小节的等级保持一致
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
content/cn/docs/quickstart/toolchain/hugegraph-loader.md (3)
604-604: 输入源类型说明的中文名称与列表项数不匹配。当前文本列举了五种输入源类型(FILE、HDFS、JDBC、KAFKA、GRAPH),但仅提供了四个中文名称(本地文件输入源、HDFS 输入源、JDBC 输入源、KAFKA 输入源、图数据源)。建议调整说法使其更清晰:
-输入源目前分为五类:FILE、HDFS、JDBC、KAFKA、GRAPH,由`type`节点区分,我们称为本地文件输入源、HDFS 输入源、JDBC 输入源和 KAFKA 输入源,图数据源,下面分别介绍。 +输入源目前分为五类:FILE、HDFS、JDBC、KAFKA、GRAPH,由`type`节点区分,分别为本地文件输入源、HDFS 输入源、JDBC 输入源、KAFKA 输入源和图数据源,下面分别介绍。
708-722: GRAPH 输入源文档缺少关键细节说明。当前文档对 GRAPH 输入源参数的说明较为简洁,但缺少某些重要的上下文信息,可能导致用户困惑:
graphspace 的 DEFAULT 值需要说明:当前仅说"默认为 DEFAULT",未说明 DEFAULT 是否为保留关键字、用户是否可创建其他 GraphSpace、或者如何指定其他 GraphSpace。
PD 和元服务相关参数缺乏说明:pd-peers、meta-endpoints 等参数的含义和使用场景不够清晰,建议补充说明这些参数的适用场景(例如:仅在分布式或高可用模式下需要)。
参数与命令行选项的对应关系:建议补充说明这些输入源参数如何映射到 3.4.1 节中的命令行参数。
建议补充如下说明:
-###### 3.3.2.4 GRAPH 输入源 - -- type:输入源类型,必须填 `graph` 或 `GRAPH`,必填; -- graphspace:源图空间名称,默认为 `DEFAULT`; -... +###### 3.3.2.4 GRAPH 输入源 + +- type:输入源类型,必须填 `graph` 或 `GRAPH`,必填; +- graphspace:源图空间名称,默认为 `DEFAULT`。`DEFAULT` 是 HugeGraph 的内置图空间,用户也可指定其他已创建的 GraphSpace 名称; +...
809-824: 命令行参数表的清晰度和完整性需要改进。当前参数表存在几个问题,可能影响用户的理解和使用:
-i 别名的说明不足:表格中将
-i与-h和--host列在同一行,但未说明为何新增此别名、与其他工具的关系等。建议补充说明文字说明 -i 别名的来源和用途。新参数的"是否必传"列标记不一致:部分新参数(如
--create-graph、--password)的"是否必传"列为空,但有明确的默认值。建议统一标记规则(如空白表示可选,标记具体场景下的必填要求)。参数表缺乏逻辑分组:表中参数顺序混杂,建议按照功能分组(基础连接参数、认证参数、PD 相关、Meta 相关等),以提高可读性。
新参数的说明过于简洁:例如
--direct、--route-type、--cluster等参数的描述可以更详细,说明其适用场景和与 GRAPH 输入源的对应关系。建议添加一段前置说明文字,说明 -i 别名的背景和新增参数的分类:
+##### 3.4.1 参数说明 + +> **注意**:从版本 1.7.0 开始,loader 支持 GraphSpace 概念。使用 `-gs/--graphspace` 参数指定目标图空间(默认为 DEFAULT),使用 `-g/--graph` 指定图名称(不再表示图空间)。 +> 新增的 PD 相关参数和 Meta 服务参数仅在分布式或高可用部署模式下需要配置。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
content/cn/docs/quickstart/client/hugegraph-client.md (1)
1-5: 前置数据(Front Matter)缺少必需的 description 字段根据编码指南要求,所有文档文件的前置数据需要包含
title、weight和description字段。当前文件缺少description字段。请添加 description 字段:
--- title: "HugeGraph-Java-Client" linkTitle: "Java 客户端" weight: 1 +description: "HugeGraph-Java-Client 快速开始指南,包含完整示例和 API 使用说明" ---content/cn/docs/quickstart/toolchain/hugegraph-loader.md (2)
1-5: 文档前置配置缺少 description 字段根据编码指南要求,所有
content/**/*.md文件应在前置配置中包含 title、weight 和 description 字段。当前文件缺少 description 字段。建议按如下方式添加:
--- title: "HugeGraph-Loader Quick Start" linkTitle: "使用 Loader 实时/流式导入数据" weight: 2 +description: "HugeGraph-Loader 数据导入工具的快速开始指南,涵盖安装、配置和使用方法" ---
806-846: 参数表格列数不匹配导致 MD056 错误静态分析工具检测到表格格式错误(行 845):期望 4 列,但实际有 5 列。这是由于
--help行末尾的多余竖线导致的。当前格式(第 845 行):
| `--help` | false | | 打印帮助信息 | |应修正为:
| `--help` | false | | 打印帮助信息 |-| `--help` | false | | 打印帮助信息 | | +| `--help` | false | | 打印帮助信息 |content/en/docs/quickstart/toolchain/hugegraph-loader.md (1)
1-5: Front matter missingdescriptionfieldPer the coding guidelines, all
content/**/*.mdfiles should include title, weight, and description fields in front matter. The description field is missing.Suggested addition:
--- title: "HugeGraph-Loader Quick Start" linkTitle: "Load data with HugeGraph-Loader" weight: 2 +description: "Quick start guide for HugeGraph-Loader data import tool, covering installation, configuration, and usage" ---
🧹 Nitpick comments (1)
content/cn/docs/quickstart/client/hugegraph-client.md (1)
229-234: 批量示例与单例示例的缩进不一致BatchExample 中
.configUser()和.build()的缩进与 SingleExample 的缩进不一致,影响代码可读性和一致性。两个示例应使用相同的缩进风格。建议调整 BatchExample 的缩进与 SingleExample 保持一致:
HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph") - .configUser("username", "password") - // 这是示例,生产环境需要使用安全的凭证 - .build(); + .configUser("username", "password") + // 这是示例,生产环境需要使用安全的凭证 + .build();
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
content/cn/docs/quickstart/client/hugegraph-client.md(4 hunks)content/cn/docs/quickstart/toolchain/hugegraph-loader.md(4 hunks)content/en/docs/quickstart/client/hugegraph-client.md(4 hunks)content/en/docs/quickstart/toolchain/hugegraph-loader.md(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- content/en/docs/quickstart/client/hugegraph-client.md
🧰 Additional context used
📓 Path-based instructions (1)
content/**/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Include front matter (title, weight, description) in all documentation files
Files:
content/en/docs/quickstart/toolchain/hugegraph-loader.mdcontent/cn/docs/quickstart/toolchain/hugegraph-loader.mdcontent/cn/docs/quickstart/client/hugegraph-client.md
🪛 markdownlint-cli2 (0.18.1)
content/en/docs/quickstart/toolchain/hugegraph-loader.md
834-834: Table column count
Expected: 4; Actual: 5; Too many cells, extra data will be missing
(MD056, table-column-count)
content/cn/docs/quickstart/toolchain/hugegraph-loader.md
845-845: Table column count
Expected: 4; Actual: 5; Too many cells, extra data will be missing
(MD056, table-column-count)
🔇 Additional comments (3)
content/cn/docs/quickstart/client/hugegraph-client.md (3)
51-51: 版本号正确更新依赖版本正确更新至 1.7.0,与 PR 目标一致。
81-86: 单例示例代码改进良好相比之前的审查,本次改进已正确处理以下问题:
- ✅ 凭证使用占位符 ("username", "password") 而非硬编码的默认账号
- ✅ 使用 Java 风格注释 (//) 而非 Python 风格 (#)
- ✅ 中文注释清晰说明这是示例代码,生产环境需要安全凭证
- ✅ 新增 GraphSpace 参数 ("DEFAULT")
357-362: 章节标题层级结构一致四级标题 (####) 结构正确,与其他子章节保持一致。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
content/cn/docs/clients/hugegraph-client.md (1)
481-481: 修正接口方法名为复数形式根据 Java 集合返回方法的命名惯例,该方法应为
listGraphSpaces()(复数形式),而非listGraphSpace()。- | Manager - 查询 | listGraphSpace() | 获取所有 GraphSpace 列表 | + | Manager - 查询 | listGraphSpaces() | 获取所有 GraphSpace 列表 |
🧹 Nitpick comments (2)
content/cn/docs/clients/hugegraph-client.md (2)
16-16: 改进版本描述的精确性"需注意 1.7.0 后" 的表述不够精确。建议改为 "1.7.0 版本开始" 或 "1.7.0 及之后版本" 以更清楚地表明版本边界。
- 目前 HugeGraph-Client 只允许连接服务端已存在的图,无法自定义图进行创建。同时,需注意 1.7.0 后,构建 HugeGraph-Client 必须指定 GraphSpace(如默认 "DEFAULT")。其创建方法如下: + 目前 HugeGraph-Client 只允许连接服务端已存在的图,无法自定义图进行创建。同时,从 1.7.0 版本开始,构建 HugeGraph-Client 必须指定 GraphSpace(如默认 "DEFAULT")。其创建方法如下:
459-459: 修正专有名词的大小写"client支持" 应改为 "Client支持" 或 "HugeGraph Client支持",以保持文档中对该产品名称的一致性和专业性。
- client支持一个物理部署中多个 GraphSpace,每个 GraphSpace 下可以含多个图(graph)。 + Client 支持一个物理部署中多个 GraphSpace,每个 GraphSpace 下可以含多个图(graph)。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
content/cn/docs/clients/hugegraph-client.md(2 hunks)content/en/docs/quickstart/toolchain/hugegraph-loader.md(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
content/**/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Include front matter (title, weight, description) in all documentation files
Files:
content/en/docs/quickstart/toolchain/hugegraph-loader.mdcontent/cn/docs/clients/hugegraph-client.md
🔇 Additional comments (3)
content/en/docs/quickstart/toolchain/hugegraph-loader.md (3)
697-712: GRAPH 输入源文档覆盖完整。新增的 GRAPH 输入源部分(3.3.2.5)文档化了所有关键字段,包括 graphspace、graph、认证参数、过滤选项和集群/PD 配置。结构和说明与其他输入源类型保持一致。
795-834: 参数表格式与新参数文档化正确。参数表已更新,新增 -gs/--graphspace、-i 主机别名、--password、--create-graph、--pd-peers、--pd-token、--meta-endpoints、--direct、--route-type、--cluster、--incremental-mode、--batch-insert-threads、--max-conn、--max-conn-per-route、--batch-size、--max-parse-errors、--max-insert-errors、--timeout、--retry-times、--retry-interval、--check-vertex、--print-progress、--dry-run 等参数。表格结构完整,每行列数一致(4 列),格式符合 Markdown 标准。所有新参数均带有准确的默认值描述和功能说明。
818-819: 增量模式与失败模式说明更新准确。第 818-819 行中 --incremental-mode 和 --failure-mode 的描述已明确指出增量模式仅适用于 FILE 和 HDFS 输入源、失败模式需手动修正错误数据后重新导入等细节,这些说明与新 GRAPH 输入源的设计保持一致。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
content/en/docs/quickstart/toolchain/hugegraph-loader.md (1)
1-5: 前置元数据缺少 description 字段根据编码指南,所有 documentation 文件应在前置元数据中包含 title、weight 和 description。当前文件只包含了 title、linkTitle 和 weight。
请添加 description 字段,例如:
--- title: "HugeGraph-Loader Quick Start" linkTitle: "Load data with HugeGraph-Loader" weight: 2 +description: "Guide to using HugeGraph-Loader for data import" ---content/cn/docs/quickstart/client/hugegraph-client.md (1)
1-5: 补充文档前言中的description字段根据编码指南要求,所有文档文件必须包含front matter中的title、weight和description三个字段。当前文件缺少
description字段。建议按如下方式补充description字段:
--- title: "HugeGraph-Java-Client" linkTitle: "Java 客户端" weight: 1 +description: "HugeGraph Java客户端的快速开始指南,包含环境要求、使用流程和完整示例" ---content/cn/docs/quickstart/toolchain/hugegraph-loader.md (1)
1-5: 补充文档前言中的description字段根据编码指南要求,所有文档文件必须包含front matter中的title、weight和description三个字段。当前文件缺少
description字段。建议按如下方式补充description字段:
--- title: "HugeGraph-Loader Quick Start" linkTitle: "使用 Loader 实时/流式导入数据" weight: 2 +description: "HugeGraph Loader数据导入工具快速开始指南,支持FILE、HDFS、JDBC、KAFKA和GRAPH多种数据源" ---
🧹 Nitpick comments (2)
content/cn/docs/quickstart/toolchain/hugegraph-loader.md (2)
710-722: 补充GRAPH输入源的JSON配置示例虽然GRAPH输入源的参数说明已提供,但缺少具体的JSON配置示例。为了帮助用户更好地理解如何配置GRAPH输入源,建议参考FILE/HDFS/JDBC/KAFKA等输入源的风格,补充一个完整的GRAPH输入源配置示例。
这样可以使用户清楚地了解各参数在实际配置中如何应用,特别是对于
selected_vertices、ignored_vertices、selected_edges、ignored_edges等筛选规则参数的用法。在3.3.2.5 GRAPH输入源说明的下方,建议添加类似以下格式的配置示例:
##### GRAPH 输入源配置示例 ```json { "type": "GRAPH", "graphspace": "DEFAULT", "graph": "source_graph", "username": "admin", "password": "your_password", "selected_vertices": ["person", "software"], "batch_size": 500 }或者使用筛选规则的示例:
{ "type": "GRAPH", "graphspace": "DEFAULT", "graph": "source_graph", "ignored_vertices": ["temp_vertex"], "ignored_edges": ["temp_edge"], "pd-peers": "127.0.0.1:8686", "batch_size": 1000 }
809-845: ✓ 参数表已成功更新并改进参数说明表格已正确更新了关键改动:
-g参数描述已从"图数据库h"(可能是笔误)改为"图名称"- 新增
-gs/--graphspace参数支持指定图空间,默认值为DEFAULT- 新增
-i作为-h参数的别名以提升易用性- 补充了
--password等权限认证相关参数- 新增多个集群部署相关参数支持
表格格式清晰,信息完整。
不过建议对新增的别名
-i添加一句简要说明,说明为什么同时提供-h和-i两个别名(例如是否为了与其他工具保持一致),可在参数说明或表格下方的备注中补充。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
content/cn/docs/quickstart/client/hugegraph-client.md(4 hunks)content/cn/docs/quickstart/toolchain/hugegraph-loader.md(4 hunks)content/en/docs/quickstart/toolchain/hugegraph-loader.md(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
content/**/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Include front matter (title, weight, description) in all documentation files
Files:
content/cn/docs/quickstart/client/hugegraph-client.mdcontent/cn/docs/quickstart/toolchain/hugegraph-loader.mdcontent/en/docs/quickstart/toolchain/hugegraph-loader.md
🔇 Additional comments (3)
content/en/docs/quickstart/toolchain/hugegraph-loader.md (2)
697-712: ✓ GRAPH input source 文档完整新增的 GRAPH input source 部分文档完整,包含了所有必要的字段说明和默认值,与 PR 目标一致。
795-834: ✓ 参数表更新完整且一致参数表已正确更新以反映 1.7.0 版本的新功能:
- ✓ 添加了
-gs或--graphspace参数(默认值为DEFAULT)- ✓ 添加了
-i作为--host的别名- ✓ 新增与 PD、Meta 和集群相关的参数
- ✓ 更新了
--incremental-mode描述(明确说明仅支持 FILE/HDFS)- ✓ 表格格式正确(4 列)
所有变更与 PR 目标一致。
content/cn/docs/quickstart/client/hugegraph-client.md (1)
81-86: ✓ 已正确处理代码示例中的安全问题代码示例已改用占位符替代硬编码的默认管理员凭证,并添加了明确的安全提示注释。两个示例(SingleExample和BatchExample)现在保持一致,都包含
configUser配置和相应的安全提示。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
content/cn/docs/clients/hugegraph-client.md (2)
1-5: 前置条件:缺少description字段根据编码规范,文档文件的前置内容应包含 title、weight、linkTitle 和 description 字段。当前文件缺失
description字段。建议增加:
--- title: "HugeGraph Java Client" linkTitle: "HugeGraph Java Client" weight: 2 +description: "介绍 HugeGraph Java Client 的使用方法" ---
16-25: 关键问题:代码示例未反映 API 签名变更第 16 行文本明确说明"1.7.0 版本后,client 支持 graphSpace 设置",但第 21 行的代码示例仍然使用 2 参数的
HugeClient.builder()签名。根据 PR 目标,API 签名应已变更为 3 参数(host, space, graph),但此示例未更新。此外,第 19-20 行的注释也需要更新以反映 GraphSpace 参数。
建议修正为:
// HugeGraphServer 地址:"http://localhost:8080" -// 图的名称:"hugegraph" -HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "hugegraph") +// 图空间名称:"DEFAULT" +// 图的名称:"hugegraph" +HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph") .configTimeout(20) // 默认 20s 超时 .configUser("**", "**") // 默认未开启用户权限 .build();
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
content/cn/docs/clients/hugegraph-client.md(2 hunks)content/en/docs/clients/hugegraph-client.md(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- content/en/docs/clients/hugegraph-client.md
🧰 Additional context used
📓 Path-based instructions (1)
content/**/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Include front matter (title, weight, description) in all documentation files
Files:
content/cn/docs/clients/hugegraph-client.md
| | Manager - 查询 | listGraphSpace() | 获取所有 GraphSpace 列表 | | ||
| | | getGraphSpace(String name) | 获取指定 GraphSpace | | ||
| | Manager - 创建/更新 | createGraphSpace(GraphSpace) | 创建 GraphSpace | | ||
| | | updateGraphSpace(String, GraphSpace) | 更新配置 | | ||
| | Manager - 删除 | removeGraphSpace(String) | 删除指定 GraphSpace | | ||
| | GraphSpace - 属性 | getName() / getDescription() | 获取名称/描述 | | ||
| | | getGraphNumber() | 获取图数量 | | ||
| | GraphSpace - 配置 | setDescription(String) | 设置描述 | | ||
| | | setMaxGraphNumber(int) | 设置最大图数量 | | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
接口表方法名不一致且表格不完整
第 481 行显示 listGraphSpace()(单数),但根据之前的审查记录(commit 86ab30f),该方法名应为 listGraphSpaces()(复数)。此外,表格在第 490 行处截断,缺少以下方法:
removeGraphSpace(String name, boolean force)setMaxRoleNumber(int maxRoleNumber)(此方法在示例代码中使用过但未列出)
另外,为提高表格清晰度,建议在 GraphSpace 对象方法行中补全 getter 方法列表,并确保所有在示例中出现过的方法都被文档化。
建议修正为:
-| Manager - 查询 | listGraphSpace() | 获取所有 GraphSpace 列表 |
+| Manager - 查询 | listGraphSpaces() | 获取所有 GraphSpace 列表 |
| | getGraphSpace(String name) | 获取指定 GraphSpace |
| Manager - 创建/更新 | createGraphSpace(GraphSpace) | 创建 GraphSpace |
| | updateGraphSpace(String, GraphSpace) | 更新配置 |
| Manager - 删除 | removeGraphSpace(String) | 删除指定 GraphSpace |
+| | removeGraphSpace(String name, boolean force) | 强制删除 GraphSpace(包含所有图数据) |
| GraphSpace - 属性 | getName() / getDescription() | 获取名称/描述 |
| | getGraphNumber() | 获取图数量 |
+| | getMaxGraphNumber() / getMaxRoleNumber() | 获取最大图/角色数量 |
| GraphSpace - 配置 | setDescription(String) | 设置描述 |
| | setMaxGraphNumber(int) | 设置最大图数量 |
+| | setMaxRoleNumber(int) | 设置最大角色数量 |
documentation
(content/cn/docs/clients/hugegraph-client.md) and English (content/en/docs/clients/hugegraph-client.md) versions:
- GraphSpace creation and management
- Graph management within GraphSpaces
- Complete API interface summary
quickstart guides
- Added --graphspace parameter (-gs)
- Added alternative host parameter (-i)
- Fixed parameter descriptions
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.