From 07213c0cf4c5aac5a2579555dad8e7fd3791589f Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Tue, 9 Sep 2025 21:15:59 +0800 Subject: [PATCH 01/11] fixed mvn version to 1.7.0 added graphspace part for docs of client changed client examples to NEWER version fixed parameters in loader docs --- content/cn/docs/clients/hugegraph-client.md | 64 ++++++++++++++++++- .../quickstart/client/hugegraph-client.md | 13 ++-- .../quickstart/toolchain/hugegraph-loader.md | 5 +- content/en/docs/clients/hugegraph-client.md | 60 ++++++++++++++++- .../quickstart/client/hugegraph-client.md | 16 ++--- .../quickstart/toolchain/hugegraph-loader.md | 5 +- 6 files changed, 141 insertions(+), 22 deletions(-) diff --git a/content/cn/docs/clients/hugegraph-client.md b/content/cn/docs/clients/hugegraph-client.md index 1a9e1daa1..479ca75dc 100644 --- a/content/cn/docs/clients/hugegraph-client.md +++ b/content/cn/docs/clients/hugegraph-client.md @@ -18,7 +18,8 @@ HugeGraph-Client 是操作 graph 的总入口,用户必须先创建出 HugeGra ```java // HugeGraphServer 地址:"http://localhost:8080" // 图的名称:"hugegraph" -HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "hugegraph") +HugeClient hugeClient = HugeClient.builder("http://localhost:8080", + "DEFAULT", "hugegraph") .configTimeout(20) // 默认 20s 超时 .configUser("**", "**") // 默认未开启用户权限 .build(); @@ -455,6 +456,63 @@ Edge knows1 = marko.addEdge("knows", vadas, "city", "Beijing"); **注意:当 frequency 为 multiple 时必须要设置 sortKeys 对应属性类型的值。** -### 4 简单示例 +### 4 图空间(GraphSpace) +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); +``` +**GraphSpace 接口汇总** + +| category | interface | description | +|----------|------------------------|------------------------------------------| +| 查询 | listGraphSpaces() | 获取所有 GraphSpace 列表 | +| | getGraphSpace(String name) | 获取指定 GraphSpace | +| | space.getName() | 获取 GraphSpace 名称 | +| | space.getDescription() | 获取 GraphSpace 描述信息 | +| | space.getGraphNumber() | 获取 GraphSpace 下图的数量 | +| 更新 | getGraphSpace(String name) | 获取指定 GraphSpace | +| | space.setDescription(String description) | 修改 GraphSpace 描述信息 | +| | space.setMaxGraphNumber(int maxNumbe) | 设置 GraphSpace 最大图数量 | +| | updateGraphSpace(String name, GraphSpace space) | 更新 GraphSpace 配置 | +| 删除 | removeGraphSpace(String name) | 删除指定 GraphSpace | +| | removeGraphSpace(String name, boolean forc) | 强制删除 GraphSpace(包含所有图数据) | + +#### 4.2 GraphSpace 中的图管理 + + 在 GraphSpace 中,可以管理多个图: + +```java +// 在指定的 GraphSpace 中创建图 +GraphsManager graphsManager = hugeClient.graphs(); +Graph graph = new Graph(); +graph.setName("businessGraph"); +graph.setDescription("Business relationship graph"); +graphsManager.createGraph("myGraphSpace", graph); + +// 获取 GraphSpace 中的所有图 +List graphs = graphsManager.listGraphs("myGraphSpace"); + +// 获取指定图 +Graph businessGraph = graphsManager.getGraph("myGraphSpace", "businessGraph"); + +// 删除图 +graphsManager.removeGraph("myGraphSpace", "businessGraph"); +``` + +### 5 简单示例 + +简单示例见[HugeGraph-Client](/cn/docs/quickstart/client/hugegraph-client) \ No newline at end of file diff --git a/content/cn/docs/quickstart/client/hugegraph-client.md b/content/cn/docs/quickstart/client/hugegraph-client.md index 9d2165313..090f2a47e 100644 --- a/content/cn/docs/quickstart/client/hugegraph-client.md +++ b/content/cn/docs/quickstart/client/hugegraph-client.md @@ -48,7 +48,7 @@ weight: 1 org.apache.hugegraph hugegraph-client - 1.5.0 + 1.7.0 ``` @@ -78,7 +78,8 @@ public class SingleExample { public static void main(String[] args) throws IOException { // If connect failed will throw a exception. - HugeClient hugeClient = HugeClient.builder("http://localhost:8080", + HugeClient hugeClient = HugeClient.builder("http://127.0.0.1:8080", + "DEFAULT", "hugegraph") .build(); @@ -224,8 +225,8 @@ public class BatchExample { public static void main(String[] args) { // If connect failed will throw a exception. HugeClient hugeClient = HugeClient.builder("http://localhost:8080", - "hugegraph") - .build(); + "DEFAULT", + "hugegraph").build(); SchemaManager schema = hugeClient.schema(); @@ -348,12 +349,12 @@ public class BatchExample { } ``` -### 4.4 运行 Example +#### 4.4 运行 Example 运行 Example 之前需要启动 Server, 启动过程见[HugeGraph-Server Quick Start](/cn/docs/quickstart/hugegraph-server) -### 4.5 详细 API 说明 +#### 4.5 详细 API 说明 示例说明见[HugeGraph-Client 基本 API 介绍](/cn/docs/clients/hugegraph-client) diff --git a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md index a61093fba..d743d0fd0 100644 --- a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md @@ -790,9 +790,10 @@ schema: 必填 | 参数 | 默认值 | 是否必传 | 描述信息 | |---------------------------|-----------|------|-------------------------------------------------------------------| | `-f` 或 `--file` | | Y | 配置脚本的路径 | -| `-g` 或 `--graph` | | Y | 图数据库空间 | +| `-g` 或 `--graph` | | Y | 图数据库h | +| `-gs` 或 `--graphspace` | DEFAULT | | 图空间 | | `-s` 或 `--schema` | | Y | schema 文件路径 | | -| `-h` 或 `--host` | localhost | | HugeGraphServer 的地址 | +| `-h` 或 `--host` 或 `-i` | localhost | | HugeGraphServer 的地址 | | `-p` 或 `--port` | 8080 | | HugeGraphServer 的端口号 | | `--username` | null | | 当 HugeGraphServer 开启了权限认证时,当前图的 username | | `--token` | null | | 当 HugeGraphServer 开启了权限认证时,当前图的 token | diff --git a/content/en/docs/clients/hugegraph-client.md b/content/en/docs/clients/hugegraph-client.md index 5ae2db27e..abede701e 100644 --- a/content/en/docs/clients/hugegraph-client.md +++ b/content/en/docs/clients/hugegraph-client.md @@ -444,6 +444,64 @@ Edge knows1 = marko.addEdge("knows", vadas, "city", "Beijing"); **Note: When frequency is multiple, the value of the property type corresponding to sortKeys must be set.** -### 4 Examples +### 4 GraphSpace +The client supports multiple GraphSpaces in one physical deployment, and each GraphSpace can contain multiple graphs. +- Compatibility: When no GraphSpace is specified, the "DEFAULT" space is used by default. + +#### 4.1 Create GraphSpace + +```java +GraphSpaceManager spaceManager = hugeClient.graphSpace(); + +// Define GraphSpace configuration +GraphSpace graphSpace = new GraphSpace(); +graphSpace.setName("myGraphSpace"); +graphSpace.setDescription("Business data graph space"); +graphSpace.setMaxGraphNumber(10); // Maximum number of graphs +graphSpace.setMaxRoleNumber(100); // Maximum number of roles + +// Create GraphSpace +spaceManager.createGraphSpace(graphSpace); +``` + +**GraphSpace Interface Summary** + +| Category | Interface | Description | +|----------|-----------|-------------| +| Query | listGraphSpaces() | Get all GraphSpace lists | +| | getGraphSpace(String name) | Get the specified GraphSpace | +| | space.getName() | Get GraphSpace name | +| | space.getDescription() | Get GraphSpace description | +| | space.getGraphNumber() | Get the number of graphs under GraphSpace | +| Update | getGraphSpace(String name) | Get the specified GraphSpace | +| | space.setDescription(String description) | Modify GraphSpace description | +| | space.setMaxGraphNumber(int maxNumbe) | Set maximum number of graphs in GraphSpace | +| | updateGraphSpace(String name, GraphSpace space) | Update GraphSpace configuration | +| Delete | removeGraphSpace(String name) | Delete the specified GraphSpace | +| | removeGraphSpace(String name, boolean forc) | Force delete GraphSpace (including all graph data) | + +#### 4.2 Graph Management in GraphSpace + +You can manage multiple graphs in a GraphSpace: + +```java +// Create a graph in the specified GraphSpace +GraphsManager graphsManager = hugeClient.graphs(); +Graph graph = new Graph(); +graph.setName("businessGraph"); +graph.setDescription("Business relationship graph"); +graphsManager.createGraph("myGraphSpace", graph); + +// Get all graphs in GraphSpace +List graphs = graphsManager.listGraphs("myGraphSpace"); + +// Get the specified graph +Graph businessGraph = graphsManager.getGraph("myGraphSpace", "businessGraph"); + +// Delete graph +graphsManager.removeGraph("myGraphSpace", "businessGraph"); +``` + +### 5 Simple Example Simple examples can reference [HugeGraph-Client](/docs/quickstart/client/hugegraph-client) diff --git a/content/en/docs/quickstart/client/hugegraph-client.md b/content/en/docs/quickstart/client/hugegraph-client.md index f932beddf..b1aec0568 100644 --- a/content/en/docs/quickstart/client/hugegraph-client.md +++ b/content/en/docs/quickstart/client/hugegraph-client.md @@ -44,7 +44,7 @@ Using IDEA or Eclipse to create the project: org.apache.hugegraph hugegraph-client - 1.5.0 + 1.7.0 ``` @@ -73,9 +73,10 @@ import org.apache.hugegraph.structure.gremlin.ResultSet; public class SingleExample { public static void main(String[] args) throws IOException { - // If connect failed will throw a exception. - HugeClient hugeClient = HugeClient.builder("http://localhost:8080", + HugeClient hugeClient = HugeClient.builder("http://127.0.0.1:8080", + "DEFAULT", "hugegraph") + .configUser("admin", "admin") .build(); SchemaManager schema = hugeClient.schema(); @@ -218,10 +219,9 @@ import org.apache.hugegraph.structure.graph.Vertex; public class BatchExample { public static void main(String[] args) { - // If connect failed will throw a exception. HugeClient hugeClient = HugeClient.builder("http://localhost:8080", - "hugegraph") - .build(); + "DEFAULT", + "hugegraph").build(); SchemaManager schema = hugeClient.schema(); @@ -344,11 +344,11 @@ public class BatchExample { } ``` -### 4.4 Run The Example +#### 4.4 Run The Example Before running Example, you need to start the Server. For the startup process, see[HugeGraph-Server Quick Start](/docs/quickstart/hugegraph/hugegraph-server). -### 4.5 More Information About Client-API +#### 4.5 More Information About Client-API See[Introduce basic API of HugeGraph-Client](/docs/clients/hugegraph-client). diff --git a/content/en/docs/quickstart/toolchain/hugegraph-loader.md b/content/en/docs/quickstart/toolchain/hugegraph-loader.md index 8c625f36d..200722867 100644 --- a/content/en/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/en/docs/quickstart/toolchain/hugegraph-loader.md @@ -779,9 +779,10 @@ The import process is controlled by commands submitted by the user, and the user | Parameter | Default value | Required or not | Description | |---------------------------|---------------|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `-f` or `--file` | | Y | path to configure script | -| `-g` or `--graph` | | Y | graph space name | +| `-g` or `--graph` | | Y | graph name | +| `-gs` or `--graphspace` | DEFAULT | | graph space name | | `-s` or `--schema` | | Y | schema file path | -| `-h` or `--host` | localhost | | address of HugeGraphServer | +| `-h` or `--host` or `i` | localhost | | address of HugeGraphServer | | `-p` or `--port` | 8080 | | port number of HugeGraphServer | | `--username` | null | | When HugeGraphServer enables permission authentication, the username of the current graph | | `--token` | null | | When HugeGraphServer has enabled authorization authentication, the token of the current graph | From 17af21dc4dd5d962102e974733165eb262bf65fb Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Wed, 10 Sep 2025 00:12:50 +0800 Subject: [PATCH 02/11] fixed wrong formats & spellings --- content/cn/docs/clients/hugegraph-client.md | 12 ++++++------ .../cn/docs/quickstart/toolchain/hugegraph-loader.md | 4 ++-- content/en/docs/clients/hugegraph-client.md | 12 ++++++------ .../en/docs/quickstart/toolchain/hugegraph-loader.md | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/content/cn/docs/clients/hugegraph-client.md b/content/cn/docs/clients/hugegraph-client.md index 479ca75dc..84f2cb9f8 100644 --- a/content/cn/docs/clients/hugegraph-client.md +++ b/content/cn/docs/clients/hugegraph-client.md @@ -475,7 +475,7 @@ graphSpace.setMaxRoleNumber(100); // 最大角色数量 // 创建 GraphSpace spaceManager.createGraphSpace(graphSpace); ``` -**GraphSpace 接口汇总** +#### 4.2 GraphSpace 接口汇总 | category | interface | description | |----------|------------------------|------------------------------------------| @@ -484,14 +484,14 @@ spaceManager.createGraphSpace(graphSpace); | | space.getName() | 获取 GraphSpace 名称 | | | space.getDescription() | 获取 GraphSpace 描述信息 | | | space.getGraphNumber() | 获取 GraphSpace 下图的数量 | -| 更新 | getGraphSpace(String name) | 获取指定 GraphSpace | -| | space.setDescription(String description) | 修改 GraphSpace 描述信息 | -| | space.setMaxGraphNumber(int maxNumbe) | 设置 GraphSpace 最大图数量 | +| | getGraphSpace(String name) | 获取指定 GraphSpace | +| 更新 | space.setDescription(String description) | 修改 GraphSpace 描述信息 | +| | space.setMaxGraphNumber(int maxNumber) | 设置 GraphSpace 最大图数量 | | | updateGraphSpace(String name, GraphSpace space) | 更新 GraphSpace 配置 | | 删除 | removeGraphSpace(String name) | 删除指定 GraphSpace | -| | removeGraphSpace(String name, boolean forc) | 强制删除 GraphSpace(包含所有图数据) | +| | removeGraphSpace(String name, boolean force) | 强制删除 GraphSpace(包含所有图数据) | -#### 4.2 GraphSpace 中的图管理 +#### 4.3 GraphSpace 中的图管理 在 GraphSpace 中,可以管理多个图: diff --git a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md index d743d0fd0..abf3915ab 100644 --- a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md @@ -790,9 +790,9 @@ schema: 必填 | 参数 | 默认值 | 是否必传 | 描述信息 | |---------------------------|-----------|------|-------------------------------------------------------------------| | `-f` 或 `--file` | | Y | 配置脚本的路径 | -| `-g` 或 `--graph` | | Y | 图数据库h | +| `-g` 或 `--graph` | | Y | 图名称 | | `-gs` 或 `--graphspace` | DEFAULT | | 图空间 | -| `-s` 或 `--schema` | | Y | schema 文件路径 | | +| `-s` 或 `--schema` | | Y | schema 文件路径 | | `-h` 或 `--host` 或 `-i` | localhost | | HugeGraphServer 的地址 | | `-p` 或 `--port` | 8080 | | HugeGraphServer 的端口号 | | `--username` | null | | 当 HugeGraphServer 开启了权限认证时,当前图的 username | diff --git a/content/en/docs/clients/hugegraph-client.md b/content/en/docs/clients/hugegraph-client.md index abede701e..34c6b679d 100644 --- a/content/en/docs/clients/hugegraph-client.md +++ b/content/en/docs/clients/hugegraph-client.md @@ -464,7 +464,7 @@ graphSpace.setMaxRoleNumber(100); // Maximum number of roles spaceManager.createGraphSpace(graphSpace); ``` -**GraphSpace Interface Summary** +#### 4.2 GraphSpace Interface Summary | Category | Interface | Description | |----------|-----------|-------------| @@ -473,14 +473,14 @@ spaceManager.createGraphSpace(graphSpace); | | space.getName() | Get GraphSpace name | | | space.getDescription() | Get GraphSpace description | | | space.getGraphNumber() | Get the number of graphs under GraphSpace | -| Update | getGraphSpace(String name) | Get the specified GraphSpace | -| | space.setDescription(String description) | Modify GraphSpace description | -| | space.setMaxGraphNumber(int maxNumbe) | Set maximum number of graphs in GraphSpace | +| | getGraphSpace(String name) | Get the specified GraphSpace | +| Update| space.setDescription(String description) | Modify GraphSpace description | +| | space.setMaxGraphNumber(int maxNumber) | Set maximum number of graphs in GraphSpace | | | updateGraphSpace(String name, GraphSpace space) | Update GraphSpace configuration | | Delete | removeGraphSpace(String name) | Delete the specified GraphSpace | -| | removeGraphSpace(String name, boolean forc) | Force delete GraphSpace (including all graph data) | +| | removeGraphSpace(String name, boolean force) | Force delete GraphSpace (including all graph data) | -#### 4.2 Graph Management in GraphSpace +#### 4.3 Graph Management in GraphSpace You can manage multiple graphs in a GraphSpace: diff --git a/content/en/docs/quickstart/toolchain/hugegraph-loader.md b/content/en/docs/quickstart/toolchain/hugegraph-loader.md index 200722867..5c0613015 100644 --- a/content/en/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/en/docs/quickstart/toolchain/hugegraph-loader.md @@ -782,7 +782,7 @@ The import process is controlled by commands submitted by the user, and the user | `-g` or `--graph` | | Y | graph name | | `-gs` or `--graphspace` | DEFAULT | | graph space name | | `-s` or `--schema` | | Y | schema file path | -| `-h` or `--host` or `i` | localhost | | address of HugeGraphServer | +| `-h` or `--host` or `-i` | localhost | | address of HugeGraphServer | | `-p` or `--port` | 8080 | | port number of HugeGraphServer | | `--username` | null | | When HugeGraphServer enables permission authentication, the username of the current graph | | `--token` | null | | When HugeGraphServer has enabled authorization authentication, the token of the current graph | From 86ab30ff71105f7d29588e06fd2d0a5d699bee7a Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Thu, 11 Sep 2025 11:24:09 +0800 Subject: [PATCH 03/11] fixed errors && removed useless examples --- content/cn/docs/clients/hugegraph-client.md | 30 +++------------------ content/en/docs/clients/hugegraph-client.md | 26 ++---------------- 2 files changed, 5 insertions(+), 51 deletions(-) diff --git a/content/cn/docs/clients/hugegraph-client.md b/content/cn/docs/clients/hugegraph-client.md index 84f2cb9f8..74147ff40 100644 --- a/content/cn/docs/clients/hugegraph-client.md +++ b/content/cn/docs/clients/hugegraph-client.md @@ -456,7 +456,7 @@ Edge knows1 = marko.addEdge("knows", vadas, "city", "Beijing"); **注意:当 frequency 为 multiple 时必须要设置 sortKeys 对应属性类型的值。** -### 4 图空间(GraphSpace) +### 4 图管理 client支持一个物理部署中多个 GraphSpace,每个 GraphSpace 下可以含多个图(graph)。 - 兼容:不指定 GraphSpace 时,默认使用 "DEFAULT" 空间 @@ -479,39 +479,15 @@ spaceManager.createGraphSpace(graphSpace); | category | interface | description | |----------|------------------------|------------------------------------------| -| 查询 | listGraphSpaces() | 获取所有 GraphSpace 列表 | +| 查询 | listGraphSpace() | 获取所有 GraphSpace 列表 | | | getGraphSpace(String name) | 获取指定 GraphSpace | | | space.getName() | 获取 GraphSpace 名称 | -| | space.getDescription() | 获取 GraphSpace 描述信息 | -| | space.getGraphNumber() | 获取 GraphSpace 下图的数量 | -| | getGraphSpace(String name) | 获取指定 GraphSpace | | 更新 | space.setDescription(String description) | 修改 GraphSpace 描述信息 | | | space.setMaxGraphNumber(int maxNumber) | 设置 GraphSpace 最大图数量 | +| | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大图数量 | | | updateGraphSpace(String name, GraphSpace space) | 更新 GraphSpace 配置 | | 删除 | removeGraphSpace(String name) | 删除指定 GraphSpace | -| | removeGraphSpace(String name, boolean force) | 强制删除 GraphSpace(包含所有图数据) | -#### 4.3 GraphSpace 中的图管理 - - 在 GraphSpace 中,可以管理多个图: - -```java -// 在指定的 GraphSpace 中创建图 -GraphsManager graphsManager = hugeClient.graphs(); -Graph graph = new Graph(); -graph.setName("businessGraph"); -graph.setDescription("Business relationship graph"); -graphsManager.createGraph("myGraphSpace", graph); - -// 获取 GraphSpace 中的所有图 -List graphs = graphsManager.listGraphs("myGraphSpace"); - -// 获取指定图 -Graph businessGraph = graphsManager.getGraph("myGraphSpace", "businessGraph"); - -// 删除图 -graphsManager.removeGraph("myGraphSpace", "businessGraph"); -``` ### 5 简单示例 diff --git a/content/en/docs/clients/hugegraph-client.md b/content/en/docs/clients/hugegraph-client.md index 34c6b679d..44a8b47ec 100644 --- a/content/en/docs/clients/hugegraph-client.md +++ b/content/en/docs/clients/hugegraph-client.md @@ -468,40 +468,18 @@ spaceManager.createGraphSpace(graphSpace); | Category | Interface | Description | |----------|-----------|-------------| -| Query | listGraphSpaces() | Get all GraphSpace lists | +| Query | listGraphSpace() | Get all GraphSpace lists | | | getGraphSpace(String name) | Get the specified GraphSpace | | | space.getName() | Get GraphSpace name | | | space.getDescription() | Get GraphSpace description | | | space.getGraphNumber() | Get the number of graphs under GraphSpace | -| | getGraphSpace(String name) | Get the specified GraphSpace | | Update| space.setDescription(String description) | Modify GraphSpace description | | | space.setMaxGraphNumber(int maxNumber) | Set maximum number of graphs in GraphSpace | +| | space.setMaxRoleNumber(int maxRoleNumber) | Set maximum role number in GraphSpace | | | updateGraphSpace(String name, GraphSpace space) | Update GraphSpace configuration | | Delete | removeGraphSpace(String name) | Delete the specified GraphSpace | | | removeGraphSpace(String name, boolean force) | Force delete GraphSpace (including all graph data) | -#### 4.3 Graph Management in GraphSpace - -You can manage multiple graphs in a GraphSpace: - -```java -// Create a graph in the specified GraphSpace -GraphsManager graphsManager = hugeClient.graphs(); -Graph graph = new Graph(); -graph.setName("businessGraph"); -graph.setDescription("Business relationship graph"); -graphsManager.createGraph("myGraphSpace", graph); - -// Get all graphs in GraphSpace -List graphs = graphsManager.listGraphs("myGraphSpace"); - -// Get the specified graph -Graph businessGraph = graphsManager.getGraph("myGraphSpace", "businessGraph"); - -// Delete graph -graphsManager.removeGraph("myGraphSpace", "businessGraph"); -``` - ### 5 Simple Example Simple examples can reference [HugeGraph-Client](/docs/quickstart/client/hugegraph-client) From d41291662b2d3e2b092d887c1fc9a350ed69b592 Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Wed, 22 Oct 2025 00:34:04 +0800 Subject: [PATCH 04/11] edited according to review --- content/cn/docs/clients/hugegraph-client.md | 7 +++++-- content/cn/docs/quickstart/client/hugegraph-client.md | 4 ++-- content/en/docs/quickstart/client/hugegraph-client.md | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/content/cn/docs/clients/hugegraph-client.md b/content/cn/docs/clients/hugegraph-client.md index 74147ff40..16fee3121 100644 --- a/content/cn/docs/clients/hugegraph-client.md +++ b/content/cn/docs/clients/hugegraph-client.md @@ -482,13 +482,16 @@ spaceManager.createGraphSpace(graphSpace); | 查询 | listGraphSpace() | 获取所有 GraphSpace 列表 | | | getGraphSpace(String name) | 获取指定 GraphSpace | | | space.getName() | 获取 GraphSpace 名称 | +| | space.getDescription() | 获取 GraphSpace 描述 | +| | space.getGraphNumber() | 获取 GraphSpace 下图数量 | | 更新 | space.setDescription(String description) | 修改 GraphSpace 描述信息 | | | space.setMaxGraphNumber(int maxNumber) | 设置 GraphSpace 最大图数量 | -| | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大图数量 | +| | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大角色数量 | | | updateGraphSpace(String name, GraphSpace space) | 更新 GraphSpace 配置 | | 删除 | removeGraphSpace(String name) | 删除指定 GraphSpace | +| | removeGraphSpace(String name, boolean force) | 强制删除 GraphSpace (包括所有图数据) | ### 5 简单示例 -简单示例见[HugeGraph-Client](/cn/docs/quickstart/client/hugegraph-client) \ No newline at end of file +简单示例见[HugeGraph-Client](/cn/docs/quickstart/client/hugegraph-client) diff --git a/content/cn/docs/quickstart/client/hugegraph-client.md b/content/cn/docs/quickstart/client/hugegraph-client.md index 090f2a47e..c766633e9 100644 --- a/content/cn/docs/quickstart/client/hugegraph-client.md +++ b/content/cn/docs/quickstart/client/hugegraph-client.md @@ -78,9 +78,10 @@ public class SingleExample { public static void main(String[] args) throws IOException { // If connect failed will throw a exception. - HugeClient hugeClient = HugeClient.builder("http://127.0.0.1:8080", + HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph") + .configUser("admin", "admin") .build(); SchemaManager schema = hugeClient.schema(); @@ -357,4 +358,3 @@ public class BatchExample { #### 4.5 详细 API 说明 示例说明见[HugeGraph-Client 基本 API 介绍](/cn/docs/clients/hugegraph-client) - diff --git a/content/en/docs/quickstart/client/hugegraph-client.md b/content/en/docs/quickstart/client/hugegraph-client.md index b1aec0568..c0539c2af 100644 --- a/content/en/docs/quickstart/client/hugegraph-client.md +++ b/content/en/docs/quickstart/client/hugegraph-client.md @@ -73,7 +73,8 @@ import org.apache.hugegraph.structure.gremlin.ResultSet; public class SingleExample { public static void main(String[] args) throws IOException { - HugeClient hugeClient = HugeClient.builder("http://127.0.0.1:8080", + // If connect failed will throw a exception. + HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph") .configUser("admin", "admin") @@ -351,4 +352,3 @@ Before running Example, you need to start the Server. For the startup process, s #### 4.5 More Information About Client-API See[Introduce basic API of HugeGraph-Client](/docs/clients/hugegraph-client). - From 0fc05c911333fa5611d0fa020b12a3d7ff967985 Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Wed, 22 Oct 2025 19:37:32 +0800 Subject: [PATCH 05/11] fixed formats problems --- content/cn/docs/clients/hugegraph-client.md | 29 +++++++++---------- .../quickstart/client/hugegraph-client.md | 3 +- content/en/docs/clients/hugegraph-client.md | 22 +++++++------- .../quickstart/client/hugegraph-client.md | 3 +- 4 files changed, 27 insertions(+), 30 deletions(-) diff --git a/content/cn/docs/clients/hugegraph-client.md b/content/cn/docs/clients/hugegraph-client.md index 16fee3121..c5c1b4d0f 100644 --- a/content/cn/docs/clients/hugegraph-client.md +++ b/content/cn/docs/clients/hugegraph-client.md @@ -13,13 +13,12 @@ weight: 2 HugeGraph-Client 是操作 graph 的总入口,用户必须先创建出 HugeGraph-Client 对象,与 HugeGraph-Server 建立连接(伪连接)后,才能获取到 schema、graph 以及 gremlin 的操作入口对象。 -目前 HugeGraph-Client 只允许连接服务端已存在的图,无法自定义图进行创建。其创建方法如下: +目前 HugeGraph-Client 只允许连接服务端已存在的图,无法自定义图进行创建。同时,需注意1.7.0后,构建 HugeGraph-Client 必须指定 GraphSpace (如默认 "DEFAULT")。其创建方法如下: ```java // HugeGraphServer 地址:"http://localhost:8080" // 图的名称:"hugegraph" -HugeClient hugeClient = HugeClient.builder("http://localhost:8080", - "DEFAULT", "hugegraph") +HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph") .configTimeout(20) // 默认 20s 超时 .configUser("**", "**") // 默认未开启用户权限 .build(); @@ -477,19 +476,17 @@ spaceManager.createGraphSpace(graphSpace); ``` #### 4.2 GraphSpace 接口汇总 -| category | interface | description | -|----------|------------------------|------------------------------------------| -| 查询 | listGraphSpace() | 获取所有 GraphSpace 列表 | -| | getGraphSpace(String name) | 获取指定 GraphSpace | -| | space.getName() | 获取 GraphSpace 名称 | -| | space.getDescription() | 获取 GraphSpace 描述 | -| | space.getGraphNumber() | 获取 GraphSpace 下图数量 | -| 更新 | space.setDescription(String description) | 修改 GraphSpace 描述信息 | -| | space.setMaxGraphNumber(int maxNumber) | 设置 GraphSpace 最大图数量 | -| | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大角色数量 | -| | updateGraphSpace(String name, GraphSpace space) | 更新 GraphSpace 配置 | -| 删除 | removeGraphSpace(String name) | 删除指定 GraphSpace | -| | removeGraphSpace(String name, boolean force) | 强制删除 GraphSpace (包括所有图数据) | +| 类别 | 接口 | 描述 | +|------|------|------| +| 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) | 设置最大图数量 | ### 5 简单示例 diff --git a/content/cn/docs/quickstart/client/hugegraph-client.md b/content/cn/docs/quickstart/client/hugegraph-client.md index c766633e9..23a8f9b4b 100644 --- a/content/cn/docs/quickstart/client/hugegraph-client.md +++ b/content/cn/docs/quickstart/client/hugegraph-client.md @@ -81,7 +81,8 @@ public class SingleExample { HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph") - .configUser("admin", "admin") + .configUser("username", "password") + # 这是示例,生产环境需要使用安全的凭证 .build(); SchemaManager schema = hugeClient.schema(); diff --git a/content/en/docs/clients/hugegraph-client.md b/content/en/docs/clients/hugegraph-client.md index 44a8b47ec..169f26744 100644 --- a/content/en/docs/clients/hugegraph-client.md +++ b/content/en/docs/clients/hugegraph-client.md @@ -12,7 +12,7 @@ The `gremlin(groovy)` written by the user in `HugeGraph-Studio` can refer to the HugeGraph-Client is the general entry for operating graph. Users must first create a HugeGraph-Client object and establish a connection (pseudo connection) with HugeGraph-Server before they can obtain the operation entry objects of schema, graph and gremlin. -Currently, HugeGraph-Client only allows connections to existing graphs on the server, and cannot create custom graphs. Its creation method is as follows: +Currently, HugeGraph-Client only allows connections to existing graphs on the server, and cannot create custom graphs. Meanwhile, it should be noted that starting from version 1.7.0, building the HugeGraph-Client must specify a GraphSpace (e.g., the default "DEFAULT"). Its creation method is as follows: ```java // HugeGraphServer address: "http://localhost:8080" @@ -468,17 +468,15 @@ spaceManager.createGraphSpace(graphSpace); | Category | Interface | Description | |----------|-----------|-------------| -| Query | listGraphSpace() | Get all GraphSpace lists | -| | getGraphSpace(String name) | Get the specified GraphSpace | -| | space.getName() | Get GraphSpace name | -| | space.getDescription() | Get GraphSpace description | -| | space.getGraphNumber() | Get the number of graphs under GraphSpace | -| Update| space.setDescription(String description) | Modify GraphSpace description | -| | space.setMaxGraphNumber(int maxNumber) | Set maximum number of graphs in GraphSpace | -| | space.setMaxRoleNumber(int maxRoleNumber) | Set maximum role number in GraphSpace | -| | updateGraphSpace(String name, GraphSpace space) | Update GraphSpace configuration | -| Delete | removeGraphSpace(String name) | Delete the specified GraphSpace | -| | removeGraphSpace(String name, boolean force) | Force delete GraphSpace (including all graph data) | +| Manager - Query | listGraphSpace() | Get the list of all GraphSpaces | +| | getGraphSpace(String name) | Get the specified GraphSpace | +| Manager - Create/Update | createGraphSpace(GraphSpace) | Create a GraphSpace | +| | updateGraphSpace(String, GraphSpace) | Update configuration | +| Manager - Delete | removeGraphSpace(String) | Delete the specified GraphSpace | +| GraphSpace - Properties | getName() / getDescription() | Get name / description | +| | getGraphNumber() | Get the number of graphs | +| GraphSpace - Configuration | setDescription(String) | Set description | +| | setMaxGraphNumber(int) | Set the maximum number of graphs | ### 5 Simple Example diff --git a/content/en/docs/quickstart/client/hugegraph-client.md b/content/en/docs/quickstart/client/hugegraph-client.md index c0539c2af..ae3bc97f5 100644 --- a/content/en/docs/quickstart/client/hugegraph-client.md +++ b/content/en/docs/quickstart/client/hugegraph-client.md @@ -77,7 +77,8 @@ public class SingleExample { HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph") - .configUser("admin", "admin") + .configUser("username", "password") + # This is an example. In a production environment, secure credentials should be used. .build(); SchemaManager schema = hugeClient.schema(); From db852d672f8050a1e78108dc54bce3c2b65cef2d Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Sun, 23 Nov 2025 18:06:27 +0800 Subject: [PATCH 06/11] update loader doc for loadSource(graph) && loadOptions --- .../quickstart/toolchain/hugegraph-loader.md | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md index abf3915ab..0f7976984 100644 --- a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md @@ -601,7 +601,7 @@ bin/mapping-convert.sh struct.json ##### 3.3.2 输入源 -输入源目前分为四类:FILE、HDFS、JDBC、KAFKA,由`type`节点区分,我们称为本地文件输入源、HDFS 输入源、JDBC 输入源和 KAFKA 输入源,下面分别介绍。 +输入源目前分为五类:FILE、HDFS、JDBC、KAFKA、GRAPH,由`type`节点区分,我们称为本地文件输入源、HDFS 输入源、JDBC 输入源和 KAFKA 输入源,图数据源,下面分别介绍。 ###### 3.3.2.1 本地文件输入源 @@ -705,6 +705,22 @@ schema: 必填 - skipped_line:想跳过的行,复合结构,目前只能配置要跳过的行的正则表达式,用子节点 regex 描述,默认不跳过任何行,选填; - early_stop:某次从 Kafka broker 拉取的记录为空,停止任务,默认为 false,仅用于调试,选填; +###### 3.3.2.4 GRAPH 输入源 + +- type:输入源类型,必须填 `graph` 或 `GRAPH`,必填; +- graphspace:源图空间名称,默认为 `DEFAULT`; +- graph: 源图名称,必填; +- username:HugeGraph 用户名; +- password:HugeGraph 密码; +- selected_vertices:要同步的顶点筛选规则; +- ignored_vertices:要忽略的顶点筛选规则; +- selected_edges:要同步的边筛选规则; +- ignored_edges:要忽略的边筛选规则; +- pd-peers:HugeGraph-PD 节点地址; +- meta-endpoints:源集群 Meta服务端点; +- cluster:源集群名称; +- batch_size:批量读取源图数据的批次大小,默认为500; + ##### 3.3.3 顶点和边映射 顶点和边映射的节点(JSON 文件中的一个 key)有很多相同的部分,下面先介绍相同部分,再分别介绍`顶点映射`和`边映射`的特有节点。 @@ -796,8 +812,16 @@ schema: 必填 | `-h` 或 `--host` 或 `-i` | localhost | | HugeGraphServer 的地址 | | `-p` 或 `--port` | 8080 | | HugeGraphServer 的端口号 | | `--username` | null | | 当 HugeGraphServer 开启了权限认证时,当前图的 username | +| `--password` | null | | 当 HugeGraphServer 开启了权限认证时,当前图的 password | +| `--create-graph` | false | | 是否在图不存在时自动创建 | | `--token` | null | | 当 HugeGraphServer 开启了权限认证时,当前图的 token | | `--protocol` | http | | 向服务端发请求的协议,可选 http 或 https | +| `--pd-peers` | | | PD 服务节点地址 | +| `--pd-token` | | | 访问 PD 服务的 token | +| `--meta-endpoints` | | | 元信息存储服务地址 | +| `--direct` | false | | 是否直连 HugeGraph-Store | +| `--route-type` | NODE_PORT | | 路由选择方式(可选值:NODE_PORT / DDS / BOTH) | +| `--cluster` | hg | | 集群名 | | `--trust-store-file` | | | 请求协议为 https 时,客户端的证书文件路径 | | `--trust-store-password` | | | 请求协议为 https 时,客户端证书密码 | | `--clear-all-data` | false | | 导入数据前是否清除服务端的原有数据 | From cf8d674e63a29310a570bd2cc8198edc1bade9c2 Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Fri, 28 Nov 2025 11:07:39 +0800 Subject: [PATCH 07/11] fixed minor errors --- .../quickstart/client/hugegraph-client.md | 7 ++- .../quickstart/toolchain/hugegraph-loader.md | 26 ++++---- .../quickstart/client/hugegraph-client.md | 7 ++- .../quickstart/toolchain/hugegraph-loader.md | 62 +++++++++++++------ 4 files changed, 66 insertions(+), 36 deletions(-) diff --git a/content/cn/docs/quickstart/client/hugegraph-client.md b/content/cn/docs/quickstart/client/hugegraph-client.md index 23a8f9b4b..009d3ba8b 100644 --- a/content/cn/docs/quickstart/client/hugegraph-client.md +++ b/content/cn/docs/quickstart/client/hugegraph-client.md @@ -82,7 +82,7 @@ public class SingleExample { "DEFAULT", "hugegraph") .configUser("username", "password") - # 这是示例,生产环境需要使用安全的凭证 + // 这是示例,生产环境需要使用安全的凭证 .build(); SchemaManager schema = hugeClient.schema(); @@ -228,7 +228,10 @@ public class BatchExample { // If connect failed will throw a exception. HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", - "hugegraph").build(); + "hugegraph") + .configUser("username", "password") + // 这是示例,生产环境需要使用安全的凭证 + .build(); SchemaManager schema = hugeClient.schema(); diff --git a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md index 0f7976984..bb61279a9 100644 --- a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md @@ -705,7 +705,7 @@ schema: 必填 - skipped_line:想跳过的行,复合结构,目前只能配置要跳过的行的正则表达式,用子节点 regex 描述,默认不跳过任何行,选填; - early_stop:某次从 Kafka broker 拉取的记录为空,停止任务,默认为 false,仅用于调试,选填; -###### 3.3.2.4 GRAPH 输入源 +###### 3.3.2.5 GRAPH 输入源 - type:输入源类型,必须填 `graph` 或 `GRAPH`,必填; - graphspace:源图空间名称,默认为 `DEFAULT`; @@ -807,28 +807,28 @@ schema: 必填 |---------------------------|-----------|------|-------------------------------------------------------------------| | `-f` 或 `--file` | | Y | 配置脚本的路径 | | `-g` 或 `--graph` | | Y | 图名称 | -| `-gs` 或 `--graphspace` | DEFAULT | | 图空间 | +| `-gs` 或 `--graphspace` | DEFAULT | | 图空间 | | `-s` 或 `--schema` | | Y | schema 文件路径 | -| `-h` 或 `--host` 或 `-i` | localhost | | HugeGraphServer 的地址 | +| `-h` 或 `--host` 或 `-i` | localhost | | HugeGraphServer 的地址 | | `-p` 或 `--port` | 8080 | | HugeGraphServer 的端口号 | | `--username` | null | | 当 HugeGraphServer 开启了权限认证时,当前图的 username | | `--password` | null | | 当 HugeGraphServer 开启了权限认证时,当前图的 password | -| `--create-graph` | false | | 是否在图不存在时自动创建 | +| `--create-graph` | false | | 是否在图不存在时自动创建 | | `--token` | null | | 当 HugeGraphServer 开启了权限认证时,当前图的 token | | `--protocol` | http | | 向服务端发请求的协议,可选 http 或 https | -| `--pd-peers` | | | PD 服务节点地址 | -| `--pd-token` | | | 访问 PD 服务的 token | -| `--meta-endpoints` | | | 元信息存储服务地址 | -| `--direct` | false | | 是否直连 HugeGraph-Store | -| `--route-type` | NODE_PORT | | 路由选择方式(可选值:NODE_PORT / DDS / BOTH) | -| `--cluster` | hg | | 集群名 | +| `--pd-peers` | | | PD 服务节点地址 | +| `--pd-token` | | | 访问 PD 服务的 token | +| `--meta-endpoints` | | | 元信息存储服务地址 | +| `--direct` | false | | 是否直连 HugeGraph-Store | +| `--route-type` | NODE_PORT | | 路由选择方式(可选值:NODE_PORT / DDS / BOTH) | +| `--cluster` | hg | | 集群名 | | `--trust-store-file` | | | 请求协议为 https 时,客户端的证书文件路径 | | `--trust-store-password` | | | 请求协议为 https 时,客户端证书密码 | | `--clear-all-data` | false | | 导入数据前是否清除服务端的原有数据 | | `--clear-timeout` | 240 | | 导入数据前清除服务端的原有数据的超时时间 | -| `--incremental-mode` | false | | 是否使用断点续导模式,仅输入源为 FILE 和 HDFS 支持该模式,启用该模式能从上一次导入停止的地方开始导 | +| `--incremental-mode` | false | | 是否使用断点续导模式,仅输入源为 FILE 和 HDFS 支持该模式,启用该模式能从上一次导入停止的地方开始导入 | | `--failure-mode` | false | | 失败模式为 true 时,会导入之前失败了的数据,一般来说失败数据文件需要在人工更正编辑好后,再次进行导入 | -| `--batch-insert-threads` | CPUs | | 批量插入线程池大小 (CPUs 是当前 OS 可用可用**逻辑核**个数) | +| `--batch-insert-threads` | CPUs | | 批量插入线程池大小 (CPUs 是当前 OS 可用**逻辑核**个数) | | `--single-insert-threads` | 8 | | 单条插入线程池的大小 | | `--max-conn` | 4 * CPUs | | HugeClient 与 HugeGraphServer 的最大 HTTP 连接数,**调整线程**的时候建议同时调整此项 | | `--max-conn-per-route` | 2 * CPUs | | HugeClient 与 HugeGraphServer 每个路由的最大 HTTP 连接数,**调整线程**的时候建议同时调整此项 | @@ -842,7 +842,7 @@ schema: 必填 | `--check-vertex` | false | | 插入边时是否检查边所连接的顶点是否存在 | | `--print-progress` | true | | 是否在控制台实时打印导入条数 | | `--dry-run` | false | | 打开该模式,只解析不导入,通常用于测试 | -| `--help` | false | | 打印帮助信息 | +| `--help` | false | | 打印帮助信息 | | ##### 3.4.2 断点续导模式 diff --git a/content/en/docs/quickstart/client/hugegraph-client.md b/content/en/docs/quickstart/client/hugegraph-client.md index ae3bc97f5..91ac7865e 100644 --- a/content/en/docs/quickstart/client/hugegraph-client.md +++ b/content/en/docs/quickstart/client/hugegraph-client.md @@ -78,7 +78,7 @@ public class SingleExample { "DEFAULT", "hugegraph") .configUser("username", "password") - # This is an example. In a production environment, secure credentials should be used. + // This is an example. In a production environment, secure credentials should be used. .build(); SchemaManager schema = hugeClient.schema(); @@ -223,7 +223,10 @@ public class BatchExample { public static void main(String[] args) { HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", - "hugegraph").build(); + "hugegraph") + .configUser("username", "password") + // This is an example. In a production environment, secure credentials should be used. + .build(); SchemaManager schema = hugeClient.schema(); diff --git a/content/en/docs/quickstart/toolchain/hugegraph-loader.md b/content/en/docs/quickstart/toolchain/hugegraph-loader.md index 5c0613015..af17183d6 100644 --- a/content/en/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/en/docs/quickstart/toolchain/hugegraph-loader.md @@ -590,7 +590,7 @@ A struct-v2.json will be generated in the same directory as struct.json. ##### 3.3.2 Input Source -Input sources are currently divided into four categories: FILE, HDFS, JDBC and KAFKA, which are distinguished by the `type` node. We call them local file input sources, HDFS input sources, JDBC input sources, and KAFKA input sources, which are described below. +Input sources are currently divided into four categories: FILE, HDFS, JDBC, KAFKA and GRAPH, which are distinguished by the `type` node. We call them local file input sources, HDFS input sources, JDBC input sources, KAFKA input sources and GRAPH input source, which are described below. ###### 3.3.2.1 Local file input source @@ -694,6 +694,22 @@ schema: required - skipped_line: the line you want to skip, composite structure, currently can only configure the regular expression of the line to be skipped, described by the child node regex, the default is not to skip any line, optional; - early_stop: the record pulled from Kafka broker at a certain time is empty, stop the task, default is false, only for debugging, optional; +###### 3.3.2.5 GRAPH input Source + +- type: Data source type; must be filled in as `graph` or `GRAPH` (required); +- graphspace: Source graphSpace name; default is `DEFAULT`; +- graph: Source graph name (required); +- username: HugeGraph username; +- password: HugeGraph password; +- selected_vertices: Filtering rules for vertices to be synchronized; +- ignored_vertices: Filtering rules for vertices to be ignored; +- selected_edges: Filtering rules for edges to be synchronized; +- ignored_edges: Filtering rules for edges to be ignored; +- pd-peers: HugeGraph-PD node addresses; +- meta-endpoints: Meta service endpoints of the source cluster; +- cluster: Source cluster name; +- batch_size: Batch size for reading data from the source graph; default is 500; + ##### 3.3.3 Vertex and Edge Mapping The nodes of vertex and edge mapping (a key in the JSON file) have a lot of the same parts. The same parts are introduced first, and then the unique nodes of `vertex map` and `edge map` are introduced respectively. @@ -778,36 +794,44 @@ The import process is controlled by commands submitted by the user, and the user | Parameter | Default value | Required or not | Description | |---------------------------|---------------|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `-f` or `--file` | | Y | path to configure script | -| `-g` or `--graph` | | Y | graph name | -| `-gs` or `--graphspace` | DEFAULT | | graph space name | -| `-s` or `--schema` | | Y | schema file path | -| `-h` or `--host` or `-i` | localhost | | address of HugeGraphServer | -| `-p` or `--port` | 8080 | | port number of HugeGraphServer | +| `-f` or `--file` | | Y | Path to configure script | +| `-g` or `--graph` | | Y | Graph name | +| `-gs` or `--graphspace` | DEFAULT | | Graph space name | +| `-s` or `--schema` | | Y | Schema file path | +| `-h` or `--host` or `-i` | localhost | | Address of HugeGraphServer | +| `-p` or `--port` | 8080 | | Port number of HugeGraphServer | | `--username` | null | | When HugeGraphServer enables permission authentication, the username of the current graph | +| `--password` | null | | When HugeGraphServer enables permission authentication, the password of the current graph | +| `--create-graph` | false | | Whether to automatically create the graph if it does not exist | | `--token` | null | | When HugeGraphServer has enabled authorization authentication, the token of the current graph | | `--protocol` | http | | Protocol for sending requests to the server, optional http or https | +| `--pd-peers` | | | PD service node addresses | +| `--pd-token` | | | Token for accessing PD service | +| `--meta-endpoints` | | | Meta information storage service addresses | +| `--direct` | false | | Whether to directly connect to HugeGraph-Store | +| `--route-type` | NODE_PORT | | Route selection method (optional values: NODE_PORT / DDS / BOTH) | +| `--cluster` | hg | | Cluster name | | `--trust-store-file` | | | When the request protocol is https, the client's certificate file path | | `--trust-store-password` | | | When the request protocol is https, the client certificate password | | `--clear-all-data` | false | | Whether to clear the original data on the server before importing data | | `--clear-timeout` | 240 | | Timeout for clearing the original data on the server before importing data | -| `--incremental-mode` | false | | Whether to use the breakpoint resume mode, only the input source is FILE and HDFS support this mode, enabling this mode can start the import from the place where the last import stopped | -| `--failure-mode` | false | | When the failure mode is true, the data that failed before will be imported. Generally speaking, the failed data file needs to be manually corrected and edited, and then imported again | +| `--incremental-mode` | false | | Whether to use the breakpoint resume mode; only input sources FILE and HDFS support this mode. Enabling this mode allows starting the import from where the last import stopped | +| `--failure-mode` | false | | When failure mode is true, previously failed data will be imported. Generally, the failed data file needs to be manually corrected and edited before re-importing | | `--batch-insert-threads` | CPUs | | Batch insert thread pool size (CPUs is the number of **logical cores** available to the current OS) | | `--single-insert-threads` | 8 | | Size of single insert thread pool | -| `--max-conn` | 4 * CPUs | | The maximum number of HTTP connections between HugeClient and HugeGraphServer, it is recommended to adjust this when **adjusting threads** | -| `--max-conn-per-route` | 2 * CPUs | | The maximum number of HTTP connections for each route between HugeClient and HugeGraphServer, it is recommended to adjust this item at the same time when **adjusting the thread** | +| `--max-conn` | 4 * CPUs | | The maximum number of HTTP connections between HugeClient and HugeGraphServer; it is recommended to adjust this when **adjusting threads** | +| `--max-conn-per-route` | 2 * CPUs | | The maximum number of HTTP connections for each route between HugeClient and HugeGraphServer; it is recommended to adjust this item when **adjusting threads** | | `--batch-size` | 500 | | The number of data items in each batch when importing data | -| `--max-parse-errors` | 1 | | The maximum number of lines of data parsing errors allowed, and the program exits when this value is reached | -| `--max-insert-errors` | 500 | | The maximum number of rows of data insertion errors allowed, and the program exits when this value is reached | -| `--timeout` | 60 | | Timeout (seconds) for inserting results to return | +| `--max-parse-errors` | 1 | | The maximum number of data parsing errors allowed (per line); the program exits when this value is reached | +| `--max-insert-errors` | 500 | | The maximum number of data insertion errors allowed (per row); the program exits when this value is reached | +| `--timeout` | 60 | | Timeout (seconds) for insert result return | | `--shutdown-timeout` | 10 | | Waiting time for multithreading to stop (seconds) | | `--retry-times` | 0 | | Number of retries when a specific exception occurs | -| `--retry-interval` | 10 | | interval before retry (seconds) | -| `--check-vertex` | false | | Whether to check whether the vertex connected by the edge exists when inserting the edge | -| `--print-progress` | true | | Whether to print the number of imported items in the console in real time | -| `--dry-run` | false | | Turn on this mode, only parsing but not importing, usually used for testing | -| `--help` | false | | print help information | +| `--retry-interval` | 10 | | Interval before retry (seconds) | +| `--check-vertex` | false | | Whether to check if the vertices connected by the edge exist when inserting the edge | +| `--print-progress` | true | | Whether to print the number of imported items in real time on the console | +| `--dry-run` | false | | Enable this mode to only parse data without importing; usually used for testing | +| `--help` | false | | Print help information | | ##### 3.4.2 Breakpoint Continuation Mode From 5c53fcd4df8125833a36ef9be602874462398079 Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Fri, 28 Nov 2025 11:24:20 +0800 Subject: [PATCH 08/11] (fix):error in parameter description --- content/cn/docs/clients/hugegraph-client.md | 2 +- content/en/docs/quickstart/toolchain/hugegraph-loader.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/cn/docs/clients/hugegraph-client.md b/content/cn/docs/clients/hugegraph-client.md index c5c1b4d0f..e42498907 100644 --- a/content/cn/docs/clients/hugegraph-client.md +++ b/content/cn/docs/clients/hugegraph-client.md @@ -13,7 +13,7 @@ weight: 2 HugeGraph-Client 是操作 graph 的总入口,用户必须先创建出 HugeGraph-Client 对象,与 HugeGraph-Server 建立连接(伪连接)后,才能获取到 schema、graph 以及 gremlin 的操作入口对象。 -目前 HugeGraph-Client 只允许连接服务端已存在的图,无法自定义图进行创建。同时,需注意1.7.0后,构建 HugeGraph-Client 必须指定 GraphSpace (如默认 "DEFAULT")。其创建方法如下: +目前 HugeGraph-Client 只允许连接服务端已存在的图,无法自定义图进行创建。同时,需注意 1.7.0 后,构建 HugeGraph-Client 必须指定 GraphSpace(如默认 "DEFAULT")。其创建方法如下: ```java // HugeGraphServer 地址:"http://localhost:8080" diff --git a/content/en/docs/quickstart/toolchain/hugegraph-loader.md b/content/en/docs/quickstart/toolchain/hugegraph-loader.md index af17183d6..2a95fa4f3 100644 --- a/content/en/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/en/docs/quickstart/toolchain/hugegraph-loader.md @@ -831,7 +831,7 @@ The import process is controlled by commands submitted by the user, and the user | `--check-vertex` | false | | Whether to check if the vertices connected by the edge exist when inserting the edge | | `--print-progress` | true | | Whether to print the number of imported items in real time on the console | | `--dry-run` | false | | Enable this mode to only parse data without importing; usually used for testing | -| `--help` | false | | Print help information | | +| `--help` | false | | Print help information | ##### 3.4.2 Breakpoint Continuation Mode From 13ef946ef38eb3ee533630e7959aec7d9733f5b5 Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Fri, 28 Nov 2025 14:33:27 +0800 Subject: [PATCH 09/11] (fix): wrong countings && indentation --- content/cn/docs/quickstart/client/hugegraph-client.md | 10 +++++----- .../cn/docs/quickstart/toolchain/hugegraph-loader.md | 4 ++-- .../en/docs/quickstart/toolchain/hugegraph-loader.md | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/content/cn/docs/quickstart/client/hugegraph-client.md b/content/cn/docs/quickstart/client/hugegraph-client.md index 009d3ba8b..9322aabfa 100644 --- a/content/cn/docs/quickstart/client/hugegraph-client.md +++ b/content/cn/docs/quickstart/client/hugegraph-client.md @@ -227,11 +227,11 @@ public class BatchExample { public static void main(String[] args) { // If connect failed will throw a exception. HugeClient hugeClient = HugeClient.builder("http://localhost:8080", - "DEFAULT", - "hugegraph") - .configUser("username", "password") - // 这是示例,生产环境需要使用安全的凭证 - .build(); + "DEFAULT", + "hugegraph") + .configUser("username", "password") + // 这是示例,生产环境需要使用安全的凭证 + .build(); SchemaManager schema = hugeClient.schema(); diff --git a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md index bb61279a9..874603b3c 100644 --- a/content/cn/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/cn/docs/quickstart/toolchain/hugegraph-loader.md @@ -601,7 +601,7 @@ bin/mapping-convert.sh struct.json ##### 3.3.2 输入源 -输入源目前分为五类:FILE、HDFS、JDBC、KAFKA、GRAPH,由`type`节点区分,我们称为本地文件输入源、HDFS 输入源、JDBC 输入源和 KAFKA 输入源,图数据源,下面分别介绍。 +输入源目前分为五类:FILE、HDFS、JDBC、KAFKA 和 GRAPH,由`type`节点区分,我们称为本地文件输入源、HDFS 输入源、JDBC 输入源和 KAFKA 输入源,图数据源,下面分别介绍。 ###### 3.3.2.1 本地文件输入源 @@ -842,7 +842,7 @@ schema: 必填 | `--check-vertex` | false | | 插入边时是否检查边所连接的顶点是否存在 | | `--print-progress` | true | | 是否在控制台实时打印导入条数 | | `--dry-run` | false | | 打开该模式,只解析不导入,通常用于测试 | -| `--help` | false | | 打印帮助信息 | | +| `--help` | false | | 打印帮助信息 | ##### 3.4.2 断点续导模式 diff --git a/content/en/docs/quickstart/toolchain/hugegraph-loader.md b/content/en/docs/quickstart/toolchain/hugegraph-loader.md index 2a95fa4f3..310959850 100644 --- a/content/en/docs/quickstart/toolchain/hugegraph-loader.md +++ b/content/en/docs/quickstart/toolchain/hugegraph-loader.md @@ -590,7 +590,7 @@ A struct-v2.json will be generated in the same directory as struct.json. ##### 3.3.2 Input Source -Input sources are currently divided into four categories: FILE, HDFS, JDBC, KAFKA and GRAPH, which are distinguished by the `type` node. We call them local file input sources, HDFS input sources, JDBC input sources, KAFKA input sources and GRAPH input source, which are described below. +Input sources are currently divided into five categories: FILE, HDFS, JDBC, KAFKA and GRAPH, which are distinguished by the `type` node. We call them local file input sources, HDFS input sources, JDBC input sources, KAFKA input sources and GRAPH input source, which are described below. ###### 3.3.2.1 Local file input source @@ -831,7 +831,7 @@ The import process is controlled by commands submitted by the user, and the user | `--check-vertex` | false | | Whether to check if the vertices connected by the edge exist when inserting the edge | | `--print-progress` | true | | Whether to print the number of imported items in real time on the console | | `--dry-run` | false | | Enable this mode to only parse data without importing; usually used for testing | -| `--help` | false | | Print help information | +| `--help` | false | | Print help information | ##### 3.4.2 Breakpoint Continuation Mode From acbfac9a6322bf139240fcab5506ca8137641eac Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Fri, 28 Nov 2025 22:19:02 +0800 Subject: [PATCH 10/11] (fix): wrong explanation for client building --- content/cn/docs/clients/hugegraph-client.md | 4 ++-- content/en/docs/clients/hugegraph-client.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/cn/docs/clients/hugegraph-client.md b/content/cn/docs/clients/hugegraph-client.md index e42498907..d2ab74e8e 100644 --- a/content/cn/docs/clients/hugegraph-client.md +++ b/content/cn/docs/clients/hugegraph-client.md @@ -13,12 +13,12 @@ weight: 2 HugeGraph-Client 是操作 graph 的总入口,用户必须先创建出 HugeGraph-Client 对象,与 HugeGraph-Server 建立连接(伪连接)后,才能获取到 schema、graph 以及 gremlin 的操作入口对象。 -目前 HugeGraph-Client 只允许连接服务端已存在的图,无法自定义图进行创建。同时,需注意 1.7.0 后,构建 HugeGraph-Client 必须指定 GraphSpace(如默认 "DEFAULT")。其创建方法如下: +目前 HugeGraph-Client 只允许连接服务端已存在的图,无法自定义图进行创建。1.7.0 版本后,client 支持 graphSpace 设置,默认为DEFAULT。其创建方法如下: ```java // HugeGraphServer 地址:"http://localhost:8080" // 图的名称:"hugegraph" -HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "DEFAULT", "hugegraph") +HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "hugegraph") .configTimeout(20) // 默认 20s 超时 .configUser("**", "**") // 默认未开启用户权限 .build(); diff --git a/content/en/docs/clients/hugegraph-client.md b/content/en/docs/clients/hugegraph-client.md index 169f26744..75a6a1389 100644 --- a/content/en/docs/clients/hugegraph-client.md +++ b/content/en/docs/clients/hugegraph-client.md @@ -12,7 +12,7 @@ The `gremlin(groovy)` written by the user in `HugeGraph-Studio` can refer to the HugeGraph-Client is the general entry for operating graph. Users must first create a HugeGraph-Client object and establish a connection (pseudo connection) with HugeGraph-Server before they can obtain the operation entry objects of schema, graph and gremlin. -Currently, HugeGraph-Client only allows connections to existing graphs on the server, and cannot create custom graphs. Meanwhile, it should be noted that starting from version 1.7.0, building the HugeGraph-Client must specify a GraphSpace (e.g., the default "DEFAULT"). Its creation method is as follows: +Currently, HugeGraph-Client only allows connections to existing graphs on the server, and cannot create custom graphs. After version 1.7.0, client has supported setting graphSpace, the default value for graphSpace is DEFAULT.Its creation method is as follows: ```java // HugeGraphServer address: "http://localhost:8080" From 952f68b10b36f13792b4a39fd8ddb0cb537edd7e Mon Sep 17 00:00:00 2001 From: sadwitdastreetz Date: Fri, 28 Nov 2025 22:21:58 +0800 Subject: [PATCH 11/11] checked --- content/cn/docs/clients/hugegraph-client.md | 1 + content/en/docs/clients/hugegraph-client.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/content/cn/docs/clients/hugegraph-client.md b/content/cn/docs/clients/hugegraph-client.md index d2ab74e8e..4b51ed729 100644 --- a/content/cn/docs/clients/hugegraph-client.md +++ b/content/cn/docs/clients/hugegraph-client.md @@ -19,6 +19,7 @@ HugeGraph-Client 是操作 graph 的总入口,用户必须先创建出 HugeGra // HugeGraphServer 地址:"http://localhost:8080" // 图的名称:"hugegraph" HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "hugegraph") + //.builder("http://localhost:8080", "graphSpaceName", "hugegraph") .configTimeout(20) // 默认 20s 超时 .configUser("**", "**") // 默认未开启用户权限 .build(); diff --git a/content/en/docs/clients/hugegraph-client.md b/content/en/docs/clients/hugegraph-client.md index 75a6a1389..746418b69 100644 --- a/content/en/docs/clients/hugegraph-client.md +++ b/content/en/docs/clients/hugegraph-client.md @@ -12,12 +12,13 @@ The `gremlin(groovy)` written by the user in `HugeGraph-Studio` can refer to the HugeGraph-Client is the general entry for operating graph. Users must first create a HugeGraph-Client object and establish a connection (pseudo connection) with HugeGraph-Server before they can obtain the operation entry objects of schema, graph and gremlin. -Currently, HugeGraph-Client only allows connections to existing graphs on the server, and cannot create custom graphs. After version 1.7.0, client has supported setting graphSpace, the default value for graphSpace is DEFAULT.Its creation method is as follows: +Currently, HugeGraph-Client only allows connections to existing graphs on the server, and cannot create custom graphs. After version 1.7.0, client has supported setting graphSpace, the default value for graphSpace is DEFAULT. Its creation method is as follows: ```java // HugeGraphServer address: "http://localhost:8080" // Graph Name: "hugegraph" HugeClient hugeClient = HugeClient.builder("http://localhost:8080", "hugegraph") + //.builder("http://localhost:8080", "graphSpaceName", "hugegraph") .configTimeout(20) // 20s timeout .configUser("**", "**") // enable auth .build();