Copilot commented on code in PR #499:
URL: https://github.com/apache/hugegraph-doc/pull/499#discussion_r4109480309


##########
content/cn/docs/language/hugegraph-cypher.md:
##########
@@ -0,0 +1,137 @@
+---
+title: "HugeGraph Cypher"
+linkTitle: "Cypher 查询语言"
+weight: 2
+---
+
+### 概述
+
+HugeGraph 支持 [Cypher](https://opencypher.org/) —— 最初由 Neo4j 创建、并由 
[openCypher](https://github.com/opencypher/openCypher) 标准化的声明式图查询语言。Gremlin 
是命令式的遍历语言,而 Cypher 只需描述想要的图模式(`MATCH`、`WHERE`、`RETURN`),由引擎决定如何执行。
+
+HugeGraph 通过 
[cypher-for-gremlin](https://github.com/opencypher/cypher-for-gremlin) 转译器将 
Cypher 语句翻译为 Gremlin,再在 TinkerPop 技术栈上执行。因此 HugeGraph 的 Cypher 能力覆盖转译器所实现的 
openCypher 9 语法面 —— 详见下文[已知限制](#已知限制)。
+
+### 何时用 Cypher、何时用 Gremlin
+
+| 适合用 Cypher | 适合用 Gremlin |
+|---|---|
+| 正在从 Neo4j 迁移,或已熟悉 Cypher | 需要 HugeGraph 的完整功能面 |
+| 需要声明式模式匹配(`MATCH (a)-[:KNOWS]->(b)`) | 需要精细的遍历控制、自定义步骤或 lambda |
+| 查询以读模式和投影为主 | 需要图算法、OLAP 或 Cypher 未暴露的功能 |
+
+凡是 Cypher 表达不了的,等价的 Gremlin 查询总是可用 —— 下文示例同时给出两种写法。
+
+### 调用 Cypher API
+
+Cypher 语句通过 HugeGraph Server 的 REST 端点提交:
+
+```http
+GET  /graphspaces/{graphspace}/graphs/{graph}/cypher?cypher={statement}
+POST /graphspaces/{graphspace}/graphs/{graph}/cypher
+```
+
+该端点始终要求 `Authorization` 头(`Basic` 或 `Bearer`),即使服务端未开启认证 —— 凭据会被转发给 Gremlin 
Server。完整的请求/响应格式见 [Cypher REST API 参考](/cn/docs/clients/restful-api/cypher/)。
+
+示例:
+
+```bash
+curl -H "Authorization: Bearer $TOKEN" \
+  
"http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/cypher?cypher=MATCH%20(n:person)%20RETURN%20n.name%20LIMIT%2010"
+```
+
+Java 客户端使用 `CypherManager`(见 
[hugegraph-client](/cn/docs/clients/hugegraph-client/)):
+
+```java
+ResultSet resultSet = hugeClient.cypher().execute("MATCH (n:person) RETURN 
n.name LIMIT 10");
+```
+
+### 基础示例
+
+以下示例假设图中存在 `person` 顶点(`name`、`age`、`city` 属性)和 `knows` 边。
+
+#### 查询 — MATCH / WHERE / RETURN
+
+```cypher
+// 所有名为 "marko" 的 person
+MATCH (n:person) WHERE n.name = 'marko' RETURN n
+
+// 投影 + 排序 + 限制条数
+MATCH (n:person)
+WHERE n.age > 30
+RETURN n.name AS name, n.age AS age
+ORDER BY age DESC
+LIMIT 10
+
+// 关系模式
+MATCH (a:person)-[:knows]->(b:person)
+WHERE a.name = 'marko'
+RETURN b.name AS friend
+```
+
+#### 创建 — CREATE
+
+```cypher
+// 创建顶点
+CREATE (n:person {name: 'josh', age: 32, city: 'beijing'})
+
+// 创建两个顶点及它们之间的边
+CREATE (a:person {name: 'peter'})-[:knows]->(b:person {name: 'lop'})
+```
+
+#### 更新 — SET / REMOVE
+
+```cypher
+MATCH (n:person) WHERE n.name = 'josh'
+SET n.age = 33
+REMOVE n.city
+```
+
+#### 删除 — DELETE / DETACH DELETE
+
+```cypher
+// 删除边
+MATCH (a:person)-[r:knows]->(b:person)
+WHERE a.name = 'peter' AND b.name = 'lop'
+DELETE r
+
+// 删除顶点及其所有边
+MATCH (n:person) WHERE n.name = 'josh'
+DETACH DELETE n
+```
+
+#### 聚合
+
+```cypher
+MATCH (n:person) RETURN count(n) AS total
+MATCH (n:person) RETURN n.city AS city, count(*) AS cnt ORDER BY cnt DESC
+```
+
+### 等价的 Gremlin 写法
+
+每条 Cypher 语句在内部都会被翻译为 Gremlin。当某个 Cypher 特性不受支持时,可直接编写遍历:
+
+| Cypher | 等价 Gremlin |
+|---|---|
+| `MATCH (n:person) WHERE n.name='marko' RETURN n` | 
`g.V().hasLabel('person').has('name','marko')` |
+| `MATCH (a)-[:knows]->(b) RETURN b` | `g.V().out('knows')` |
+| `CREATE (n:person {name:'x'})` | `g.addV('person').property('name','x')` |
+| `MATCH (n) DETACH DELETE n` | `g.V().drop()` |
+| `MATCH (n:person) RETURN count(n)` | `g.V().hasLabel('person').count()` |
+
+提示:`EXPLAIN MATCH (n:person) RETURN n` 会被接受,并在 `result.data[0].translation` 
中返回翻译后的 Gremlin —— 这是获得上表等价写法的最快方式。`PROFILE` 不受支持。

Review Comment:
   下方兼容性说明明确将 `EXPLAIN`/`PROFILE` 列为未验证,但此处却把 `EXPLAIN` 及 
`result.data[0].translation` 描述成已保证支持的响应契约。请将其限定为未经验证的转译器层预期,或在文档中作出该保证前补充对应测试。



##########
content/en/docs/language/hugegraph-cypher.md:
##########
@@ -0,0 +1,137 @@
+---
+title: "HugeGraph Cypher"
+linkTitle: "Cypher Query Language"
+weight: 2
+---
+
+### Overview
+
+HugeGraph supports [Cypher](https://opencypher.org/), the declarative graph 
query language originally created by Neo4j and standardized as 
[openCypher](https://github.com/opencypher/openCypher). While Gremlin is an 
imperative traversal language, Cypher lets you describe the graph pattern you 
want (`MATCH`, `WHERE`, `RETURN`) and lets the engine decide how to execute it.
+
+HugeGraph executes Cypher by translating the statement to Gremlin through the 
[cypher-for-gremlin](https://github.com/opencypher/cypher-for-gremlin) 
transpiler, then running the resulting traversal on the TinkerPop stack. This 
means Cypher support in HugeGraph covers the openCypher 9 surface that the 
transpiler implements — see [Known limitations](#known-limitations) below.
+
+### When to use Cypher vs Gremlin
+
+| Use Cypher when | Use Gremlin when |
+|---|---|
+| You are migrating from Neo4j or already know Cypher | You need the full 
HugeGraph feature surface |
+| You want declarative pattern matching (`MATCH (a)-[:KNOWS]->(b)`) | You need 
fine-grained traversal control, custom steps, or lambdas |
+| Your queries are read-mostly patterns and projections | You need graph 
algorithms, OLAP, or features Cypher does not expose |
+
+For anything Cypher cannot express, the equivalent Gremlin query always works 
— examples below show both.
+
+### Calling the Cypher API
+
+Cypher statements are submitted to the HugeGraph Server through the REST 
endpoint:
+
+```http
+GET  /graphspaces/{graphspace}/graphs/{graph}/cypher?cypher={statement}
+POST /graphspaces/{graphspace}/graphs/{graph}/cypher
+```
+
+The endpoint always requires an `Authorization` header (`Basic` or `Bearer`), 
even when server authentication is disabled — the credentials are forwarded to 
the Gremlin Server. See the [Cypher REST API 
reference](/docs/clients/restful-api/cypher/) for the full request/response 
format.
+
+Example:
+
+```bash
+curl -H "Authorization: Bearer $TOKEN" \
+  
"http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/cypher?cypher=MATCH%20(n:person)%20RETURN%20n.name%20LIMIT%2010"
+```
+
+From the Java client, use `CypherManager` (see 
[hugegraph-client](/docs/clients/hugegraph-client/)):
+
+```java
+ResultSet resultSet = hugeClient.cypher().execute("MATCH (n:person) RETURN 
n.name LIMIT 10");
+```
+
+### Basic examples
+
+The examples below assume a graph with `person` vertices (`name`, `age`, 
`city` properties) and `knows` edges.
+
+#### Read — MATCH / WHERE / RETURN
+
+```cypher
+// All persons named "marko"
+MATCH (n:person) WHERE n.name = 'marko' RETURN n
+
+// Projection with ordering and limit
+MATCH (n:person)
+WHERE n.age > 30
+RETURN n.name AS name, n.age AS age
+ORDER BY age DESC
+LIMIT 10
+
+// Relationship pattern
+MATCH (a:person)-[:knows]->(b:person)
+WHERE a.name = 'marko'
+RETURN b.name AS friend
+```
+
+#### Create — CREATE
+
+```cypher
+// Create a vertex
+CREATE (n:person {name: 'josh', age: 32, city: 'beijing'})
+
+// Create two vertices and an edge between them
+CREATE (a:person {name: 'peter'})-[:knows]->(b:person {name: 'lop'})
+```
+
+#### Update — SET / REMOVE
+
+```cypher
+MATCH (n:person) WHERE n.name = 'josh'
+SET n.age = 33
+REMOVE n.city
+```
+
+#### Delete — DELETE / DETACH DELETE
+
+```cypher
+// Delete an edge
+MATCH (a:person)-[r:knows]->(b:person)
+WHERE a.name = 'peter' AND b.name = 'lop'
+DELETE r
+
+// Delete a vertex and all its edges
+MATCH (n:person) WHERE n.name = 'josh'
+DETACH DELETE n
+```
+
+#### Aggregation
+
+```cypher
+MATCH (n:person) RETURN count(n) AS total
+MATCH (n:person) RETURN n.city AS city, count(*) AS cnt ORDER BY cnt DESC
+```
+
+### Gremlin equivalents
+
+Every Cypher statement is translated to Gremlin internally. When a Cypher 
feature is unsupported, write the traversal directly:
+
+| Cypher | Gremlin equivalent |
+|---|---|
+| `MATCH (n:person) WHERE n.name='marko' RETURN n` | 
`g.V().hasLabel('person').has('name','marko')` |
+| `MATCH (a)-[:knows]->(b) RETURN b` | `g.V().out('knows')` |
+| `CREATE (n:person {name:'x'})` | `g.addV('person').property('name','x')` |
+| `MATCH (n) DETACH DELETE n` | `g.V().drop()` |
+| `MATCH (n:person) RETURN count(n)` | `g.V().hasLabel('person').count()` |
+
+Tip: `EXPLAIN MATCH (n:person) RETURN n` is accepted and returns the 
translated Gremlin in `result.data[0].translation` — the fastest way to obtain 
the equivalent traversal for the table above. `PROFILE` is not supported.

Review Comment:
   The compatibility record below explicitly lists `EXPLAIN`/`PROFILE` as 
unverified, but this tip presents `EXPLAIN` and `result.data[0].translation` as 
a guaranteed supported response contract. Please qualify this as an unverified 
translator-level expectation or add the corresponding test before documenting 
it as accepted.



##########
content/cn/docs/language/migrate-from-neo4j.md:
##########
@@ -0,0 +1,55 @@
+---
+title: "从 Neo4j 迁移"
+linkTitle: "从 Neo4j 迁移"
+weight: 4
+---
+
+### 本页面向谁
+
+正在评估 HugeGraph 的 Neo4j 用户。HugeGraph 的 Cypher 覆盖面由
+[cypher-for-gremlin](https://github.com/opencypher/cypher-for-gremlin) 转译器决定,
+与 Neo4j 并非 1:1 等价 —— 已验证与未验证范围见
+[Cypher 兼容性说明](/cn/docs/language/cypher-compatibility/),
+用法见 [HugeGraph Cypher](/cn/docs/language/hugegraph-cypher/)。
+
+### 可以直接带过来的部分
+
+| Neo4j 概念 | HugeGraph 对应 |
+|---|---|
+| 属性图模型(节点/关系/属性) | 相同 —— 顶点标签 / 边标签 / 属性 |
+| 基础 Cypher:`MATCH`/`WHERE`/`RETURN`/`CREATE`/`SET`/`DELETE` | 直接可用(REST 
`/cypher` 端点或 Java 客户端 `CypherManager`) |
+| 简单聚合(`count`/`sum`/`min`/`max`/`avg`) | 直接可用 |
+| 依赖图遍历的查询需求 | Gremlin 遍历或 [traverser REST 
API](/cn/docs/clients/restful-api/traverser/)(k-out、最短路、personalrank 等) |
+
+### 需要改变习惯的部分
+
+| 在 Neo4j 里 | 在 HugeGraph 里 |
+|---|---|
+| `CREATE INDEX` / `CREATE CONSTRAINT` | 通过 [schema REST 
API](/cn/docs/clients/restful-api/schema/) 建索引/约束;Cypher 不承载 DDL |
+| 隐式 schema(属性随意添加) | **强 schema**:先定义 VertexLabel/EdgeLabel/PropertyKey,再写数据 |
+| 参数化查询 `$param` | 已发布版本仅发送原始语句 —— 缺失的绑定会被求值为 `null`(空结果),请在客户端校验取值;JSON 绑定参数随 
[PR #238](https://github.com/hugegraph/hugegraph/pull/238) 落地 |

Review Comment:
   `apache/hugegraph#238` 链接返回 404,因此迁移表把读者引向了不存在的实现参考。请改为有效的已测试提交,或删除该链接。



##########
content/cn/docs/language/cypher-compatibility.md:
##########
@@ -0,0 +1,76 @@
+---
+title: "Cypher 兼容性"
+linkTitle: "Cypher 兼容性"
+weight: 3
+---
+
+### 范围
+
+本页记录当前 Cypher 开发改动实际验证过的用例,不代表完整支持 openCypher 或 Neo4j,也不代表所有已发布
+版本的 HugeGraph 都具备相同行为。测试代码基于
+[`hugegraph/hugegraph@27a7c9b`](https://github.com/hugegraph/hugegraph/commit/27a7c9b42274d6d4f95eabed6d2051d393ae0eaf),
+使用 Java `17.0.20.1`、TinkerPop 
`3.8.1`、`org.opencypher.gremlin:translation:1.0.4` 和 RocksDB。
+
+接口路径为 `/graphspaces/{graphspace}/graphs/{graph}/cypher`。一般用法见
+[HugeGraph Cypher 指南](/cn/docs/language/hugegraph-cypher/)。
+
+### 请求形式与参数
+
+| 请求 | 已验证行为 | 测试方法 |
+|---|---|---|
+| `GET ?cypher=<URL 编码的语句>` | 保留原有查询参数形式 | `testGet` |
+| `POST application/json`,请求体为原始 Cypher 文本 | 保留旧的原始文本请求形式 | `testPost` |
+| `POST text/plain`,请求体为原始 Cypher 文本 | 支持纯文本请求 | `testPlainTextPost` |
+| `POST application/json`,请求体为 JSON 对象 | 查询语句与参数分开传入 | `testParameters` |
+
+```json
+{
+  "cypher": "MATCH (n:cypher_person) WHERE n.name = $name RETURN n.name",
+  "parameters": {"name": "marko"}
+}
+```
+
+JSON 对象中的 `cypher` 必须是非空字符串;`parameters` 若提供,必须是对象。省略 `parameters` 表示空参数表。
+语句引用了未提供的参数时会报执行错误;显式传入 `null` 是有效值。测试覆盖字符串、数字、布尔值、引号和换行,
+参数名 `id` 与 `label`,以及默认最多 16 个参数。参数值会作为绑定值传递,不会改写查询文本。
+
+同时检查 HTTP 状态和响应体的 `status.code`:执行错误可能仍返回 HTTP 200,但 `status.code` 为 400,结果数据为 
null。
+
+### 已验证行为
+
+API 测试夹具使用强类型 Schema,并为 `city` 建立 `SECONDARY` 索引、为 `age` 建立 `RANGE` 
索引。验收结论仅限于下列用例:
+
+| 范围 | 测试用例 | 测试方法 |
+|---|---|---|
+| 查询 | 标签扫描、相等和范围条件、布尔组合、有向一跳和两跳关系、空结果 | 
`testGet`、`testExactReadsAndPredicates`、`testRelationQuery` |
+| 结果 | 别名、标量和节点值、嵌套值、关系 ID、路径结构、null 与缺失属性 | 
`testReturnNodeIdAsPrimitiveValue`、`testReturnNodeDoesNotLeakInternalIdTypes`、`testReturnNestedIdDoesNotLeakInternalIdTypes`、`testReturnRelationIdDoesNotLeakInternalIdTypes`、`testReturnPathShape`、`testNullAndMissingProperty`
 |
+| 聚合和分页 | `DISTINCT`、`count`/`sum`/`min`/`max`/`avg`、`ORDER BY`、`SKIP`、`LIMIT` 
| `testDuplicatesDistinctAndPagination`、`testAggregates` |
+| 写入 | 创建顶点和边、修改属性、删除边和顶点;通过原生 REST 读取检查状态 | 
`testCreate`、`testCreateSetAndDeleteWithNativeReadback` |
+| 失败写入 | 拒绝双顶点 `CREATE` 后,连续 32 次查询和原生读取均未发现残留 | 
`testFailedWriteDoesNotLeakIntoLaterRequests` |
+| 错误与路由 | 非法语法和请求结构、参数键、Schema 值、认证及图路由 | 
`testInvalidRequests`、`testRejectInvalidQuery`、`testRejectInvalidBindingShapeAndKeys`、`testAuthenticationAndGraphRouting`、`testSpecifiedGraphRouting`
 |
+
+`CypherApiTest` 通过 20/20,`CypherClientTest` 通过 7/7,`CypherOpProcessorTest` 通过 
4/4,均无跳过。
+相关 Gremlin 测试通过 10 项,另有一项 `testClearAndInit` 因后端不共享而不适用;Login 测试通过 3/3。
+EditorConfig 格式检查和仓库根目录 clean compile 均通过。代码改动位于
+[PR #238](https://github.com/hugegraph/hugegraph/pull/238)。固定测试提交

Review Comment:
   `apache/hugegraph#238` 链接返回 
404,因此这份验证记录指向代码改动的主要链接已失效。请改为使用下方已经链接的有效测试提交,或提供真实的 PR。



##########
content/en/docs/language/cypher-compatibility.md:
##########
@@ -0,0 +1,82 @@
+---
+title: "Cypher Compatibility"
+linkTitle: "Cypher Compatibility"
+weight: 3
+---
+
+### Scope
+
+This page records the cases verified for the current Cypher development 
change. It does not claim full
+openCypher or Neo4j compatibility, or compatibility across every released 
HugeGraph version. The tested
+working tree is based on 
[`hugegraph/hugegraph@27a7c9b`](https://github.com/hugegraph/hugegraph/commit/27a7c9b42274d6d4f95eabed6d2051d393ae0eaf)
+and uses Java `17.0.20.1`, TinkerPop `3.8.1`, 
`org.opencypher.gremlin:translation:1.0.4`, and RocksDB.
+
+The endpoint is `/graphspaces/{graphspace}/graphs/{graph}/cypher`. General 
usage is covered in the
+[HugeGraph Cypher guide](/docs/language/hugegraph-cypher/).
+
+### Request forms and parameters
+
+| Request | Verified contract | Test method |
+|---|---|---|
+| `GET ?cypher=<URL-encoded statement>` | Existing query-string form | 
`testGet` |
+| `POST application/json` with raw Cypher text | Legacy raw-body form remains 
available | `testPost` |
+| `POST text/plain` with raw Cypher text | Plain-text form | 
`testPlainTextPost` |
+| `POST application/json` with a JSON object | Query and bindings are sent 
separately | `testParameters` |
+
+```json
+{
+  "cypher": "MATCH (n:cypher_person) WHERE n.name = $name RETURN n.name",
+  "parameters": {"name": "marko"}
+}
+```
+
+For the JSON-object form, `cypher` must be a nonblank string and `parameters`, 
if present, must be an object.
+Omitting `parameters` means an empty map. A referenced but missing binding is 
an execution error; an explicit
+null value is valid. Tests cover string, number, and boolean values, quotes 
and newlines, the binding names
+`id` and `label`, and the default limit of 16 parameters. Values remain 
bindings and do not alter query text.
+
+Check both the HTTP status and the response body's `status.code`: an execution 
failure can retain HTTP 200
+while returning `status.code` 400 and null result data.
+
+### Verified behavior
+
+The API fixture uses a strong schema, with a `SECONDARY` index on `city` and a 
`RANGE` index on `age`.
+Acceptance results are limited to these test cases:
+
+| Area | Tested cases | Test methods |
+|---|---|---|
+| Reads | Label scans; equality and range predicates; boolean combinations; 
directed one- and two-hop patterns; empty results | `testGet`, 
`testExactReadsAndPredicates`, `testRelationQuery` |
+| Results | Aliases, scalar and node values, nested values, relationship ids, 
path shape, null and missing properties | `testReturnNodeIdAsPrimitiveValue`, 
`testReturnNodeDoesNotLeakInternalIdTypes`, 
`testReturnNestedIdDoesNotLeakInternalIdTypes`, 
`testReturnRelationIdDoesNotLeakInternalIdTypes`, `testReturnPathShape`, 
`testNullAndMissingProperty` |
+| Aggregation and pagination | `DISTINCT`, `count`/`sum`/`min`/`max`/`avg`, 
`ORDER BY`, `SKIP`, and `LIMIT` | `testDuplicatesDistinctAndPagination`, 
`testAggregates` |
+| Writes | Vertex and edge `CREATE`, property `SET`, edge and vertex `DELETE`; 
state checked through native REST reads | `testCreate`, 
`testCreateSetAndDeleteWithNativeReadback` |
+| Failed write | A rejected two-vertex `CREATE` left no residue during 32 
subsequent query and native-read checks | 
`testFailedWriteDoesNotLeakIntoLaterRequests` |
+| Errors and routing | Invalid syntax and request shape, binding keys, schema 
values, authentication, and graph routing | `testInvalidRequests`, 
`testRejectInvalidQuery`, `testRejectInvalidBindingShapeAndKeys`, 
`testAuthenticationAndGraphRouting`, `testSpecifiedGraphRouting` |
+
+`CypherApiTest` passed 20/20, `CypherClientTest` 7/7, and 
`CypherOpProcessorTest` 4/4, with no skips.
+Related Gremlin tests passed 10 cases with one inapplicable `testClearAndInit` 
skip for a non-shared backend;
+Login tests passed 3/3. EditorConfig formatting and the repository-root clean 
compile passed.
+The code change is in [PR 
#238](https://github.com/hugegraph/hugegraph/pull/238). The compatibility

Review Comment:
   The `apache/hugegraph#238` URL returns 404, so this verification record's 
primary pointer to the code change is broken. Point to the valid tested commit 
already linked below (or provide the actual pull request) instead.



##########
content/cn/docs/language/hugegraph-cypher.md:
##########
@@ -0,0 +1,137 @@
+---
+title: "HugeGraph Cypher"
+linkTitle: "Cypher 查询语言"
+weight: 2
+---
+
+### 概述
+
+HugeGraph 支持 [Cypher](https://opencypher.org/) —— 最初由 Neo4j 创建、并由 
[openCypher](https://github.com/opencypher/openCypher) 标准化的声明式图查询语言。Gremlin 
是命令式的遍历语言,而 Cypher 只需描述想要的图模式(`MATCH`、`WHERE`、`RETURN`),由引擎决定如何执行。
+
+HugeGraph 通过 
[cypher-for-gremlin](https://github.com/opencypher/cypher-for-gremlin) 转译器将 
Cypher 语句翻译为 Gremlin,再在 TinkerPop 技术栈上执行。因此 HugeGraph 的 Cypher 能力覆盖转译器所实现的 
openCypher 9 语法面 —— 详见下文[已知限制](#已知限制)。
+
+### 何时用 Cypher、何时用 Gremlin
+
+| 适合用 Cypher | 适合用 Gremlin |
+|---|---|
+| 正在从 Neo4j 迁移,或已熟悉 Cypher | 需要 HugeGraph 的完整功能面 |
+| 需要声明式模式匹配(`MATCH (a)-[:KNOWS]->(b)`) | 需要精细的遍历控制、自定义步骤或 lambda |
+| 查询以读模式和投影为主 | 需要图算法、OLAP 或 Cypher 未暴露的功能 |
+
+凡是 Cypher 表达不了的,等价的 Gremlin 查询总是可用 —— 下文示例同时给出两种写法。
+
+### 调用 Cypher API
+
+Cypher 语句通过 HugeGraph Server 的 REST 端点提交:
+
+```http
+GET  /graphspaces/{graphspace}/graphs/{graph}/cypher?cypher={statement}
+POST /graphspaces/{graphspace}/graphs/{graph}/cypher
+```
+
+该端点始终要求 `Authorization` 头(`Basic` 或 `Bearer`),即使服务端未开启认证 —— 凭据会被转发给 Gremlin 
Server。完整的请求/响应格式见 [Cypher REST API 参考](/cn/docs/clients/restful-api/cypher/)。
+
+示例:
+
+```bash
+curl -H "Authorization: Bearer $TOKEN" \
+  
"http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/cypher?cypher=MATCH%20(n:person)%20RETURN%20n.name%20LIMIT%2010"
+```
+
+Java 客户端使用 `CypherManager`(见 
[hugegraph-client](/cn/docs/clients/hugegraph-client/)):
+
+```java
+ResultSet resultSet = hugeClient.cypher().execute("MATCH (n:person) RETURN 
n.name LIMIT 10");
+```
+
+### 基础示例
+
+以下示例假设图中存在 `person` 顶点(`name`、`age`、`city` 属性)和 `knows` 边。
+
+#### 查询 — MATCH / WHERE / RETURN
+
+```cypher
+// 所有名为 "marko" 的 person
+MATCH (n:person) WHERE n.name = 'marko' RETURN n
+
+// 投影 + 排序 + 限制条数
+MATCH (n:person)
+WHERE n.age > 30
+RETURN n.name AS name, n.age AS age
+ORDER BY age DESC
+LIMIT 10
+
+// 关系模式
+MATCH (a:person)-[:knows]->(b:person)
+WHERE a.name = 'marko'
+RETURN b.name AS friend
+```
+
+#### 创建 — CREATE
+
+```cypher
+// 创建顶点
+CREATE (n:person {name: 'josh', age: 32, city: 'beijing'})
+
+// 创建两个顶点及它们之间的边
+CREATE (a:person {name: 'peter'})-[:knows]->(b:person {name: 'lop'})
+```
+
+#### 更新 — SET / REMOVE
+
+```cypher
+MATCH (n:person) WHERE n.name = 'josh'
+SET n.age = 33
+REMOVE n.city
+```
+
+#### 删除 — DELETE / DETACH DELETE
+
+```cypher
+// 删除边
+MATCH (a:person)-[r:knows]->(b:person)
+WHERE a.name = 'peter' AND b.name = 'lop'
+DELETE r
+
+// 删除顶点及其所有边
+MATCH (n:person) WHERE n.name = 'josh'
+DETACH DELETE n
+```
+
+#### 聚合
+
+```cypher
+MATCH (n:person) RETURN count(n) AS total
+MATCH (n:person) RETURN n.city AS city, count(*) AS cnt ORDER BY cnt DESC
+```
+
+### 等价的 Gremlin 写法
+
+每条 Cypher 语句在内部都会被翻译为 Gremlin。当某个 Cypher 特性不受支持时,可直接编写遍历:
+
+| Cypher | 等价 Gremlin |
+|---|---|
+| `MATCH (n:person) WHERE n.name='marko' RETURN n` | 
`g.V().hasLabel('person').has('name','marko')` |
+| `MATCH (a)-[:knows]->(b) RETURN b` | `g.V().out('knows')` |
+| `CREATE (n:person {name:'x'})` | `g.addV('person').property('name','x')` |
+| `MATCH (n) DETACH DELETE n` | `g.V().drop()` |
+| `MATCH (n:person) RETURN count(n)` | `g.V().hasLabel('person').count()` |
+
+提示:`EXPLAIN MATCH (n:person) RETURN n` 会被接受,并在 `result.data[0].translation` 
中返回翻译后的 Gremlin —— 这是获得上表等价写法的最快方式。`PROFILE` 不受支持。
+
+### 已知限制
+
+HugeGraph 的 Cypher 能力受转译层约束,该层基于 openCypher 9 时代的工具链。已知缺口:
+
+- **已发布版本不支持参数化查询** —— API 只接受原始语句字符串。使用 `$param` 的语句不会报错:缺失的绑定会被求值为 
`null`,查询返回空结果(或写入 null 值)。请在客户端先对值做转义/净化再拼接到语句中。JSON 绑定参数(`{"cypher": ..., 
"parameters": {...}}`)将随 [PR 
#238](https://github.com/hugegraph/hugegraph/pull/238) 落地。

Review Comment:
   `apache/hugegraph#238` 链接返回 404,读者无法访问这里所引用的 JSON 
绑定参数改动。请改为链接到有效的已测试提交(或删除链接),确保版本说明可核查。



##########
content/en/docs/language/hugegraph-cypher.md:
##########
@@ -0,0 +1,137 @@
+---
+title: "HugeGraph Cypher"
+linkTitle: "Cypher Query Language"
+weight: 2
+---
+
+### Overview
+
+HugeGraph supports [Cypher](https://opencypher.org/), the declarative graph 
query language originally created by Neo4j and standardized as 
[openCypher](https://github.com/opencypher/openCypher). While Gremlin is an 
imperative traversal language, Cypher lets you describe the graph pattern you 
want (`MATCH`, `WHERE`, `RETURN`) and lets the engine decide how to execute it.
+
+HugeGraph executes Cypher by translating the statement to Gremlin through the 
[cypher-for-gremlin](https://github.com/opencypher/cypher-for-gremlin) 
transpiler, then running the resulting traversal on the TinkerPop stack. This 
means Cypher support in HugeGraph covers the openCypher 9 surface that the 
transpiler implements — see [Known limitations](#known-limitations) below.
+
+### When to use Cypher vs Gremlin
+
+| Use Cypher when | Use Gremlin when |
+|---|---|
+| You are migrating from Neo4j or already know Cypher | You need the full 
HugeGraph feature surface |
+| You want declarative pattern matching (`MATCH (a)-[:KNOWS]->(b)`) | You need 
fine-grained traversal control, custom steps, or lambdas |
+| Your queries are read-mostly patterns and projections | You need graph 
algorithms, OLAP, or features Cypher does not expose |
+
+For anything Cypher cannot express, the equivalent Gremlin query always works 
— examples below show both.
+
+### Calling the Cypher API
+
+Cypher statements are submitted to the HugeGraph Server through the REST 
endpoint:
+
+```http
+GET  /graphspaces/{graphspace}/graphs/{graph}/cypher?cypher={statement}
+POST /graphspaces/{graphspace}/graphs/{graph}/cypher
+```
+
+The endpoint always requires an `Authorization` header (`Basic` or `Bearer`), 
even when server authentication is disabled — the credentials are forwarded to 
the Gremlin Server. See the [Cypher REST API 
reference](/docs/clients/restful-api/cypher/) for the full request/response 
format.
+
+Example:
+
+```bash
+curl -H "Authorization: Bearer $TOKEN" \
+  
"http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/cypher?cypher=MATCH%20(n:person)%20RETURN%20n.name%20LIMIT%2010"
+```
+
+From the Java client, use `CypherManager` (see 
[hugegraph-client](/docs/clients/hugegraph-client/)):
+
+```java
+ResultSet resultSet = hugeClient.cypher().execute("MATCH (n:person) RETURN 
n.name LIMIT 10");
+```
+
+### Basic examples
+
+The examples below assume a graph with `person` vertices (`name`, `age`, 
`city` properties) and `knows` edges.
+
+#### Read — MATCH / WHERE / RETURN
+
+```cypher
+// All persons named "marko"
+MATCH (n:person) WHERE n.name = 'marko' RETURN n
+
+// Projection with ordering and limit
+MATCH (n:person)
+WHERE n.age > 30
+RETURN n.name AS name, n.age AS age
+ORDER BY age DESC
+LIMIT 10
+
+// Relationship pattern
+MATCH (a:person)-[:knows]->(b:person)
+WHERE a.name = 'marko'
+RETURN b.name AS friend
+```
+
+#### Create — CREATE
+
+```cypher
+// Create a vertex
+CREATE (n:person {name: 'josh', age: 32, city: 'beijing'})
+
+// Create two vertices and an edge between them
+CREATE (a:person {name: 'peter'})-[:knows]->(b:person {name: 'lop'})
+```
+
+#### Update — SET / REMOVE
+
+```cypher
+MATCH (n:person) WHERE n.name = 'josh'
+SET n.age = 33
+REMOVE n.city
+```
+
+#### Delete — DELETE / DETACH DELETE
+
+```cypher
+// Delete an edge
+MATCH (a:person)-[r:knows]->(b:person)
+WHERE a.name = 'peter' AND b.name = 'lop'
+DELETE r
+
+// Delete a vertex and all its edges
+MATCH (n:person) WHERE n.name = 'josh'
+DETACH DELETE n
+```
+
+#### Aggregation
+
+```cypher
+MATCH (n:person) RETURN count(n) AS total
+MATCH (n:person) RETURN n.city AS city, count(*) AS cnt ORDER BY cnt DESC
+```
+
+### Gremlin equivalents
+
+Every Cypher statement is translated to Gremlin internally. When a Cypher 
feature is unsupported, write the traversal directly:
+
+| Cypher | Gremlin equivalent |
+|---|---|
+| `MATCH (n:person) WHERE n.name='marko' RETURN n` | 
`g.V().hasLabel('person').has('name','marko')` |
+| `MATCH (a)-[:knows]->(b) RETURN b` | `g.V().out('knows')` |
+| `CREATE (n:person {name:'x'})` | `g.addV('person').property('name','x')` |
+| `MATCH (n) DETACH DELETE n` | `g.V().drop()` |
+| `MATCH (n:person) RETURN count(n)` | `g.V().hasLabel('person').count()` |
+
+Tip: `EXPLAIN MATCH (n:person) RETURN n` is accepted and returns the 
translated Gremlin in `result.data[0].translation` — the fastest way to obtain 
the equivalent traversal for the table above. `PROFILE` is not supported.
+
+### Known limitations
+
+Cypher support in HugeGraph is bounded by the transpiler layer, which is based 
on openCypher 9 era tooling. Known gaps:
+
+- **No parameterized queries in released versions** — the API accepts a raw 
statement string only. A statement using `$param` still runs: a missing binding 
evaluates to `null`, so the query returns no rows (or writes null values) 
rather than failing. Sanitize/escape values on the client side before 
interpolating them into the statement. JSON-bound parameters (`{"cypher": ..., 
"parameters": {...}}`) are on the way in [PR 
#238](https://github.com/hugegraph/hugegraph/pull/238).

Review Comment:
   The `apache/hugegraph#238` URL returns 404, so readers cannot reach the 
change being referenced for JSON-bound parameters. Link the valid tested commit 
instead (or remove the link) so this release/version caveat remains verifiable.



##########
content/en/docs/language/migrate-from-neo4j.md:
##########
@@ -0,0 +1,62 @@
+---
+title: "Migrating from Neo4j"
+linkTitle: "Migrating from Neo4j"
+weight: 4
+---
+
+### Who this page is for
+
+Neo4j users evaluating HugeGraph. HugeGraph's Cypher coverage is defined by
+the [`cypher-for-gremlin`](https://github.com/opencypher/cypher-for-gremlin)
+translator and is not 1:1 with Neo4j — see the
+[Cypher compatibility notes](/docs/language/cypher-compatibility/) for the
+verified and unverified areas and
+[HugeGraph Cypher](/docs/language/hugegraph-cypher/) for usage.
+
+### What carries over directly
+
+| Neo4j concept | HugeGraph equivalent |
+|---|---|
+| Property graph model (nodes / relationships / properties) | Same — vertex 
labels / edge labels / properties |
+| Core Cypher: `MATCH`/`WHERE`/`RETURN`/`CREATE`/`SET`/`DELETE` | Works as-is 
(REST `/cypher` endpoint or Java client `CypherManager`) |
+| Simple aggregations (`count`/`sum`/`min`/`max`/`avg`) | Works as-is |
+| Traversal-heavy queries | Gremlin traversals or the [traverser REST 
APIs](/docs/clients/restful-api/traverser/) (k-out, shortest path, 
personalrank, ...) |
+
+### Habits you need to change
+
+| In Neo4j | In HugeGraph |
+|---|---|
+| `CREATE INDEX` / `CREATE CONSTRAINT` | Create indexes/constraints through 
the [schema REST APIs](/docs/clients/restful-api/schema/); Cypher carries no 
DDL |
+| Implicit schema (add properties freely) | **Strong schema**: define 
VertexLabel / EdgeLabel / PropertyKey before writing data |
+| Parameterized queries `$param` | Released versions send the raw statement 
only — a missing binding evaluates to `null` (empty result), so validate values 
client-side; JSON-bound parameters land in [PR 
#238](https://github.com/hugegraph/hugegraph/pull/238) |

Review Comment:
   The `apache/hugegraph#238` URL returns 404, so the migration table points 
readers to a nonexistent implementation reference. Replace it with the valid 
tested commit or remove the link.



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