Skip to content

Test Nebula Graph

vkill edited this page Jan 27, 2023 · 6 revisions

Test Nebula Graph 3.x

cd ~
git clone --branch v3.3.0 [email protected]:vesoft-inc/nebula-docker-compose.git nebula-docker-compose-v3
cd nebula-docker-compose-v3
docker-compose up -d
cd
cargo run -p nebula-demo-tokio --bin nebula_demo_tokio_v3_graph_client 127.0.0.1 9669 root 'password'
cargo run -p nebula-demo-tokio --bin nebula_demo_tokio_v3_bb8_graph_pool 127.0.0.1 9669 root 'password'

Test Nebula Graph 2.x

cd ~
git clone --branch v2.6 [email protected]:vesoft-inc/nebula-docker-compose.git nebula-docker-compose-v2
cd nebula-docker-compose-v2
docker-compose up -d
cd
cargo run -p nebula-demo-tokio --bin nebula_demo_tokio_v2_graph_client 127.0.0.1 9669 root 'password'
cargo run -p nebula-demo-tokio --bin nebula_demo_tokio_v2_bb8_graph_pool 127.0.0.1 9669 root 'password'

Test Nebula Graph 1.x

cd ~
git clone --branch v1.0 [email protected]:vesoft-inc/nebula-docker-compose.git nebula-docker-compose-v1
cd nebula-docker-compose-v1
docker-compose up -d
cd
cargo run -p nebula-demo-tokio --bin nebula_demo_tokio_v1_graph_client 127.0.0.1 3699 user 'password'
cargo run -p nebula-demo-tokio --bin nebula_demo_tokio_v1_bb8_graph_pool 127.0.0.1 3699 user 'password'
# https://docs.nebula-graph.io/1.2.1/manual-EN/1.overview/2.quick-start/1.get-started/

CREATE SPACE nba(partition_num=1, replica_factor=1);
USE nba;

CREATE TAG player(name string, age int);
CREATE TAG team(name string);
CREATE EDGE follow(degree int);
CREATE EDGE serve(start_year int, end_year int);

INSERT VERTEX player(name, age) VALUES 100:("Tim Duncan", 42);
INSERT VERTEX player(name, age) VALUES 101:("Tony Parker", 36);
INSERT VERTEX player(name, age) VALUES 102:("LaMarcus Aldridge", 33);
INSERT VERTEX team(name) VALUES 200:("Warriors");
INSERT VERTEX team(name) VALUES 201:("Nuggets");
INSERT VERTEX player(name, age) VALUES 121:("Useless", 60);

INSERT EDGE follow(degree) VALUES 100 -> 101:(95);
INSERT EDGE follow(degree) VALUES 100 -> 102:(90);
INSERT EDGE follow(degree) VALUES 102 -> 101:(75);
INSERT EDGE serve(start_year, end_year) VALUES 100 -> 200:(1997, 2016);
INSERT EDGE serve(start_year, end_year) VALUES 101 -> 201:(1999, 2018);

Clone this wiki locally