schema.vertexLabel("Player").
ifNotExists().
partitionBy("name", Text).
property("position", Text).
create();
schema.vertexLabel("Ball").
ifNotExists().
partitionBy("type", Text).
create();
schema.edgeLabel('throw').
ifNotExists().
from('Player').to('Ball').
create()
schema.edgeLabel('catch').
ifNotExists().
from('Ball').to('Player').
create()
taro = g.addV("Player").
property("name", "Taro").
property("position", "pitcher").
next();
jiro = g.addV("Player").
property("name", "Jiro").
property("position", "catcher").
next();
ball = g.addV("Ball").
property("type", "Baseball").
next();
g.addE("throw").
from(taro).
to(ball).
next();
g.addE("catch").
from(ball).
to(jiro).
next();
dev.V()
Last active
May 15, 2020 13:19
-
-
Save mzsima/aeb6866bd5e3df93eeb4cff17bf4c616 to your computer and use it in GitHub Desktop.
ピッチャーが投げて、キャッチャーが捕る
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment