docs: Add Algorithm Job REST API documentation#458
Conversation
Add Algorithm API documentation to the RESTful API guide. - Document algorithm job submission endpoint - Explain async task monitoring via Task API - Show how to retrieve and access algorithm results - List all supported algorithms (pagerank, lpa, wcc, etc.) - Include performance guidance for large graphs - Provide parallel English and Chinese documentation - Update navigation (SUMMARY.md) for both languages Resolves apache#205
81a3b82 to
d49bf32
Compare
There was a problem hiding this comment.
Pull request overview
Adds bilingual RESTful API documentation for submitting and tracking asynchronous OLAP algorithm jobs, and updates navigation so users can discover the new page.
Changes:
- Added new
Algorithm APIdocumentation pages (EN + CN) describing job submission, Task API monitoring, and result property mappings. - Updated EN/CN
SUMMARY.mdto include the new Algorithm documentation entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| content/en/docs/clients/restful-api/algorithm.md | New English page documenting the Algorithm Job REST API, including submission/monitoring/results. |
| content/en/docs/SUMMARY.md | Adds Algorithm to the RESTful API navigation. |
| content/cn/docs/clients/restful-api/algorithm.md | New Chinese translation of the Algorithm Job REST API documentation. |
| content/cn/docs/SUMMARY.md | Adds Algorithm entry to the Chinese RESTful API navigation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | Algorithm | Result Property | | ||
| |-----------|-----------------| | ||
| | pagerank | `page_rank` | | ||
| | lpa | `community` | | ||
| | wcc | `component` | | ||
| | degree_centrality | `degree` | | ||
| | closeness_centrality | `closeness` | | ||
| | betweenness_centrality | `betweenness` | | ||
| | triangle_count | `triangles` | |
There was a problem hiding this comment.
The result property table is malformed because each row starts with || instead of |, which breaks Markdown table rendering. Please change it to standard table syntax with single leading/trailing pipes.
| weight: 11 | ||
| description: "算法任务 REST API:提交和监控异步图算法任务。" | ||
| --- | ||
|
|
||
| ### 6.1 算法 | ||
|
|
||
| 算法 API 允许提交长时间运行的图算法作为异步任务并跟踪其进度。 | ||
|
|
||
| #### 6.1.1 提交算法任务 |
There was a problem hiding this comment.
Same as EN: weight: 11 duplicates content/cn/docs/clients/restful-api/variable.md (also weight 11), and the section numbering starts at 6.1 even though Graphs API already uses ### 6.1 (content/cn/docs/clients/restful-api/graphs.md:8). Please adjust weight and numbering to avoid collisions.
| weight: 11 | |
| description: "算法任务 REST API:提交和监控异步图算法任务。" | |
| --- | |
| ### 6.1 算法 | |
| 算法 API 允许提交长时间运行的图算法作为异步任务并跟踪其进度。 | |
| #### 6.1.1 提交算法任务 | |
| weight: 12 | |
| description: "算法任务 REST API:提交和监控异步图算法任务。" | |
| --- | |
| ### 6.2 算法 | |
| 算法 API 允许提交长时间运行的图算法作为异步任务并跟踪其进度。 | |
| #### 6.2.1 提交算法任务 |
| 响应仅包含任务 ID。使用 [任务 API](/docs/clients/restful-api/task) 监控任务。 | ||
|
|
||
| #### 6.1.2 监控算法任务 | ||
|
|
||
| 使用 [任务 API](/docs/clients/restful-api/task) 检查算法任务的状态: |
There was a problem hiding this comment.
In CN docs this link points to the non-localized /docs/... path. Please use /cn/docs/clients/restful-api/task (or a relative link like ./task) so Chinese pages don’t redirect to the English site.
| 响应仅包含任务 ID。使用 [任务 API](/docs/clients/restful-api/task) 监控任务。 | |
| #### 6.1.2 监控算法任务 | |
| 使用 [任务 API](/docs/clients/restful-api/task) 检查算法任务的状态: | |
| 响应仅包含任务 ID。使用 [任务 API](./task) 监控任务。 | |
| #### 6.1.2 监控算法任务 | |
| 使用 [任务 API](./task) 检查算法任务的状态: |
| 任务完成后(task_status = "success"),算法结果作为顶点属性存储。查询顶点以访问结果: | ||
|
|
||
| ``` | ||
| GET http://localhost:8080/graphspaces/DEFAULT/graphs/{graph}/graph/vertices?filter=properties.{property_name} |
There was a problem hiding this comment.
The vertices query example uses filter=properties.{property_name}, but the Vertices API uses the properties={...} query parameter (see vertex.md “Get Vertices that Meet the Criteria”). This example should be updated to a valid format.
| GET http://localhost:8080/graphspaces/DEFAULT/graphs/{graph}/graph/vertices?filter=properties.{property_name} | |
| GET http://localhost:8080/graphspaces/DEFAULT/graphs/{graph}/graph/vertices?properties={"{property_name}":"{property_value}"} |
|
|
||
| #### 6.1.5 性能考虑 | ||
|
|
||
| 对于非常大的图(数百万+个顶点/边),考虑使用 [HugeGraph-Computer](/docs/quickstart/computing/hugegraph-computer) 或 [HugeGraph-Vermeer](/docs/quickstart/computing/hugegraph-vermeer) 进行分布式计算,而不是 REST API。 |
There was a problem hiding this comment.
In CN docs these links point to the non-localized /docs/... path. Please use /cn/docs/quickstart/computing/hugegraph-computer and /cn/docs/quickstart/computing/hugegraph-vermeer so navigation stays within the Chinese docs.
| 对于非常大的图(数百万+个顶点/边),考虑使用 [HugeGraph-Computer](/docs/quickstart/computing/hugegraph-computer) 或 [HugeGraph-Vermeer](/docs/quickstart/computing/hugegraph-vermeer) 进行分布式计算,而不是 REST API。 | |
| 对于非常大的图(数百万+个顶点/边),考虑使用 [HugeGraph-Computer](/cn/docs/quickstart/computing/hugegraph-computer) 或 [HugeGraph-Vermeer](/cn/docs/quickstart/computing/hugegraph-vermeer) 进行分布式计算,而不是 REST API。 |
| * [Rank](clients/restful-api/rank) | ||
| * [Variable](clients/restful-api/variable) | ||
| * [Graphs](clients/restful-api/graphs) | ||
| * [算法](clients/restful-api/algorithm) |
There was a problem hiding this comment.
The CN SUMMARY navigation uses English labels for all RESTful API entries; adding 算法 here is inconsistent with the established pattern in this file. Consider naming it Algorithm (matching the surrounding entries) unless you intend to localize the entire SUMMARY list.
| * [算法](clients/restful-api/algorithm) | |
| * [Algorithm](clients/restful-api/algorithm) |
| --- | ||
| title: "Algorithm API" | ||
| linkTitle: "Algorithm" | ||
| weight: 11 | ||
| description: "Algorithm Job REST API: Submit and monitor asynchronous graph algorithm jobs." | ||
| --- | ||
|
|
||
| ### 6.1 Algorithm |
There was a problem hiding this comment.
weight: 11 duplicates content/en/docs/clients/restful-api/variable.md (also weight 11), which can cause unstable ordering in Hugo menus. Also the section numbering starts at 6.1, but Graphs API already uses ### 6.1 (content/en/docs/clients/restful-api/graphs.md:8), so this page should use a non-conflicting number (e.g., 6.2 and 6.2.x).
| Once the job completes (task_status = "success"), algorithm results are stored as vertex properties. Query vertices to access the results: | ||
|
|
||
| ``` | ||
| GET http://localhost:8080/graphspaces/DEFAULT/graphs/{graph}/graph/vertices?filter=properties.{property_name} | ||
| ``` |
There was a problem hiding this comment.
The vertices query example uses filter=properties.{property_name}, but the documented Vertices API supports properties={...} (see vertex.md “Get Vertices that Meet the Criteria”). This example should be updated to a valid query parameter format (or explicitly recommend Gremlin if presence-only filtering isn’t supported).
| | 算法 | 结果属性 | | ||
| |------|----------| | ||
| | pagerank | `page_rank` | | ||
| | lpa | `community` | | ||
| | wcc | `component` | | ||
| | degree_centrality | `degree` | | ||
| | closeness_centrality | `closeness` | | ||
| | betweenness_centrality | `betweenness` | | ||
| | triangle_count | `triangles` | |
There was a problem hiding this comment.
The result property table is malformed because rows start with || instead of |, which breaks Markdown rendering. Please switch to standard Markdown table syntax.
a55cf7a to
e46d841
Compare
|
This pull request follows the Docusaurus markdown structure used by the Apache HugeGraph Website. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add Algorithm API documentation to the RESTful API guide, resolving issue #205.
What's added
Implementation details
The documentation covers:
Both English and Chinese translations are included to maintain the repository's bilingual documentation standard.