I have a user vertex already created.
g.V().has('user','username','vipul').as('user')
I want to create a new 'group' vertex with some properties and also a new 'options' vertex with some other properties.
g.addV(label,'group','group_name','DC11').as('group')
g.addV(label,'options','command_line_arguments','-D -n').as('options')
Now I want to create an edge from user to group and another edge from group to options.
user ---> group, group ---> options
Can these queries be combined, selecting a vertex, creating new vertices and then creating new edges?
You can simply chain the steps together:
Note that I set the properties with the
property
step as I prefer that form, but you can also add them directly with theaddV
step.See it in action in GremlinBin.