Skip to content

docs: Add Algorithm Job REST API documentation#458

Open
morningstarxcdcode wants to merge 2 commits into
apache:masterfrom
morningstarxcdcode:feat/add-algorithm-job-api
Open

docs: Add Algorithm Job REST API documentation#458
morningstarxcdcode wants to merge 2 commits into
apache:masterfrom
morningstarxcdcode:feat/add-algorithm-job-api

Conversation

@morningstarxcdcode
Copy link
Copy Markdown

Add Algorithm API documentation to the RESTful API guide, resolving issue #205.

What's added

  • Algorithm job submission endpoint documentation
  • Task monitoring via Task API for tracking algorithm progress
  • Algorithm result retrieval and property mapping for different algorithms
  • List of all supported algorithms (pagerank, lpa, wcc, degree_centrality, closeness_centrality, betweenness_centrality, triangle_count)
  • Performance guidance for choosing between REST API and distributed computing frameworks
  • Navigation updates (SUMMARY.md) for both English and Chinese documentation

Implementation details

The documentation covers:

  • REST API endpoint for submitting algorithm jobs
  • Request body parameters common across algorithms
  • Response structure showing task_id for progress tracking
  • Integration with existing Task API for job monitoring
  • Result property mappings specific to each algorithm
  • Guidance on when to use distributed frameworks for large graphs

Both English and Chinese translations are included to maintain the repository's bilingual documentation standard.

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
@morningstarxcdcode morningstarxcdcode force-pushed the feat/add-algorithm-job-api branch from 81a3b82 to d49bf32 Compare April 30, 2026 19:36
@morningstarxcdcode morningstarxcdcode marked this pull request as ready for review April 30, 2026 19:41
Copilot AI review requested due to automatic review settings April 30, 2026 19:41
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 30, 2026
@dosubot dosubot Bot added the enhancement New feature or request label Apr 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 API documentation pages (EN + CN) describing job submission, Task API monitoring, and result property mappings.
  • Updated EN/CN SUMMARY.md to 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.

Comment on lines +77 to +85
| Algorithm | Result Property |
|-----------|-----------------|
| pagerank | `page_rank` |
| lpa | `community` |
| wcc | `component` |
| degree_centrality | `degree` |
| closeness_centrality | `closeness` |
| betweenness_centrality | `betweenness` |
| triangle_count | `triangles` |
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +12
weight: 11
description: "算法任务 REST API:提交和监控异步图算法任务。"
---

### 6.1 算法

算法 API 允许提交长时间运行的图算法作为异步任务并跟踪其进度。

#### 6.1.1 提交算法任务
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
weight: 11
description: "算法任务 REST API:提交和监控异步图算法任务。"
---
### 6.1 算法
算法 API 允许提交长时间运行的图算法作为异步任务并跟踪其进度。
#### 6.1.1 提交算法任务
weight: 12
description: "算法任务 REST API:提交和监控异步图算法任务。"
---
### 6.2 算法
算法 API 允许提交长时间运行的图算法作为异步任务并跟踪其进度。
#### 6.2.1 提交算法任务

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +61
响应仅包含任务 ID。使用 [任务 API](/docs/clients/restful-api/task) 监控任务。

#### 6.1.2 监控算法任务

使用 [任务 API](/docs/clients/restful-api/task) 检查算法任务的状态:
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
响应仅包含任务 ID。使用 [任务 API](/docs/clients/restful-api/task) 监控任务。
#### 6.1.2 监控算法任务
使用 [任务 API](/docs/clients/restful-api/task) 检查算法任务的状态:
响应仅包含任务 ID。使用 [任务 API](./task) 监控任务。
#### 6.1.2 监控算法任务
使用 [任务 API](./task) 检查算法任务的状态:

Copilot uses AI. Check for mistakes.
任务完成后(task_status = "success"),算法结果作为顶点属性存储。查询顶点以访问结果:

```
GET http://localhost:8080/graphspaces/DEFAULT/graphs/{graph}/graph/vertices?filter=properties.{property_name}
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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}"}

Copilot uses AI. Check for mistakes.

#### 6.1.5 性能考虑

对于非常大的图(数百万+个顶点/边),考虑使用 [HugeGraph-Computer](/docs/quickstart/computing/hugegraph-computer) 或 [HugeGraph-Vermeer](/docs/quickstart/computing/hugegraph-vermeer) 进行分布式计算,而不是 REST API。
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
对于非常大的图(数百万+个顶点/边),考虑使用 [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。

Copilot uses AI. Check for mistakes.
Comment thread content/cn/docs/SUMMARY.md Outdated
* [Rank](clients/restful-api/rank)
* [Variable](clients/restful-api/variable)
* [Graphs](clients/restful-api/graphs)
* [算法](clients/restful-api/algorithm)
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
* [算法](clients/restful-api/algorithm)
* [Algorithm](clients/restful-api/algorithm)

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +8
---
title: "Algorithm API"
linkTitle: "Algorithm"
weight: 11
description: "Algorithm Job REST API: Submit and monitor asynchronous graph algorithm jobs."
---

### 6.1 Algorithm
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +69 to +73
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}
```
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +77 to +85
| 算法 | 结果属性 |
|------|----------|
| pagerank | `page_rank` |
| lpa | `community` |
| wcc | `component` |
| degree_centrality | `degree` |
| closeness_centrality | `closeness` |
| betweenness_centrality | `betweenness` |
| triangle_count | `triangles` |
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result property table is malformed because rows start with || instead of |, which breaks Markdown rendering. Please switch to standard Markdown table syntax.

Copilot uses AI. Check for mistakes.
@morningstarxcdcode morningstarxcdcode force-pushed the feat/add-algorithm-job-api branch from a55cf7a to e46d841 Compare April 30, 2026 20:28
@morningstarxcdcode
Copy link
Copy Markdown
Author

This pull request follows the Docusaurus markdown structure used by the Apache HugeGraph Website.
@JackyYangPassion

Comment thread content/en/docs/clients/restful-api/algorithm.md
Comment thread content/en/docs/clients/restful-api/algorithm.md
Comment thread content/en/docs/clients/restful-api/algorithm.md
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread content/en/docs/clients/restful-api/algorithm.md
Comment thread content/en/docs/clients/restful-api/algorithm.md
Comment thread content/en/docs/clients/restful-api/algorithm.md
Comment thread content/cn/docs/clients/restful-api/algorithm.md
Comment thread content/cn/docs/clients/restful-api/algorithm.md
Comment thread content/cn/docs/clients/restful-api/algorithm.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants