Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Merge v3.1.0 into master" #1805

Merged
merged 1 commit into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
27 changes: 17 additions & 10 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -18,21 +18,30 @@ jobs:
python-version: '3.8'
architecture: 'x64'

- name : prepare
run: sh ./prepare.sh

- name: apt install
run: |
sudo apt update -y
sudo apt install -y $(cat pkglist.txt)
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r ./requirements.txt
- name: set LANG
run: sh lang-zh.sh

- name: Git Config
run: git config user.name whitewum && git config user.email [email protected]

- name: mike
- name: mike list delete
run: |
mike list
- name: Mike Deploy master
run: |
mike deploy master -p --rebase
mike list

- name: show git branch
run: |
git branch
git checkout .
git checkout gh-pages
- name: Compress
run: |
Expand All @@ -48,6 +57,7 @@ jobs:
port: ${{ secrets.PORT }}
source: nebula-docs.tar.gz
target: /usr/web

- name: UnCompress
uses: appleboy/ssh-action@master
with:
Expand All @@ -58,9 +68,6 @@ jobs:
script: |
mkdir -p /usr/web/nebula-docs/
tar -xzf /usr/web/nebula-docs.tar.gz -C /usr/web/nebula-docs/
mkdir -p /usr/web/nebula-docs/site/pdf/
cp -f /usr/web/nebula-docs/3.1.0/pdf/NebulaGraph-CN.pdf /usr/web/nebula-docs/site/pdf/NebulaGraph-book.pdf

# pip3 install --upgrade pip
# pip3 install -r /usr/web/nebula-docs/requirement.txt
# - name: Deploy
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Publish docs via GitHub Pages](https://github.com/vesoft-inc/nebula-docs-cn/actions/workflows/deploy.yaml/badge.svg?branch=v3.0.1)](https://github.com/vesoft-inc/nebula-docs-cn/actions/workflows/deploy.yaml)

# Nebula Graph 文档

- [中文](https://docs.nebula-graph.com.cn/)
Expand Down
2 changes: 1 addition & 1 deletion docs-2.0/1.introduction/0-2.relates.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ NoSQL 数据库的列式存储与 NoSQL 数据库的键值存储有许多相似
对于一个大规模的图数据来说,是很难存放在单个服务器的内存中的,即使仅仅存放图结构本身也不够。而且通过增加单服务器的能力,其成本价格通常成指数级别上升。
此外,随着数据量的增加,例如到达千亿级别的时候,已经超过了市面上所有商用服务器的容量能力。

与此对应的,另外一个经常使用的方案,是对数据进行分片,并将每个分片放置在不同的服务器上(并进行冗余备份),以此来增加可靠性和性能。对于一些 NoSQL 型的系统,例如 key-value 或者文档型的系统来说,这个分片方式是比较直观和自然的;通常可以根据 key 或者 docID,来将每个记录或者数据单元(key-value, doc)放在不同的服务器上。
于此对应的,另外一个经常使用的方案,是对数据进行分片,并将每个分片放置在不同的服务器上(并进行冗余备份),以此来增加可靠性和性能。对于一些 NoSQL 型的系统,例如 key-value 或者文档型的系统来说,这个分片方式是比较直观和自然的;通常可以根据 key 或者 docID,来将每个记录或者数据单元(key-value, doc)放在不同的服务器上。

但是图这种数据结构的分片通常不那么直观,这是因为通常图是“全联通”的,每个点通常只要6跳就可以联通到其他任何节点;
而理论上早已证明图的划分问题是 NP 的。
Expand Down
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 A

### 生态多样化

Nebula Graph 开放了越来越多的原生工具,例如 [Nebula 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 开放了越来越多的原生工具,例如 [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
18 changes: 9 additions & 9 deletions docs-2.0/1.introduction/2.data-model.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 数据模型

本文介绍 Nebula Graph 的数据模型。数据模型是一种组织数据并说明它们如何相互关联的模型。
本文介绍 Nebula Graph 的数据模型。数据模型是一种组织数据并说明它们如何相互关联的模型(schema)

## 数据模型

Expand All @@ -19,7 +19,7 @@ Nebula Graph 数据模型使用 6 种基本的数据模型:

!!! Compatibility

Nebula Graph 2.x 及以下版本中的点必须包含至少一个 Tag。
Nebula Graph 2.x 的点不能没有 Tag。Nebula Graph {{nebula.release}} 的点可以没有 Tag。

- 边(Edge)

Expand All @@ -29,13 +29,13 @@ Nebula Graph 数据模型使用 6 种基本的数据模型:
- 边是有方向的,不存在无向边。
- 四元组 `<起点 VID、Edge type、边排序值 (rank)、终点 VID>` 用于唯一标识一条边。边没有 EID。
- 一条边有且仅有一个 Edge type。
- 一条边有且仅有一个 Rank,类型为 int64,默认值为 0。
- 一条边有且仅有一个 rank,类型为 int64,默认值为 0。

!!! 关于 Rank
!!! 关于 rank

Rank 可以用来区分 Edge type、起始点、目的点都相同的边。该值完全由用户自己指定。
读取时必须自行取得全部的 Rank 值后排序过滤和拼接。
不支持诸如`next(), pre(), head(), tail(), max(), min(), lessThan(), moreThan()`等函数功能,也不能通过创建索引加速访问或者条件过滤。
rank 可以用来区分 Edge type、起始点、目的点都相同的边。该值完全由用户自己指定。
读取时必须自行取得全部的 rank 值后排序过滤和拼接。
不支持诸如 `next(), pre(), head(), tail(), max(), min(), lessThan(), moreThan()` 等函数功能,也不能通过创建索引加速访问或者条件过滤。

- 标签(Tag)

Expand All @@ -45,9 +45,9 @@ Nebula Graph 数据模型使用 6 种基本的数据模型:

Edge type 由一组事先预定义的属性构成。

- 属性(Property
- 属性(Properties

属性是指以键值对(Key-value pair)形式表示的信息
属性是指以键值对(Key-value pair)形式存储的信息

!!! Note

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ EdgeA_Out 和 EdgeA_In 以方向相反的两条边的形式存在于存储层,
如 EdgeA_Out 和 EdgeA_In 一样,Nebula Graph 冗余了存储每条边的信息,导致存储边所需的实际空间翻倍。因为边对应的 key 占用的硬盘空间较小,但 value 占用的空间与属性值的长度和数量成正比,所以,当边的属性值较大或数量较多时候,硬盘空间占用量会比较大。

如果对边进行操作,为了保证两个键值对的最终一致性,可以开启 [TOSS 功能](../../5.configurations-and-logs/1.configurations/3.graph-config.md),开启后,会先在正向边所在的分片进行操作,然后在反向边所在分片进行操作,最后返回结果。

-->
### 分片算法

分片策略采用**静态 Hash **的方式,即对点 VID 进行取模操作,同一个点的所有 Tag、出边和入边信息都会存储到同一个分片,这种方式极大地提升了查询效率。
Expand Down
21 changes: 7 additions & 14 deletions docs-2.0/14.client/3.nebula-cpp-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

[Nebula CPP](https://github.com/vesoft-inc/nebula-cpp/tree/{{cpp.branch}}) 是一款 C++ 语言的客户端,可以连接、管理 Nebula Graph 图数据库。

## 使用限制

请确保已安装 C++ 且 GCC 版本为 4.8 及以上。
## 前提条件

- 已安装 C++,GCC 版本为 4.8 及以上。

- 编译安装需要准备正确的编译环境,详情请参见[软硬件要求和安装三方库依赖包](../4.deployment-and-installation/1.resource-preparations.md)。

## 版本对照表

Expand All @@ -17,18 +19,9 @@

## 安装 Nebula CPP

本文介绍通过编译方式安装 Nebula CPP。

### 前提条件

- 准备正确的编译环境,详情请参见[软硬件要求和安装三方库依赖包](../4.deployment-and-installation/1.resource-preparations.md)。
- 确保已安装 C++ 且 GCC 版本为:{10.1.0 | 9.3.0 | 9.2.0 | 9.1.0 | 8.3.0 | 7.5.0 | 7.1.0}。详情请参见 [gcc_preset_versions 参数](https://github.com/vesoft-inc/nebula-cpp/blob/{{cpp.tag}}/third-party/install-third-party.sh)。

### 安装步骤

1. 克隆 Nebula CPP 源码到机器。

- (推荐)如果需要安装指定版本的 Nebula CPP,请使用选项`--branch`指定分支。例如安装 {{ cpp.tag }}发布版本,请执行如下命令:
- (推荐)如果需要安装指定版本的 Nebula CPP,请使用选项`--branch`指定分支。例如安装 v{{ cpp.release }}发布版本,请执行如下命令:

```bash
$ git clone --branch {{cpp.branch}} https://github.com/vesoft-inc/nebula-cpp.git
Expand Down Expand Up @@ -108,7 +101,7 @@
$ LIBRARY_PATH=/usr/local/nebula/lib64:$LIBRARY_PATH g++ -std=c++11 SessionExample.cpp -I/usr/local/nebula/include -lnebula_graph_client -o session_example
```

## 核心代码
### 核心代码

详细示例请参见 [SessionExample](https://github.com/vesoft-inc/nebula-cpp/blob/{{cpp.branch}}/examples/SessionExample.cpp)。

2 changes: 1 addition & 1 deletion docs-2.0/2.quick-start/1.quick-start-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<!--
### 入门系列

* [Nebula Studio 图探索](https://www.bilibili.com/video/BV1QN411Z7Vh)(03 分 23 秒)
* [Nebula Graph Studio 图探索](https://www.bilibili.com/video/BV1QN411Z7Vh)(03 分 23 秒)

<iframe src="//player.bilibili.com/player.html?aid=503286771&bvid=BV1QN411Z7Vh&cid=344349765&page=1&high_quality=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" width="720px" height="480px"> </iframe>

Expand Down
4 changes: 0 additions & 4 deletions docs-2.0/2.quick-start/3.1add-storage-hosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
nebula> ADD HOSTS 192.168.10.100:9779, 192.168.10.101:9779, 192.168.10.102:9779;
```

!!! caution

请确保添加的主机 IP 和配置文件`nebula-storaged.conf`中`local_ip`配置的 IP 一致,否则会导致添加 Storage 主机失败。关于配置文件的详情,参见[配置管理](../5.configurations-and-logs/1.configurations/1.configurations.md)。

2. 检查主机状态,确认全部在线。

```ngql
Expand Down
14 changes: 7 additions & 7 deletions docs-2.0/2.quick-start/6.cheatsheet-for-ngql-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
| double sqrt(double x) | 返回 x 的平方根。 |
| double cbrt(double x) | 返回 x 的立方根。 |
| double hypot(double x, double y) | 返回直角三角形(直角边长为 x 和 y)的斜边长。 |
| double pow(double x, double y) | 返回 x^y^ 的值。 |
| double exp(double x) | 返回 e^x^ 的值。 |
| double exp2(double x) | 返回 2^x^ 的值。 |
| double pow(double x, double y) | 返回$x^y$的值。 |
| double exp(double x) | 返回$e^x$的值。 |
| double exp2(double x) | 返回$2^x$的值。 |
| double log(double x) | 返回以自然数 e 为底 x 的对数。 |
| double log2(double x) | 返回以 2 为底 x 的对数。 |
| double log10(double x) | 返回以 10 为底 x 的对数。 |
Expand Down Expand Up @@ -233,8 +233,8 @@
| 匹配多点 ID | `MATCH (v:player { name: 'Tim Duncan' })--(v2) WHERE id(v2) IN ["player101", "player102"] RETURN v2` | 要匹配多个点的 ID,可以用`WHERE id(v) IN [vid_list]`。 |
| 匹配连接的点 | `MATCH (v:player{name:"Tim Duncan"})--(v2) RETURN v2.player.name AS Name` | 用户可以使用`--`符号表示两个方向的边,并匹配这些边连接的点。用户可以在`--`符号上增加`<`或`>`符号指定边的方向。 |
| 匹配路径 | `MATCH p=(v:player{name:"Tim Duncan"})-->(v2) RETURN p` | 连接起来的点和边构成了路径。用户可以使用自定义变量命名路径。 |
| 匹配边 | `MATCH (v:player{name:"Tim Duncan"})-[e]-(v2) RETURN e`<br>`MATCH ()<-[e]-() RETURN e LIMIT 3` | 除了用`--`、`-->`、`<--`表示未命名的边之外,用户还可以在方括号中使用自定义变量命名边。例如`-[e]-`。 |
| 匹配 Edge type | `MATCH ()-[e:follow]->() RETURN e LIMIT 5` | 和点一样,用户可以用`:<edge_type>`表示模式中的 Edge type,例如`-[e:follow]-`。 |
| 匹配边 | `MATCH (v:player{name:"Tim Duncan"})-[e]-(v2) RETURN e` | 除了用`--`、`-->`、`<--`表示未命名的边之外,用户还可以在方括号中使用自定义变量命名边。例如`-[e]-`。 |
| 匹配 Edge type | `MATCH ()-[e:follow]-() RETURN e` | 和点一样,用户可以用`:<edge_type>`表示模式中的 Edge type,例如`-[e:follow]-`。 |
| 匹配边的属性 | ` MATCH (v:player{name:"Tim Duncan"})-[e:follow{degree:95}]->(v2) RETURN e` | 用户可以用`{<prop_name>: <prop_value>}`表示模式中 Edge type 的属性,例如`[e:follow{likeness:95}]`。 |
| 匹配多个 Edge type | `MATCH (v:player{name:"Tim Duncan"})-[e:follow | :serve]->(v2) RETURN e` | 使用`|`可以匹配多个 Edge type,例如`[e:follow | :serve]`。第一个 Edge type 前的英文冒号(:)不可省略,后续 Edge type 前的英文冒号可以省略,例如`[e:follow | serve]`。 |
| 匹配多条边 | `MATCH (v:player{name:"Tim Duncan"})-[]->(v2)<-[e:serve]-(v3) RETURN v2, v3` | 用户可以扩展模式,匹配路径中的多条边。 |
Expand All @@ -250,7 +250,7 @@
| 检索路径 | `MATCH p=(v:player{name:"Tim Duncan"})-[*3]->() RETURN p` | 使用`RETURN <path_name>`检索匹配路径的所有信息。 |
| 检索路径中的点 | `MATCH p=(v:player{name:"Tim Duncan"})-[]->(v2) RETURN nodes(p)` | 使用`nodes()`函数检索路径中的所有点。 |
| 检索路径中的边 | `MATCH p=(v:player{name:"Tim Duncan"})-[]->(v2) RETURN relationships(p)` | 使用`relationships()`函数检索路径中的所有边。 |
| 检索路径长度 | `MATCH p=(v:player{name:"Tim Duncan"})-[*..2]->(v2) RETURN p AS Paths, length(p) AS Length` | 使用`length()`函数检索路径的长度。 |
| 检索路径长度 | `MATCH p=(v:player{name:"Tim Duncan">})-[*..2]->(v2) RETURN p AS Paths, length(p) AS Length` | 使用`length()`函数检索路径的长度。 |

* [OPTIONAL MATCH](../3.ngql-guide/7.general-query-statements/optional-match.md)

Expand Down Expand Up @@ -365,7 +365,7 @@
| 子句 | 语法 | 示例 | 说明 |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [GROUP BY](../3.ngql-guide/8.clauses-and-options/group-by.md) | ` GROUP BY <var> YIELD <var>, <aggregation_function(var)>` | `GO FROM "player100" OVER follow BIDIRECT YIELD $$.player.name as Name | GROUP BY $-.Name YIELD $-.Name as Player, count(*) AS Name_Count` | 查找所有连接到 player100 的点,并根据他们的姓名进行分组,返回姓名的出现次数。 |
| [LIMIT](../3.ngql-guide/8.clauses-and-options/limit.md) | `YIELD <var> [| LIMIT [<offset_value>,] <number_rows>]` | `GO FROM "player100" OVER follow REVERSELY YIELD $$.player.name AS Friend, $$.player.age AS Age | ORDER BY $-.Age, $-.Friend | LIMIT 1, 3` | 从排序结果中返回第 2 行开始的 3 行数据。 |
| [LIMIT](../3.ngql-guide/8.clauses-and-options/limit.md) | `YIELD <var> [| LIMIT [<offset_value>,] <number_rows>]` | `O FROM "player100" OVER follow REVERSELY YIELD $$.player.name AS Friend, $$.player.age AS Age | ORDER BY $-.Age, $-.Friend | LIMIT 1, 3` | 从排序结果中返回第 2 行开始的 3 行数据。 |
| [SKIP](../3.ngql-guide/8.clauses-and-options/limit.md) | `RETURN <var> [SKIP <offset>] [LIMIT <number_rows>]` | `MATCH (v:player{name:"Tim Duncan"}) --> (v2) RETURN v2.player.name AS Name, v2.player.age AS Age ORDER BY Age DESC SKIP 1` | 用户可以单独使用`SKIP <offset>`设置偏移量,后面不需要添加`LIMIT <number_rows>`。 |
| [SAMPLE](../3.ngql-guide/8.clauses-and-options/sample.md) | `<go_statement> SAMPLE <sample_list>;` | `GO 3 STEPS FROM "player100" OVER * YIELD properties($$).name AS NAME, properties($$).age AS Age SAMPLE [1,2,3];` | 在结果集中均匀取样并返回指定数量的数据。 |
| [ORDER BY](../3.ngql-guide/8.clauses-and-options/order-by.md) | `<YIELD clause> ORDER BY <expression> [ASC | DESC] [, <expression> [ASC | DESC] ...]` | `FETCH PROP ON player "player100", "player101", "player102", "player103" YIELD player.age AS age, player.name AS name | ORDER BY $-.age ASC, $-.name DESC` | `ORDER BY`子句指定输出结果的排序规则。 |
Expand Down
Loading