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

details modified #980

Merged
merged 2 commits into from
Dec 21, 2021
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions docs-2.0/2.quick-start/4.nebula-graph-crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ A Nebula Graph instance consists of one or more graph spaces. Graph spaces are p

To insert data into a graph space, define a schema for the graph database. Nebula Graph schema is based on the following components.

| Schema component | Description |
| ---------------- | --------------------------------------------------------------------------------------- |
| Vertex | Represents an entity in the real world. A vertex can have one or more tags. |
| Schema component | Description |
| ---------------- | ------------|
| Vertex | Represents an entity in the real world. A vertex can have one or more tags. |
| Tag | The type of the same group of vertices. It defines a set of properties that describes the types of vertices. |
| Edge | Represents a **directed** relationship between two vertices. |
| Edge type | The type of an edge. It defines a group of properties that describes the types of edges. |
| Edge | Represents a **directed** relationship between two vertices. |
| Edge type | The type of an edge. It defines a group of properties that describes the types of edges. |

For more information, see [Data modeling](../1.introduction/2.data-model.md).

Expand All @@ -43,13 +43,13 @@ nebula> SHOW HOSTS;
+-------------+-----------+-----------+--------------+----------------------+------------------------+
```

From the **Status** column of the table in the return results, you can see that all the Storage services are online.
From the **Status** column of the table in the returned results, you can see that all the Storage services are online.

### Asynchronous implementation of creation and alteration
### Async implementation of `CREATE` and `ALTER`

!!! caution

Nebula Graph implements the following creation or alteration operations asynchronously in the **next** heartbeat cycle. The operations will not take effect until they finish.
In Nebula Graph, the following `CREATE` or `ALTER` commands are implemented in an async way and take effect in the **next** heartbeat cycle. Otherwise, an error will be returned.

* `CREATE SPACE`
* `CREATE TAG`
Expand All @@ -65,7 +65,7 @@ From the **Status** column of the table in the return results, you can see that

To make sure the follow-up operations work as expected, take one of the following approaches:

* Run `SHOW` or `DESCRIBE` statements accordingly to check the status of the objects, and make sure the creation or alteration is complete. If it is not, wait a few seconds and try again.
* Run `SHOW` or `DESCRIBE` statements accordingly to check the status of the objects, and make sure the creation or alteration is complete. If it is not, wait for a few seconds and try again.

* Wait for two heartbeat cycles, i.e., 20 seconds.

Expand Down Expand Up @@ -158,7 +158,7 @@ For more information on parameters, see [CREATE TAG](../3.ngql-guide/10.tag-stat

### Examples

Create tags `player` and `team`, edge types `follow` and `serve`. Descriptions are as follows.
Create tags `player` and `team`, and edge types `follow` and `serve`. Descriptions are as follows.

| Component name | Type | Property |
| :--- | :--- | :--- |
Expand All @@ -179,7 +179,7 @@ nebula> CREATE EDGE serve(start_year int, end_year int);

## Insert vertices and edges

Users can use the `INSERT` statement to insert vertices or edges based on existing tags or edge types.
You can use the `INSERT` statement to insert vertices or edges based on existing tags or edge types.

### nGQL syntax

Expand Down Expand Up @@ -320,7 +320,7 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
| `$$` | Represents the target vertices. |
| `\` | A line-breaker. |

* Search for the players that the player with VID `player101` follows. Then Retrieve the teams of the players that the player with VID `player100` follows. To combine the two queries, use a pipe or a temporary variable.
* Search for the players that the player with VID `player101` follows. Then retrieve the teams of the players that the player with VID `player100` follows. To combine the two queries, use a pipe or a temporary variable.

* With a pipe:

Expand Down
51 changes: 26 additions & 25 deletions docs-2.0/reuse/source_connect-to-nebula-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ Nebula Graph supports multiple types of clients, including a CLI client, a GUI c

You can use supported [clients or console](https://docs.nebula-graph.io/{{nebula.release}}/20.appendix/6.eco-tool-version/) to connect to Nebula Graph.<!--这里用外链。-->

<!-- TODO cloud service can't be provided together with v2.0.0.
If you don't have a Nebula Graph database yet, we recommend that you try the cloud service. [Nebula Graph Cloud Service](https://www.nebula-cloud.io/) supports on-demand deployment and fast building, and uses Nebula Graph Studio as its default client.
<!-- TODO The cloud service cannot be provided together with v{{ nebula.release }}.
If you do not have a Nebula Graph database yet, we recommend that you try the cloud service. [Nebula Graph Cloud Service](https://www.nebula-cloud.io/) supports on-demand deployment and fast building with Nebula Graph Studio as its default client.
-->

## Use Nebula Console to connect to Nebula Graph

### Prerequisites

* You have started the Nebula Graph services. For how to start the services, see [Start and Stop Nebula Graph](https://docs.nebula-graph.io/{{nebula.release}}/4.deployment-and-installation/manage-service/).<!--这里用外链。-->
* The machine you plan to run Nebula Console on has network access to the Nebula Graph services.
* You have started [Nebula Graph services](https://docs.nebula-graph.io/{{nebula.release}}/4.deployment-and-installation/manage-service/).<!--这里用外链。-->

* The machine you plan to run Nebula Console on has network access to Nebula Graph services.

### Steps

Expand Down Expand Up @@ -63,9 +64,9 @@ If you don't have a Nebula Graph database yet, we recommend that you try the clo
[-t 120] [-e "nGQL_statement" | -f filename.nGQL]
```

The description of the parameters is as follows.
Parameters and descriptions are as follows.

| Option | Description |
| Parameter | Description |
| - | - |
| `-h` | Shows the help menu. |
| `-addr` | Sets the IP address of the graphd service. The default address is 127.0.0.1. |
Expand All @@ -74,78 +75,78 @@ If you don't have a Nebula Graph database yet, we recommend that you try the clo
| `-p/-password` | Sets the password of your Nebula Graph account. Before enabling authentication, you can use any characters as the password. |
| `-t/-timeout` | Sets an integer-type timeout threshold of the connection. The unit is second. The default value is 120. |
| `-e/-eval` | Sets a string-type nGQL statement. The nGQL statement is executed once the connection succeeds. The connection stops after the result is returned. |
| `-f/-file` | Sets the path of an nGQL file. The nGQL statements in the file are executed once the connection succeeds. You'll get the return messages and the connection stops then. |
| `-f/-file` | Sets the path of an nGQL file. The nGQL statements in the file are executed once the connection succeeds. The result will be returned and the connection stops then. |

You can find more details in the [Nebula Console Repository](https://github.com/vesoft-inc/nebula-console/tree/{{console.branch}}).

## Nebula Console commands

Nebula Console can export CSV file, DOT file, and import too.
Nebula Console can export CSV file, DOT file, and import datasets.

!!! note

The commands are case insensitive.

### Export a CSV file

CSV files save the return result of a executed command.
CSV files save the returned result of a executed command.

!!! note

- A CSV file will be saved in the working directory, i.e., what linux command `pwd` show;
- A CSV file will be saved in the working directory, i.e., what the linux command `pwd` shows.

- This command only works for the next query statement.

The command to export a csv file.
The command to export a csv file is as follows:

```ngql
nebula> :CSV <file_name.csv>
```

### Export a DOT file

DOT files save the return result of a executed command, and the result information is different from CSV files.
DOT files save the returned result of a executed command, and the resulted information is different from that of CSV files.

!!! Note

- A DOT file will be saved in the working directory, i.e., what linux command `pwd` show;
- A DOT file will be saved in the working directory, i.e., what the linux command `pwd` shows.

- You can copy the contents of DOT file, and paste in [GraphvizOnline](https://dreampuf.github.io/GraphvizOnline/), to visualize the excution plan;
- You can copy the contents of the DOT file and paste them in [GraphvizOnline](https://dreampuf.github.io/GraphvizOnline/) to generate a visualized execution plan.

- This command only works for the next query statement.

The command to export a DOT file.
The command to export a DOT file is as follows:

```ngql
nebula> :dot <file_name.dot>
```

For example,
The example is as follows:

```ngql
nebula> :dot a.dot
nebula> PROFILE FORMAT="dot" GO FROM "player100" OVER follow;
```

### Importing a testing dataset
### Import a testing dataset

The testing dataset is named `nba`. Details about schema and data can be seen by commands `SHOW`.
The testing dataset is named `nba`. To view details about the schema and data, use the corresponding `SHOW` command.

Using the following command to import the testing dataset,
The command to import a testing dataset is as follows:

```ngql
nebula> :play nba
```

### Run a command multiple times

Sometimes, you want to run a command multiple times. Run the following command.
To run a command multiple times, use the following command:

```ngql
nebula> :repeat N
```

For example,
The example is as follows:

```ngql
nebula> :repeat 3
Expand Down Expand Up @@ -185,9 +186,7 @@ Executed 3 times, (total time spent 3681/4734 us), (average time spent 1227/1578

### Sleep to wait

Sleep N seconds.

It is usually used when altering schema. Since schema is altered in async way, and take effects in the next heartbeat cycle.
This command will make Nebula Graph services sleep and wait for N seconds. The schema is altered in an async way and takes effect in the next heartbeat cycle. Therefore, this command is usually used when altering schema. The command is as follows:

```ngql
nebula> :sleep N
Expand All @@ -197,6 +196,8 @@ nebula> :sleep N

You can use `:EXIT` or `:QUIT` to disconnect from Nebula Graph. For convenience, Nebula Console supports using these commands in lower case without the colon (":"), such as `quit`.

The example is as follows:

```ngql
nebula> :QUIT

Expand All @@ -205,6 +206,6 @@ Bye root!

## FAQ

### How can I install Nebula Console from the source code
### "How can I install Nebula Console from the source code?"

To download and compile the latest source code of Nebula Console, follow the instructions on [the nebula console GitHub page](https://github.com/vesoft-inc/nebula-console#build-nebula-graph-console).
31 changes: 17 additions & 14 deletions docs-2.0/reuse/source_install-nebula-graph-by-rpm-or-deb.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Prepare the right [resources](https://docs.nebula-graph.io/{{nebula.release}}/4.

!!! enterpriseonly

For the Enterprise Edition, please send an email to [email protected].
For the Enterprise Edition, please send email to [email protected].

## Download the package from cloud service

Expand Down Expand Up @@ -38,14 +38,14 @@ Prepare the right [resources](https://docs.nebula-graph.io/{{nebula.release}}/4.
https://oss-cdn.nebula-graph.io/package/<release_version>/nebula-graph-<release_version>.ubuntu2004.amd64.deb
```

For example, download release package {{ nebula.release }} for `Centos 7.5`:
For example, download the release package `{{ nebula.release }}` for `Centos 7.5`:

```bash
wget https://oss-cdn.nebula-graph.io/package/{{ nebula.release }}/nebula-graph-{{ nebula.release }}.el7.x86_64.rpm
wget https://oss-cdn.nebula-graph.io/package/{{ nebula.release }}/nebula-graph-{{ nebula.release }}.el7.x86_64.rpm.sha256sum.txt
```

download release package `{{ nebula.release }}` for `Ubuntu 1804`:
Download the release package `{{ nebula.release }}` for `Ubuntu 1804`:

```bash
wget https://oss-cdn.nebula-graph.io/package/{{ nebula.release }}/nebula-graph-{{ nebula.release }}.ubuntu1804.amd64.deb
Expand All @@ -56,8 +56,8 @@ Prepare the right [resources](https://docs.nebula-graph.io/{{nebula.release}}/4.

!!! danger

- Nightly versions are usually used to test new features. Don't use it for production.
- Nightly versions may not be build successfully every night. And the names may change from day to day.
- Nightly versions are usually used to test new features. Do not use it in a production environment.
- Nightly versions may not be built successfully every night. And the names may change from day to day.

URL:

Expand Down Expand Up @@ -94,25 +94,26 @@ Prepare the right [resources](https://docs.nebula-graph.io/{{nebula.release}}/4.
wget https://oss-cdn.nebula-graph.io/package/nightly/2021.11.28/nebula-graph-2021.11.28-nightly.ubuntu1804.amd64.deb
wget https://oss-cdn.nebula-graph.io/package/nightly/2021.11.28/nebula-graph-2021.11.28-nightly.ubuntu1804.amd64.deb.sha256sum.txt
```

<!--
## Download the package from GitHub

* Download the release version.

+ On the [Nebula Graph Releases](https://github.com/vesoft-inc/nebula-graph/releases) page, find the required version and click **Assets**.
![Select a Nebula Graph release version](../reuse/console-1.png)

![Select a Nebula Graph release version](../reuse/console-1.png)

+ In the **Assets** area, click the package to download it.

* Download the nightly version.

!!! danger

Nightly versions are usually used to test new features. Don't use it for production.
Nightly versions are usually used to test new features. Do not use it in a production environment.

+ On the [Nebula Graph package](https://github.com/vesoft-inc/nebula/actions/workflows/package.yaml) page, click the latest package on the top of the package list.
![Select a Nebula Graph nightly version](https://github.com/vesoft-inc/nebula-docs/blob/master/docs-2.0/figs/4.deployment-and-installation/2.complie-and-install-nebula-graph/2.install-nebula-graph-by-rpm-or-deb/nightly-page.png?raw=true)
+ On the [Nebula Graph package](https://github.com/vesoft-inc/nebula/actions/workflows/package.yaml) page, click the latest **package** on the top of the package list.

![Select a Nebula Graph nightly version](https://github.com/vesoft-inc/nebula-docs/blob/master/docs-2.0/figs/4.deployment-and-installation/2.complie-and-install-nebula-graph/2.install-nebula-graph-by-rpm-or-deb/nightly-page.png?raw=true)

+ In the **Artifacts** area, click the package to download it.
-->
Expand All @@ -129,7 +130,7 @@ Prepare the right [resources](https://docs.nebula-graph.io/{{nebula.release}}/4.

```bash
sudo rpm -ivh nebula-graph-{{nebula.release}}.el7.x86_64.rpm
```
```

* Use the following syntax to install with a DEB package.

Expand All @@ -147,8 +148,10 @@ Prepare the right [resources](https://docs.nebula-graph.io/{{nebula.release}}/4.

The default installation path is `/usr/local/nebula/`.

## What's next
## Next to do

- (Enterprise Edition)[Deploy license](https://docs.nebula-graph.com.cn/{{nebula.release}}/4.deployment-and-installation/deploy-license)
- [start Nebula Graph](https://docs.nebula-graph.io/{{nebula.release}}/2.quick-start/5.start-stop-service/) <!--这里用外链。-->
- [connect to Nebula Graph](https://docs.nebula-graph.io/{{nebula.release}}/2.quick-start/3.connect-to-nebula-graph/)<!--这里用外链。-->

- [Start Nebula Graph](https://docs.nebula-graph.io/{{nebula.release}}/2.quick-start/5.start-stop-service/) <!--这里用外链。-->

- [Connect to Nebula Graph](https://docs.nebula-graph.io/{{nebula.release}}/2.quick-start/3.connect-to-nebula-graph/)<!--这里用外链。-->