Skip to content

docs(rest): clarify traversal input rules - #581

Open
imbajin wants to merge 2 commits into
apache:masterfrom
hugegraph:codex/repair-outside-docs
Open

imbajin wants to merge 2 commits into
apache:masterfrom
hugegraph:codex/repair-outside-docs

Conversation

@imbajin

@imbajin imbajin commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Purpose

Update the Chinese and English REST references alongside the Server fixes for traversal input.

Changes

  • P.outside(a, b) selects values strictly below a or strictly above b. The previous predicate table incorrectly used “and”.
  • A Count request requires a nonempty steps array. Missing, null, and empty values return HTTP 400. For dedup_size, the references now explain the default and the valid special values, plus the error for an explicit null.

P.outside 的区间外筛选

Count 接口的参数错误提示

Companion Server changes

Verification

Compared both language versions with the Server behavior and ran the website link check.

- Give outside predicates strict lower and upper comparisons.
- Document Count requests with missing or empty steps.
- Keep the Chinese and English API references aligned.
- Document the Count deduplication default.
- Explain zero and unlimited deduplication.
- List the explicit null and invalid integer responses.

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Score: 7.0/10 · Confidence: high

Blocking: yes

Summary

The Count validation claims depend on an unmerged Server fix, and the deduplication description omits that final destinations may be counted repeatedly.

Evidence

Apache Server CountAPI passes boxed booleans to checkArgumentNotNull and uses a primitive dedupSize; CountTraverser counts the final layer with edgesCount without deduplicating targets. Companion hugegraph/hugegraph#384 remains open. The same issues apply to the Chinese text.

Validation notes

Source and GitHub CI inspection only; no live HTTP or graph test was run. Actual JSON null behavior depends on the deployed Jackson configuration.


- source: ID of the starting vertex, required.
- steps: Steps of the traversal, required. Each step accepts the following fields:
- steps: A nonempty array of traversal steps. An omitted value, `null`, or an empty array returns HTTP 400. Each step supports the following fields:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

⚠️ Coordinate these validation claims with Server

On current Apache Server, CountAPI passes a boolean to checkArgumentNotNull, then dereferences steps in steps(), so omitted or null steps are not reliably rejected as HTTP 400. The explicit null dedup_size claim below also depends on the proposed change from primitive long. The companion fix is still open in another repository. Please coordinate publication with the corresponding Apache Server fix or qualify the applicable version; update the Chinese text too. This is based on source inspection, not a live HTTP test.

- skip_degree: Threshold above which a super vertex is skipped in this step. Optional, default is 100000.
- contains_traversed: Whether to also count the vertices reached by the intermediate steps. Optional, default is false.
- dedup_size: Maximum number of vertices kept for deduplication, `-1` means no limit. Optional, default is 1000000.
- dedup_size: Maximum number of vertices kept for deduplication. The default is 1000000 when omitted. Use `0` to disable deduplication and `-1` to deduplicate without a limit. A `null` value or an integer below `-1` returns HTTP 400.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

⚠️ Clarify what is deduplicated

CountTraverser counts the final layer with edgesCount() without deduplicating destination vertices. For example, two intermediate vertices reaching the same final vertex can contribute twice even with dedup_size: -1. Please clarify that this controls traversal deduplication and does not guarantee a distinct final vertex count, including in the Chinese version.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant