Why AddEdgeStep doesn't work after DropStep of edges in the same traversal using Gremlin?
<p>I have this code which essentially updates properties, removes all old <code>IsOfType</code> edges and adds new <code>IsOfType</code> edges (if I remove all the method/class abstraction and make it inline):</p>

<pre><code>traversal = g.V("Entity:633471488:519").as("entity");

//update properties
traversal.property("text", "new text");
traversal.property("description", "new description");

//drop typeEdges
traversal.select("entity").outE("IsOfType").drop();
//even that causes the same issue(!): traversal.select("entity").outE("HasInner").drop();
System.out.println("traversal after type edges deletion: " +traversal);

//make new typeEdges
traversal.V("Entity:996942848:518").as("type-0").addE("IsOfType").from("entity").to("type-0");

System.out.println("traversal after type edges addition: " +traversal);

//storage  
traversal.select("entity").forEachRemaining({})
</code></pre>

<hr>

<p>Everything works (even the drop of existing <code>IsOfType</code> edges). But the creation of the new <code>IsOfType</code> edges doesn't seem to be resulting in new edges on the graph. If I comment out the drop, then creation works fine (!) It is as if the <code>DropStep</code> which is before the <code>addEdgeStep</code> is happening at the end. I even tried to drop other type of edge and it is causing the same issue (!). It might be that implicit transaction handling is deciding to commit when a <code>drop()</code> happens as it is with <code>next()</code>, <code>iterate()</code> and <code>forEachRemaining()</code> ?? If that is the case then drops and creations can't happen within the same transaction using Fluent API which renders it not very useful for real applications :(</p>

<p>Here is the state of the traversals after the deletion and after the additon of two <code>IsOfType</code> edges in my run (I tried both Java and Datastax Studio Console):</p>

<pre><code>traversal after type edges deletion: 
[
   GraphStep(vertex,[Entity:633471488:519])@[entity], 
   AddPropertyStep({value=[Entity], key=[atClass]}), 
   AddPropertyStep({value=[FilmWithSuperCategories aaa], key=[text]}), 
   AddPropertyStep({value=[dffsdfsd f2313], key=[description]}),   
   SelectOneStep(entity)@[entity], 
   VertexStep(OUT,[IsOfType],edge), 
   DropStep
]

traversal after type edges addition: 
[
   GraphStep(vertex,[Entity:633471488:519])@[entity], 
   AddPropertyStep({value=[Entity], key=[atClass]}), 
   AddPropertyStep({value=[FilmWithSuperCategories aaa], key=[text]}), 
   AddPropertyStep({value=[dffsdfsd f2313], key=[description]}), 
   SelectOneStep(entity)@[entity], 
   VertexStep(OUT,[IsOfType],edge), 
   DropStep, 
   GraphStep(vertex,[Entity:996942848:518])@[type-0], 
   AddEdgeStep({~from=[[SelectOneStep(entity)]], ~to=[[SelectOneStep(type-0)]], label=[IsOfType]}), 
   GraphStep(vertex,[Entity:1489781376:516])@[type-1], 
   AddEdgeStep({~from=[[SelectOneStep(entity)]], ~to=[[SelectOneStep(type-1)]], label=[IsOfType]})
]
</code></pre>

<p><strong>Edit</strong></p>

<p>From what I read here (<a href="http://tinkerpop.apache.org/docs/current/reference/#drop-step" rel="nofollow noreferrer">http://tinkerpop.apache.org/docs/current/reference/#drop-step</a>)</p>

<blockquote>
  <p>The drop()-step (filter/sideEffect) is used to remove element and properties from the graph (i.e. remove). It is a filter step because the traversal yields no outgoing objects.</p>
</blockquote>

<p>There are no objects being returned so it is not possible to do anything after a drop happens! so I am curious how I can do multiple drops/additions in a single transaction using DSE Graph Fluent API</p>

<p>Thanks!</p>