schema.vertexLabel('User').
ifNotExists().
partitionBy('uid', Text).
property('name', Text).
create();
schema.edgeLabel('friend').
ifNotExists().
from('User').
to('User').
create();
user0 = g.addV("User").
property("uid", "user0").
property("name", "Taro").
next();
previous = user0
for(i=1; i<5; i++) {
user = g.addV("User").
property("uid", "user" + i).
property("name", "Taro").
next();
g.addE('friend').
from(previous).
to(user).
next();
previous = user
}
g.addE('friend').
from(previous).
to(user0).
next();
dev.V()
Last active
May 10, 2020 13:39
-
-
Save mzsima/b5f274a11220fe77385809d2ac4ae140 to your computer and use it in GitHub Desktop.
a circle of friends
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment