forked from vesoft-inc/nebula-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added schema management (vesoft-inc#152)
* fix conflict * modified st-ug-crud-index.md * updated * fixed * updated toc.md * fixed format errors * fixed punctuation errors
- Loading branch information
1 parent
6dd8c81
commit 7cd4f65
Showing
21 changed files
with
285 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# 操作边类型 | ||
|
||
在 Nebula Graph 数据库中创建图空间后,您可能需要创建边类型。您可以选择使用 **控制台** 或者 **Schema管理** 操作边类型。本文仅说明如何使用 **Schema管理** 操作边类型。 | ||
|
||
## 前提条件 | ||
|
||
在 Studio 上操作边类型之前,您必须确认以下信息: | ||
|
||
- Studio 已经连接到 Nebula Graph 数据库。 | ||
- 图空间已经创建。 | ||
- 您当前登录的账号拥有 GOD、ADMIN 或者 DBA 的权限。 | ||
|
||
## 创建边类型 | ||
|
||
按以下步骤使用 **Schema管理** 创建边类型: | ||
|
||
1. 在工具栏中,点击 **Schema管理** 页签。 | ||
2. 在 **图空间列表** 中,找到图空间,点击图空间名称或者在 **操作** 列中点击 ![表示设置的图标](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-018.png "设置") 图标。 | ||
3. 在 **当前图空间** 里确认图空间名称。您也可以通过选择图空间名称切换图空间。 | ||
4. 点击 **边类型** 页签,并点击 **创建** 按钮。 | ||
5. 在 **创建** 页面上,完成以下设置: | ||
|
||
a. **名称**:按提示信息输入合规的边类型名称。本示例中,输入 `action`。 | ||
|
||
b. (可选)如果边类型需要属性,在 **定义属性**面板的左上角,点击勾选框,并在展开的列表中,完成以下操作: | ||
- 输入属性名称、数据类型和默认值。 | ||
- 如果一个标签有多个属性,可以点击 **添加属性** 按钮,并定义属性。 | ||
- 如果要删除某个属性,在该属性所在行,点击 ![表示删除的图标](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-020.png "删除") 图标。 | ||
|
||
c. (可选)标签未设置索引时,您可以设置 TTL:在 **设置TTL**面板的左上角,点击勾选框,并在展开的列表中设置 `TTL_COL` 和 `TTL_DURATION` 参数信息。关于这两个参数的详细信息,参考 [TTL 配置](https://docs.nebula-graph.com.cn/manual-CN/2.query-language/4.statement-syntax/1.data-definition-statements/TTL/ "点击前往 Nebula Graph 网站")。 | ||
|
||
6. 完成设置后,在 **对应的nGQL语句** 面板上,您能看到与上述配置等价的 nGQL 语句。 | ||
![定义边类型 action 的属性](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-022.png "定义边类型") | ||
|
||
7. 确认无误后,点击 **+ 创建** 按钮。 | ||
如果边类型创建成功,**定义属性**面板会显示这个边类型的属性列表。 | ||
|
||
## 修改边类型 | ||
|
||
按以下步骤使用 **Schema管理** 修改边类型: | ||
|
||
1. 在工具栏中,点击 **Schema管理** 页签。 | ||
2. 在 **图空间列表** 中,找到图空间,点击图空间名称或者在 **操作** 列中点击 ![表示设置的图标](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-018.png "设置") 图标。 | ||
3. 在 **当前图空间** 里确认图空间名称。您也可以通过选择图空间名称完成图空间切换。 | ||
4. 点击 **边类型** 页签,找到需要修改的边类型,并在 **操作** 列中,点击 ![表示修改的图标](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-021.png "修改") 图标。 | ||
5. 在 **编辑** 页面,您可以选择以下操作: | ||
- 如果要修改属性:在 **定义属性** 面板上,找到需要修改的属性,在右侧点击 **编辑**,再修改属性的数据类型或者默认值。修改完成后,点击 **确认** 或 **取消**。 | ||
- 如果要删除属性:在 **定义属性** 面板上,找到需要删除的属性,在右侧点击 **删除**,经确认后,删除属性。 | ||
- 如果要添加属性:在 **定义属性** 面板上,点击 **添加属性** 按钮,添加属性信息。 | ||
- 如果要修改 TTL:在 **设置TTL** 面板上,修改或 `TTL_COL` 和 `TTL_DURATION` 设置。 | ||
- 如果要删除所有已经配置的 TTL:在 **设置TTL** 面板的左上角,点击勾选框,取消选择。 | ||
- 如果要设置 TTL:在 **设置TTL** 面板的左上角,点击勾选框,开始设置 TTL。 | ||
6. 完成设置后,在 **对应的nGQL语句** 面板上,您能看到修改后的 nGQL 语句。 | ||
|
||
## 删除边类型 | ||
|
||
按以下步骤使用 **Schema管理** 删除边类型: | ||
|
||
1. 在工具栏中,点击 **Schema管理** 页签。 | ||
2. 在 **图空间列表** 中,找到图空间,点击图空间名称或者在 **操作** 列中点击 ![表示设置的图标](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-018.png "设置") 图标。 | ||
3. 在 **当前图空间** 里确认图空间名称。您也可以通过选择图空间名称切换图空间。 | ||
4. 点击 **边类型** 页签,找到需要修改的边类型,并在 **操作** 列中,点击 ![表示删除的图标](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-017.png "删除") 图标。 | ||
|
||
## 后续操作 | ||
|
||
边类型创建成功后,您可以在 **控制台** 上逐条插入边数据,或者使用 **导入** 功能批量插入边数据。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# 操作索引 | ||
|
||
标签和边类型创建成功后,您可以为它们添加索引,使得图查询时可以从拥有共同属性的同一类型的点或边开始遍历,使大型图的查询更为高效。Nebula Graph 支持两种类型的索引:标签索引和边类型索引。您可以选择使用 **控制台** 或者 **Schema管理** 操作索引。本文仅说明如何使用 **Schema管理** 操作索引。 | ||
|
||
## 前提条件 | ||
|
||
在 Studio 上操作索引之前,您必须确认以下信息: | ||
|
||
- Studio 已经连接到 Nebula Graph 数据库。 | ||
- 图空间、标签和边类型已经创建。 | ||
- 您当前登录的账号拥有 GOD、ADMIN 或者 DBA 的权限。 | ||
|
||
## 创建索引 | ||
|
||
按以下步骤使用 **Schema管理** 创建索引: | ||
|
||
1. 在工具栏中,点击 **Schema管理** 页签。 | ||
2. 在 **图空间列表** 中,找到图空间,点击图空间名称或者在 **操作** 列中点击 ![表示设置的图标](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-018.png "设置") 图标。 | ||
3. 在 **当前图空间** 里确认图空间名称。您也可以通过选择图空间名称切换图空间。 | ||
4. 点击 **索引** 页签,再点击 **创建** 按钮。 | ||
5. 在 **创建** 页面上,完成以下设置: | ||
|
||
a. **索引类型**:确认或修改索引类型,即 **标签** 或者 **边类型**。本示例中选择 **边类型**。 | ||
|
||
b. **名称**:选择要创建索引的标签或边类型名称。本示例中选择 **action**。 | ||
|
||
c. **索引名称**:按规定指定索引名称。本示例中输入 **action_index**。 | ||
|
||
d. **索引属性**:点击 **添加**,在 **选择关联的属性** 列表里选择需要索引的属性,并点击 **确定** 按钮。如果需要关联多个属性,重复这一步操作。您可以按界面提示重排索引属性的顺序。本示例中选择 `label` 和 `actionId`。 | ||
> **说明**:索引属性的顺序会影响 `LOOKUP` 语句的查询结果。详细信息,参考 [《nGQL 用户手册》](https://docs.nebula-graph.com.cn/manual-CN/2.query-language/4.statement-syntax/2.data-query-and-manipulation-statements/lookup-syntax/#faq "点击前往 Nebula Graph 网站")。 | ||
6. 完成设置后,在 **对应的 nGQL**面板,您能看到与上述配置等价的 nGQL 语句。 | ||
![为边类型 action 创建索引](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-023.png "创建索引") | ||
|
||
1. 确认无误后,点击 **+ 创建** 按钮。 | ||
如果索引创建成功,**定义属性**面板会显示这个索引的属性列表。 | ||
|
||
## 查看索引 | ||
|
||
按以下步骤使用 **Schema管理** 查看索引: | ||
|
||
1. 在工具栏中,点击 **Schema管理** 页签。 | ||
2. 在 **图空间列表** 中,找到图空间,点击图空间名称或者在 **操作** 列中点击 ![表示设置的图标](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-018.png "设置") 图标。 | ||
3. 在 **当前图空间** 里确认图空间名称。您也可以通过选择图空间名称切换图空间。 | ||
4. 点击 **索引** 页签,在列表左上方,选择需要查看的索引类型。 | ||
5. 在列表中,找到需要查看的索引,点击索引所在行。界面上即列出索引相关的所有属性。 | ||
|
||
## 删除索引 | ||
|
||
按以下步骤使用 **Schema管理** 删除索引: | ||
|
||
1. 在工具栏中,点击 **Schema管理** 页签。 | ||
2. 在 **图空间列表** 中,找到图空间,点击图空间名称或者在 **操作** 列中点击 ![表示设置的图标](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-018.png "设置") 图标。 | ||
3. 在 **当前图空间** 里确认图空间名称。您也可以通过选择图空间名称切换图空间。 | ||
4. 点击 **索引** 页签,找到需要修改的索引,并在 **操作** 列中,点击 ![表示删除的图标](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-017.png "删除") 图标。 |
Oops, something went wrong.