imbajin commented on code in PR #415:
URL: 
https://github.com/apache/incubator-hugegraph-doc/pull/415#discussion_r2444608124


##########
content/cn/docs/clients/hugegraph-client.md:
##########
@@ -455,6 +456,39 @@ Edge knows1 = marko.addEdge("knows", vadas, "city", 
"Beijing");
 
 **注意:当 frequency 为 multiple 时必须要设置 sortKeys 对应属性类型的值。**
 
-### 4 简单示例
+### 4 图管理
+client支持一个物理部署中多个 GraphSpace,每个 GraphSpace 下可以含多个图(graph)。
+- 兼容:不指定 GraphSpace 时,默认使用 "DEFAULT" 空间
 
-简单示例见[HugeGraph-Client](/cn/docs/quickstart/client/hugegraph-client)
+#### 4.1 创建GraphSpace
+
+```java
+GraphSpaceManager spaceManager = hugeClient.graphSpace();
+
+// 定义 GraphSpace 配置
+GraphSpace graphSpace = new GraphSpace();
+graphSpace.setName("myGraphSpace");
+graphSpace.setDescription("Business data graph space");
+graphSpace.setMaxGraphNumber(10);  // 最大图数量
+graphSpace.setMaxRoleNumber(100);  // 最大角色数量
+
+// 创建 GraphSpace
+spaceManager.createGraphSpace(graphSpace);
+```
+#### 4.2 GraphSpace 接口汇总
+
+| category | interface              | description                              
|
+|----------|------------------------|------------------------------------------|
+| 查询     | listGraphSpace()      | 获取所有 GraphSpace 列表                 |
+|          | getGraphSpace(String name)        | 获取指定 GraphSpace               
       |
+|      | space.getName()        | 获取 GraphSpace 名称                     |
+| 更新     | space.setDescription(String description) | 修改 GraphSpace 描述信息       
          |
+|      | space.setMaxGraphNumber(int maxNumber) | 设置 GraphSpace 最大图数量          
   |
+|      | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大图数量       
      |
+|      | updateGraphSpace(String name, GraphSpace space)     | 更新 GraphSpace 
配置                     |

Review Comment:
   ## ‼️ 关键问题
   
   ### 1. 中文文档中 GraphSpace 接口表格存在错误
   
   **位置:** content/cn/docs/clients/hugegraph-client.md:488
   
   在「GraphSpace 接口汇总」表格中,「更新」分类下有两个接口的描述都写成了「设置 GraphSpace 最大图数量」:
   
   ```
   | 更新 | space.setMaxGraphNumber(int maxNumber) | 设置 GraphSpace 最大图数量 |
   |      | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大图数量 |  
← 这里应该是「设置 GraphSpace 最大角色数量」
   ```
   
   **建议修复:**
   ```diff
   - |      | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大图数量   
          |
   + |      | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大角色数量  
           |
   ```
   
   ---
   
   ### 2. 中英文文档接口信息不一致
   
   **位置:** 
   - content/cn/docs/clients/hugegraph-client.md (中文版)
   - content/en/docs/clients/hugegraph-client.md (英文版)
   
   英文版的 GraphSpace 接口表格比中文版更完整,包含了以下查询接口:
   - `space.getDescription()` - 获取 GraphSpace 描述
   - `space.getGraphNumber()` - 获取 GraphSpace 下的图数量
   - `removeGraphSpace(String name, boolean force)` - 强制删除 GraphSpace(包括所有图数据)
   
   **建议:** 中文文档应补充这些接口说明以保持中英文一致性。
   
   ---
   
   ## ⚠️ 重要问题
   
   ### 3. SingleExample 示例中增加了认证配置但未说明
   
   **位置:** content/en/docs/quickstart/client/hugegraph-client.md:79
   
   英文版 SingleExample 中新增了 `.configUser("admin", "admin")` 配置:
   ```java
   HugeClient hugeClient = HugeClient.builder("http://127.0.0.1:8080";,
                                              "DEFAULT",
                                              "hugegraph")
                                     .configUser("admin", "admin")  // ← 新增
                                     .build();
   ```
   
   但中文版未添加此配置。
   
   **建议:** 
   1. 如果这是有意为之(演示不同场景),应在文档中说明
   2. 如果是遗漏,建议中英文保持一致
   3. 或在注释中说明该配置的使用场景(如「当 Server 开启权限认证时需配置」)
   
   ---
   
   ### 4. 删除了原有注释「If connect failed will throw a exception」
   
   **位置:** 
   - content/en/docs/quickstart/client/hugegraph-client.md:76
   - content/en/docs/quickstart/client/hugegraph-client.md:221
   
   这个注释对新手用户是有帮助的,建议保留。
   
   ---
   
   ### 5. localhost vs 127.0.0.1 不一致
   
   **位置:** 多处示例代码
   
   - SingleExample 中文版改为 `http://127.0.0.1:8080`
   - BatchExample 仍使用 `http://localhost:8080`
   
   **建议:** 统一使用同一地址格式以保持文档一致性。一般建议使用 `localhost` 因为更易读。
   
   ---
   
   ## 🧹 次要问题
   
   ### 6. 标题层级不一致
   
   **位置:** content/cn/docs/quickstart/client/hugegraph-client.md
   
   - 4.4 和 4.5 的标题使用了 `####` (四级标题)
   - 但它们应该和 4.1-4.3 一样使用 `###` (三级标题)
   
   **建议修复:**
   ```diff
   -#### 4.4 运行 Example
   +### 4.4 运行 Example
   
   -#### 4.5 详细 API 说明
   +### 4.5 详细 API 说明
   ```
   
   英文版也有相同问题。
   
   ---
   
   ### 7. 文件末尾缺少换行符
   
   **位置:** content/cn/docs/clients/hugegraph-client.md
   
   根据 .editorconfig 规范和最佳实践,文件应以换行符结尾。
   
   ---
   
   ## 总结
   
   主要需要修复:
   1. ‼️ 中文文档表格描述错误(最大角色数量)
   2. ‼️ 中英文接口文档不一致
   3. ⚠️ 示例代码中英文配置不一致(认证配置、地址格式)
   
   其他都是较小的格式问题。整体来说这是一个很好的功能文档更新,修复上述问题后即可合并。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to