I want to do the following from gremlin script,
> m = g.V().addV(label,'Person','name','Marko').iterator().next(); d = g.V().addV(label, 'Person','name', 'Daniel').iterator().next(); pl = g.addV(label,'Place','place_name','California').iterator().next(); m.addEdge('livesIn', pl); m.addEdge('friend', d);
With the above script, I am able to create persons Marko, Daniel, and place "California" and create edges between Marko and California AND Marko and Daniel.
I want to retrieve the vertex Ids created by the system for subsequent processing in my application. Hence, I want to extend the above script and retrieve the vertices I just created at the end of the script with some labels associated to them. say, I want the result something like:
==>marko=v[8232]
==>daniel=v[8252]
==>place=v[4136]
When I add "inject(m, d, pl)" at the end of above script, I am getting the vertices, but not able to assign them some labels.
I tried, union, group, and steps in multiple ways but was not able to come up with the solution. Kindly help.