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

Adjust docs according to the syntax changes #361

Merged
merged 3 commits into from
May 13, 2019
Merged
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
46 changes: 23 additions & 23 deletions docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Containers allow a developer to package up an application with all of the parts
such as libraries and other dependencies, and ship it all out as one package.
By doing so, the developer can rest assured that the application will run on any other `Linux` machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code.

First of all, you should make sure `docker` have installed on your machine. Open a terminal and run the following command :
First of all, you should make sure that `docker` has been installed on your machine. Open a terminal and run the following command :

```
docker --version
Expand All @@ -32,28 +32,28 @@ When `nebula` image is ready, run

`docker run -it vesoft/nebula-graph:latest /bin/bash`

to start and login the docker container.
After login in the container, you're in the `root` directory and you should use `cd ~/nebula-graph/` to switch to the nebula home directory.
to start and log in to the docker container.
After login, you're in the `root` directory and you should use `cd ~/nebula-graph/` to switch to the nebula home directory.

Run `./start-all.sh` to start meta service, storage service and graph service.

Run

`ps -ef | grep nebula`

to display the servie's running status.
to display the services' running status.

Please make sure the services are working.

`bin/nebula` is a `console` which can be used to insert and query data.

`--port` is used for specifying the graph server port and the default value is `3699`.

`--u` and `--p` are used to specify the user name and password, `user` and `password` are the default authority.
`-u` and `-p` are used to specify the user name and password, `user` and `password` are the default authority.

Run

`bin/nebula --port=3699 --u=user --p=password`
`bin/nebula --port=3699 -u=user -p=password`

to connect to the graph server.

Expand All @@ -67,7 +67,7 @@ Welcome to Nebula Graph (Version 0.1)
nebula>
```

Before query the dataset, you should switch to an existed graph space.
Before query the dataset, you should switch to an existing graph space.

```
nebula> use space nba
Expand All @@ -81,7 +81,7 @@ Execution succeeded (Time spent: 154/793 us)
This query comes from a vertex walk up an edge.

```
nebula> go from 5209979940224249985 over like
nebula> GO FROM 5209979940224249985 OVER like
========================
| id |
========================
Expand All @@ -97,7 +97,7 @@ nebula> go from 5209979940224249985 over like
This query comes from a vertex walk up an edge and the target's age should be greater than or equal to 30, also renames the columns as `Player`, `Friend` and `Age`.

```
nebula> go from 5209979940224249985 over like where $$[player].age >= 30 YIELD $^[player].name as Player, $$[player].name as Friend, $$[player].age As Age
nebula> GO FROM 5209979940224249985 OVER like WHERE $$[player].age >= 30 YIELD $^[player].name AS Player, $$[player].name AS Friend, $$[player].age AS Age
=============================================
| Player | Friend | Age |
=============================================
Expand All @@ -114,14 +114,14 @@ This query comes from a vertex walk up an edge and the target's age should be gr

Setting output result as input, query `Player Name`, `FromYear`, `ToYear` and `Team Name` with input's `id`.

In this query, `$^` is delegated the source vertex and `$$` is the target vertex.
In this query, `$^` is delegated the source vertex and `$$` is the target vertex.

`$-` is used to indicate the input from pipeline.

(reference to `regular expressions`, using the special ^ (hat) and $ (dollar sign) metacharacters to describe the start and the end of the line.)

```
nebula> go from 5209979940224249985 over like where $$[player].age >= 30 | go from $-.id over serve yield $^[player].name As Player, serve.start_year as FromYear, serve.end_year as ToYear, $$[team].name as Team
nebula> GO FROM 5209979940224249985 OVER like WHERE $$[player].age >= 30 | GO FROM $-.id OVER serve YIELD $^[player].name AS Player, serve.start_year AS FromYear, serve.end_year AS ToYear, $$[team].name AS Team
=====================================================
| Player | FromYear | ToYear | Team |
=====================================================
Expand All @@ -143,10 +143,10 @@ For more detail about Query Language, please see [Traverse The Graph](../docs/nG
Currently you can create your own graph space, such as :

```
Create space mySpace(partition_num=1, replica_factor=1)
CREATE space myspace(partition_num=1, replica_factor=1)
```

When you start `Nebula Graph`, a set of vertex and edge have already existed.
When you start `Nebula Graph`, a set of vertices and edges have already existed.
Currently the default schema is `nba`.

The graph space describes the relationship between players and teams.
Expand Down Expand Up @@ -191,28 +191,28 @@ You can create both tag and edge's schema:

```
// create tags schema: players and teams:
create TAG player(name string, age int)
CREATE TAG player(name string, age int)

create TAG team(name string)
CREATE TAG team(name string)

// create edges schema: players and teams:
create EDGE like(likeness int)
CREATE EDGE like(likeness int)

create EDGE serve(start_year int, end_year int)
CREATE EDGE serve(start_year int, end_year int)
```

The insert sentences look like the following commands.

```
// Insert some vertexs: players and teams:
INSERT VERTEX player(name, age) VALUES(-8379929135833483044: "Amar'e Stoudemire",36)
// Insert some vertices: players and teams:
INSERT VERTEX player(name, age) VALUES -8379929135833483044:("Amar'e Stoudemire", 36)

INSERT VERTEX team(name) VALUES(-9110170398241263635: "Magic")
INSERT VERTEX team(name) VALUES -9110170398241263635:("Magic")

// Insert some edges: likes and serves:
INSERT EDGE like(likeness) VALUES(-8379929135833483044 -> 6663720087669302163: 90)
INSERT EDGE like(likeness) VALUES -8379929135833483044 -> 6663720087669302163:(90)

INSERT EDGE serve(start_year, end_year) VALUES(-8379929135833483044 -> 868103967282670864: 2002, 2010)
INSERT EDGE serve(start_year, end_year) VALUES -8379929135833483044 -> 868103967282670864:(2002, 2010)

```