Skip to content

Commit

Permalink
update studio manage schema (#648)
Browse files Browse the repository at this point in the history
* update studio manage schema

* update

* Update st-ug-crud-space.md
  • Loading branch information
foesa-yang authored Sep 1, 2021
1 parent df3e6a2 commit ea3bea2
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 59 deletions.
Binary file added docs-2.0/nebula-studio/figs/st-ug-026.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs-2.0/nebula-studio/figs/st-ug-027-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 18 additions & 17 deletions docs-2.0/nebula-studio/manage-schema/st-ug-crud-edge-type.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
<!-- will be updated when Import and Schema modules can work as expected.
# Operate edge types

After a graph space is created in Nebula Graph, you can create edge types. With Studio, you can choose to use the **Console** page or the **Schema** page to create, retrieve, update, or delete edge types. This article only introduces how to use the **Schema** page to operate edge types in a graph space.

## Studio version

Studio of v1.2.0-beta or later versions supports this function. To update the version, run this command.
```bash
docker-compose pull && docker-compose up
```
Studio of v{{ studio.release }} or later versions supports this function. For more information, see [check updates](../about-studio/st-ug-check-updates.md).

## Prerequisites

To operate an edge type on the **Schema** page of Studio, you must do a check of these:

- The version of Studio is v1.2.0-beta or later.
- Studio is connected to Nebula Graph.
- A graph space is created.
- Your account has the authority of GOD, ADMIN, or DBA.
Expand All @@ -35,21 +28,23 @@ To create an edge type on the **Schema** page, follow these steps:

5. On the **Create** page, do these settings:

a. **Name**: Specify an appropriate name for the edge type. In this example, `action` is used.
a. **Name**: Specify an appropriate name for the edge type. In this example, `serve` is used.

b. (Optional) If necessary, under the name, click the **Comment** to input content.

b. (Optional) If necessary, in the upper left corner of the **Define Properties** panel, click the check box to expand the panel and do these settings:
c. (Optional) If necessary, in the upper left corner of the **Define Properties** panel, click the check box to expand the panel and do these settings:

- To define a property: Enter a property name, a data type, and a default value.
- To define a property: Enter a property name, a data type, and a default value.

- To add multiple properties: Click the **Add Property** button and define more properties.
- To add multiple properties: Click the **Add Property** button and define more properties.

- To cancel a defined property: Besides the **Defaults** column, click the button ![Icon of deletion](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-020.png "Cancel").
- To cancel a defined property: Besides the **Defaults** column, click the button ![Icon of deletion](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-020.png "Cancel").

c. (Optional) If no index is set for the edge type, you can set the TTL configuration: In the upper left corner of the **Set TTL** panel, click the check box to expand the panel, and configure `TTL_COL` and `TTL_ DURATION`. For more information about both parameters, see [TTL configuration](https://docs.nebula-graph.com.cn/manual-CN/2.query-language/4.statement-syntax/1.data-definition-statements/TTL/> "Click to go to Nebula Graph website").
d. (Optional) If no index is set for the edge type, you can set the TTL configuration: In the upper left corner of the **Set TTL** panel, click the check box to expand the panel, and configure `TTL_COL` and `TTL_ DURATION`. For more information about both parameters, see [TTL configuration](../../3.ngql-guide/8.clauses-and-options/ttl-options.md "Click to go to Nebula Graph website").

6. When the preceding settings are completed, in the **Equivalent to the following nGQL statement** panel, you can see the nGQL statement equivalent to these settings.

![Define properties of the `action` edge type](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-027.png "Define an edge type")
![Define properties of the `action` edge type](../figs/st-ug-027-1.png "Define an edge type")

7. Confirm the settings and then click the **+ Create** button.

Expand All @@ -69,6 +64,7 @@ To edit an edge type on the **Schema** page, follow these steps:

5. On the **Edit** page, do these operations:

- To edit a Comment: Click **Edit** under the Name.
- To edit a property: On the **Define Properties** panel, find a property, click **Edit**, and then change the data type or the default value.

- To delete a property: On the **Define Properties** panel, find a property, click **Delete**.
Expand All @@ -83,7 +79,11 @@ To edit an edge type on the **Schema** page, follow these steps:

6. When the configuration is done, in the **Equivalent to the following nGQL statement** panel, you can see the equivalent `ALTER EDGE` statement.

## Delete an edge type
## Delete an Edge type

!!! danger

Confirm the [impact](../../3.ngql-guide/11.edge-type-statements/2.drop-edge.md) before deleting the Edge type. The deleted data cannot be restored if it is not [backed up](../../7.data-security/3.manage-snapshot.md).

To delete an edge type on the **Schema** page, follow these steps:

Expand All @@ -95,7 +95,8 @@ To delete an edge type on the **Schema** page, follow these steps:

4. Click the **Edge Type** tab, find an edge type and then click the button ![Icon of deletion](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-017.png "Delete") in the **Operations** column.

5. Click **OK** to confirm in the pop-up dialog box.

## Next to do

After the edge type is created, you can use the **Console** page to insert edge data one by one manually or use the **Import** page to bulk import edge data.
-->
32 changes: 14 additions & 18 deletions docs-2.0/nebula-studio/manage-schema/st-ug-crud-index.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
<!-- will be updated when Import and Schema modules can work as expected.
# Operate Indexes

You can create an index for a tag and/or an edge type. An index lets traversal start from vertices or edges with the same property and it can make a query more efficient. You can create two index types: Tag Index and Edge Type Index. With Studio, you can use the **Console** page or the **Schema** page to create, retrieve, and delete indexes. This article introduces how to use the **Schema** page to operate an index.
You can create an index for a Tag and/or an Edge type. An index lets traversal start from vertices or edges with the same property and it can make a query more efficient. You can create two index types: Tag Index and Edge type Index. With Studio, you can use the **Console** page or the **Schema** page to create, retrieve, and delete indexes. This article introduces how to use the **Schema** page to operate an index.

!!! note

You can create an index when a tag or an edge type is created. But an index can decrease the write speed during data import. We recommend that you import data firstly and then create and rebuild an index. For more information, see [nGQL Manual](https://docs.nebula-graph.io/manual-EN/2.query-language/4.statement-syntax/1.data-definition-statements/ "Click to go to the Nebula Graph website").
You can create an index when a Tag or an Edge Type is created. But an index can decrease the write speed during data import. We recommend that you import data firstly and then create and rebuild an index. For more information, see [nGQL Manual](../../3.ngql-guide/14.native-index-statements/README.md "Click to go to the Nebula Graph website").

## Studio version

Studio of v1.2.0-beta or later versions supports this function. To update the version, run this command.
```bash
docker-compose pull && docker-compose up
```
Studio of v{{ studio.release }} or later versions supports this function. For more information, see [check updates](../about-studio/st-ug-check-updates.md).

## Prerequisites

To operate an index on the **Schema** page of Studio, you must do a check of these:

- The version of Studio is v1.2.0-beta or later.
- Studio is connected to Nebula Graph.
- A graph space, tags, and edge types are created.
- A graph Space, Tags, and Edge Types are created.
- Your account has the authority of GOD, ADMIN, or DBA.

## Create an index
Expand All @@ -37,16 +30,20 @@ To create an index on the **Schema** page, follow these steps:

a. **Index Type**: Choose to create an index for a tag or for an edge type. In this example, **Edge Type** is chosen.

b. **Name**: Choose a tag name or an edge type name. In this example, **action** is chosen.
b. **Name**: Choose a tag name or an edge type name. In this example, **follow** is chosen.

c. **Index Name**: Specify a name for the new index. In this example, **follow_index** is used.

c. **Index Name**: Specify a name for the new index. In this example, **action_index** is used.
d. **Indexed Properties**: Click **Add**, and then, in the dialog box, choose a property. If necessary, repeat this step to choose more properties. You can drag the properties to sort them. In this example, `degree` is chosen.

d. **Indexed Properties**: Click **Add**, and then, in the dialog box, choose a property. If necessary, repeat this step to choose more properties. You can drag the properties to sort them. In this example, `actionId` and `label` are chosen.
!!! note
!!! note

The order of the indexed properties has an effect on the result of the `LOOKUP` statement. For more information, see [nGQL Manual](https://docs.nebula-graph.io/manual-EN/2.query-language/4.statement-syntax/2.data-query-and-manipulation-statements/lookup-syntax/#error_code_411 "Click to go to the Nebula Graph website").
The order of the indexed properties has an effect on the result of the `LOOKUP` statement. For more information, see [nGQL Manual](../../3.ngql-guide/7.general-query-statements/5.lookup.md "Click to go to the Nebula Graph website").

e. **Comment**: The remarks of a certain property or the index itself. The maximum length is 256 bytes. By default, there will be no comments on an index. But in this example, `follow_index` is used.

When the settings are done, the **Equivalent to the following nGQL statement** panel shows the statement equivalent to the settings.

![A page for index creation](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-030.png "Create an index")

6. Confirm the settings and then click the **+ Create** button.
Expand All @@ -70,5 +67,4 @@ To delete an index on **Schema**, follow these steps:
2. In the graph space list, find a graph space, and then click its name or the button ![Icon of setting](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-018.png "Set") in the **Operations** column.
3. In the **Current Graph Space** field, confirm the name of the graph space. If necessary, you can choose another name to change the graph space.
4. Click the **Index** tab, find an index and then the button ![Icon of deletion](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-017.png "Delete") in the **Operations** column.
-->
5. Click **OK** to confirm in the pop-up dialog box.
23 changes: 11 additions & 12 deletions docs-2.0/nebula-studio/manage-schema/st-ug-crud-space.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,15 @@ When Studio is connected to Nebula Graph, you can create or delete a graph space

## Studio version

Studio of v{{ studio.base220 }} or later versions supports this function. To update the version, run this command.

```bash
docker-compose pull && docker-compose up
```
Studio of v{{ studio.release }} or later versions supports this function. For more information, see [check updates](../about-studio/st-ug-check-updates.md).

## Prerequisites

To operate a graph space on the **Schema** page of Studio, you must do a check of these:

- The version of Studio is v{{ studio.base220 }} or later.
- Studio is connected to Nebula Graph.
- Your account has the authority of GOD. It means that:
- If the authentication is enabled in Nebula Graph, you can use `user` and `password` to sign in to Studio.
- If the authentication is enabled in Nebula Graph, you can use `root` and any password to sign in to Studio.
- If the authentication is disabled in Nebula Graph, you must use `root` and its password to sign in to Studio.

## Create a graph space
Expand All @@ -28,25 +23,29 @@ To create a graph space on the **Schema** page, follow these steps:
2. On the **Graph Space List** page, click the **+ Create** button.
3. On the **Create** page, do these settings:

a. **Name**: Specify a name to the new graph space. In this example, `basketballplayer` is used. The name must be distinct in the database.
a. **Name**: Specify a name to the new graph space. In this example, `basketballplayer` is used. The name must be distinct in the database. The name cannot be used keywords or reserved keywords as identifiers. For more information, see [keywords](../../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md).

b. **Vid type**: The data types of VIDs are restricted to `FIXED_STRING(<N>)` or `INT64`; a graph space can only select one VID type, `FIXED_STRING(32)` is used. For more information, see [VID](../../1.introduction/3.vid.md).

c. **Comment**: The remarks of a certain property or the space itself. The maximum length is 256 bytes. By default, there will be no comments on a space. But in this example, `Statistics of basketball players` is used.

b. **Optional Parameters**: Set `partition_num`, `replica_factor`, `charset`, `collate` and `vid type`. In this example, these parameters are set to `10`, `1`, `utf8`, `utf8_bin` and `FIXED_STRING(32)` separately. For more information, see [`CREATE SPACE` syntax](/docs-2.0/3.ngql-guide/9.space-statements/1.create-space.md "Click to go to the Nebula Graph website").
d. **Optional Parameters**: Set `partition_num`, `replica_factor`. In this example, these parameters are set to `100` and `1` separately. For more information, see [`CREATE SPACE` syntax](../../3.ngql-guide/9.space-statements/1.create-space.md "Click to go to the Nebula Graph website").

In the **Equivalent to the following nGQL statement** panel, you can see the statement equivalent to the preceding settings.

```bash
CREATE SPACE basketballplayer (partition_num = 10, replica_factor = 1, charset = utf8, collate = utf8_bin, vid_type = FIXED_STRING(32))
CREATE SPACE basketballplayer (partition_num = 100, replica_factor = 1, vid_type = FIXED_STRING(32)) COMMENT = "Statistics of basketball players"
```

4. Confirm the settings and then click the **+ Create** button. If the graph space is created successfully, you can see it on the graph space list.

![The Create page with settings for a graph space](../figs/st-ug-026-1.png)
![The Create page with settings for a graph space](../figs/st-ug-026.png)

## Delete a graph space

!!! danger

Deleting the image space will delete all the data in it, and the deleted data cannot be restored if it is not [backed up](../../7.data-security/3.manage-snapshot.md).
Deleting the space will delete all the data in it, and the deleted data cannot be restored if it is not [backed up](../../7.data-security/3.manage-snapshot.md).

To delete a graph space on the **Schema** page, follow these steps:

Expand Down
24 changes: 12 additions & 12 deletions docs-2.0/nebula-studio/manage-schema/st-ug-crud-tag.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
<!-- will be updated when Import and Schema modules can work as expected.
# Operate tags

After a graph space is created in Nebula Graph, you can create tags. With Studio, you can use the **Console** page or the **Schema** page to create, retrieve, update, or delete tags. This article only introduces how to use the **Schema** page to operate tags in a graph space.

## Studio version

Studio of v1.2.0-beta or later versions supports this function. To update the version, run this command.
```bash
docker-compose pull && docker-compose up
```
Studio of v{{ studio.release}} or later versions supports this function. For more information, see [check updates](../about-studio/st-ug-check-updates.md).

## Prerequisites

To operate a tag on the **Schema** page of Studio, you must do a check of these:

- The version of Studio is v1.2.0-beta or later.
- Studio is connected to Nebula Graph.
- A graph space is created.
- Your account has the authority of GOD, ADMIN, or DBA.
Expand All @@ -38,13 +32,13 @@ To create a tag on the **Schema** page, follow these steps:

b. (Optional) If necessary, in the upper left corner of the **Define Properties** panel, click the check box to expand the panel and do these settings:

- To define a property: Enter a property name, a data type, and a default value.
- To define a property: Enter a property name, a data type, and a default value.

- To add multiple properties: Click the **Add Property** button and define more properties.
- To add multiple properties: Click the **Add Property** button and define more properties.

- To cancel a defined property: Besides the **Defaults** column, click the button ![Icon of deletion](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-020.png "Cancel").
- To cancel a defined property: Besides the **Defaults** column, click the button ![Icon of deletion](https://docs-cdn.nebula-graph.com.cn/nebula-studio-docs/st-ug-020.png "Cancel").

c. (Optional) If no index is set for the tag, you can set the TTL configuration: In the upper left corner of the **Set TTL** panel, click the check box to expand the panel and configure `TTL_COL` and `TTL_ DURATION`. For more information about both parameters, see [TTL configuration](https://docs.nebula-graph.com.cn/manual-CN/2.query-language/4.statement-syntax/1.data-definition-statements/TTL/> "Click to go to Nebula Graph website").
c. (Optional) If no index is set for the tag, you can set the TTL configuration: In the upper left corner of the **Set TTL** panel, click the check box to expand the panel and configure `TTL_COL` and `TTL_ DURATION`. For more information about both parameters, see [TTL configuration](../../3.ngql-guide/8.clauses-and-options/ttl-options.md "Click to go to Nebula Graph website").

6. When the preceding settings are completed, in the **Equivalent to the following nGQL statement** panel, you can see the nGQL statement equivalent to these settings.

Expand All @@ -68,6 +62,8 @@ To edit a tag on the **Schema** page, follow these steps:

5. On the **Edit** page, do these settings:

- To edit a Comment: Click **Edit** under the Name.

- To edit a property: On the **Define Properties** panel, find a property, click **Edit**, and then change the data type or the default value.

- To delete a property: On the **Define Properties** panel, find a property and then click **Delete**.
Expand All @@ -84,6 +80,11 @@ To edit a tag on the **Schema** page, follow these steps:

## Delete a tag


!!! danger

Confirm the [impact](../../3.ngql-guide/10.tag-statements/2.drop-tag.md) before deleting the tag. The deleted data cannot be restored if it is not [backed up](../../7.data-security/3.manage-snapshot.md).

To delete a tag on the **Schema** page, follow these steps:

1. In the toolbar, click the **Schema** tab.
Expand All @@ -98,4 +99,3 @@ To delete a tag on the **Schema** page, follow these steps:

After the tag is created, you can use the **Console** page to insert vertex data one by one manually or use the **Import** page to bulk import vertex data.

-->
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ extra:
- icon: 'fontawesome/brands/github'
link: 'https://github.com/vesoft-inc/nebula-docs-cn'
studio:
release: 3.0.0
base111b: 1.1.1-beta
base220: 2.2.0
explorer:
Expand Down

0 comments on commit ea3bea2

Please sign in to comment.