Skip to content

Commit

Permalink
Merge branch 'master' into update-studio-2
Browse files Browse the repository at this point in the history
  • Loading branch information
foesa-yang committed Nov 1, 2021
2 parents 1ccb7eb + 6050b54 commit 95698c0
Show file tree
Hide file tree
Showing 146 changed files with 1,327 additions and 1,077 deletions.
2 changes: 1 addition & 1 deletion docs-2.0/1.introduction/1.what-is-nebula-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Nebula Graph支持严格的角色访问控制和LDAP(Lightweight Directory Acc

### 生态多样化

Nebula Graph开放了越来越多的原生工具,例如[Nebula Graph Studio](https://github.com/vesoft-inc/nebula-studio)[Nebula Console](https://github.com/vesoft-inc/nebula-console)[Nebula Exchange](https://github.com/vesoft-inc/nebula-spark-utils/tree/v2.0.0/nebula-exchange)等,更多工具可以查看 [生态工具概览](../20.appendix/6.eco-tool-version.md)
Nebula Graph开放了越来越多的原生工具,例如[Nebula Graph Studio](https://github.com/vesoft-inc/nebula-studio)[Nebula Console](https://github.com/vesoft-inc/nebula-console)[Nebula Exchange](https://github.com/vesoft-inc/nebula-exchange)等,更多工具可以查看 [生态工具概览](../20.appendix/6.eco-tool-version.md)

此外,Nebula Graph还具备与Spark、Flink、HBase等产品整合的能力,在这个充满挑战与机遇的时代,大大增强了自身的竞争力。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Graph 服务主要负责处理查询请求,包括解析查询语句、校验

Parser 模块收到请求后,通过 Flex(词法分析工具)和 Bison(语法分析工具)生成的词法语法解析器,将语句转换为抽象语法树(AST),在语法解析阶段会拦截不符合语法规则的语句。

例如`GO FROM "Tim" OVER like WHERE like.likeness > 8.0 YIELD like._dst`语句转换的 AST 如下。
例如`GO FROM "Tim" OVER like WHERE properties(edge).likeness > 8.0 YIELD dst(edge)`语句转换的 AST 如下。

![AST](https://docs-cdn.nebula-graph.com.cn/docs-2.0/1.introduction/2.nebula-graph-architecture/parser-ast-tree.png)

Expand All @@ -38,7 +38,7 @@ Validator 模块对生成的 AST 进行语义校验,主要包括:

校验引用的变量是否存在或者引用的属性是否属于变量。

例如语句`$var = GO FROM "Tim" OVER like YIELD like._dst AS ID; GO FROM $var.ID OVER serve YIELD serve._dst`,Validator 模块首先会检查变量 `var` 是否定义,其次再检查属性 `ID` 是否属于变量 `var`
例如语句`$var = GO FROM "Tim" OVER like YIELD dst(edge) AS ID; GO FROM $var.ID OVER serve YIELD dst(edge)`,Validator 模块首先会检查变量 `var` 是否定义,其次再检查属性 `ID` 是否属于变量 `var`

- 校验类型推断

Expand All @@ -50,13 +50,13 @@ Validator 模块对生成的 AST 进行语义校验,主要包括:

查询语句中包含 `*` 时,校验子句时需要将 `*` 涉及的Schema都进行校验。

例如语句`GO FROM "Tim" OVER * YIELD like._dst, like.likeness, serve._dst`,校验`OVER`子句时需要校验所有的 Edge type,如果 Edge type 包含 `like``serve`,该语句会展开为`GO FROM "Tim" OVER like,serve YIELD like._dst, like.likeness, serve._dst`
例如语句`GO FROM "Tim" OVER * YIELD dst(edge), properties(edge).likeness, dst(edge)`,校验`OVER`子句时需要校验所有的 Edge type,如果 Edge type 包含 `like``serve`,该语句会展开为`GO FROM "Tim" OVER like,serve YIELD dst(edge), properties(edge).likeness, dst(edge)`

- 校验输入输出

校验管道符(|)前后的一致性。

例如语句`GO FROM "Tim" OVER like YIELD like._dst AS ID | GO FROM $-.ID OVER serve YIELD serve._dst`,Validator 模块会校验 `$-.ID` 在管道符左侧是否已经定义。
例如语句`GO FROM "Tim" OVER like YIELD dst(edge) AS ID | GO FROM $-.ID OVER serve YIELD dst(edge)`,Validator 模块会校验 `$-.ID` 在管道符左侧是否已经定义。

校验完成后,Validator 模块还会生成一个默认可执行,但是未进行优化的执行计划,存储在目录 `src/planner` 内。

Expand Down
2 changes: 1 addition & 1 deletion docs-2.0/14.client/4.nebula-java-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ try {
ResultSet resp = session.execute(insertEdges);

// query
String query = "GO FROM \"Bob\" OVER like " + "YIELD $$.person.name, $$.person.age, like.likeness";
String query = "GO FROM \"Bob\" OVER like " + "YIELD properties($$).name, properties($$).age, properties(edge).likeness";
ResultSet resp = session.execute(query);
printResult(resp);
}finally {
Expand Down
Loading

0 comments on commit 95698c0

Please sign in to comment.