spmallette commented on code in PR #3483:
URL: https://github.com/apache/tinkerpop/pull/3483#discussion_r3494528962


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java:
##########
@@ -3463,6 +3505,72 @@ public default GraphTraversal<S, E> drop() {
         return this.asAdmin().addStep(new DropStep<>(this.asAdmin()));
     }
 
+    /**
+     * Adds one or more labels to the current element. This is a side-effect 
step that passes the
+     * element through unchanged.
+     *
+     * @param label      the first label to add
+     * @param moreLabels additional labels to add
+     * @return the traversal with an appended {@link AddLabelStep}
+     * @since 4.0.0
+     */
+    public default GraphTraversal<S, E> addLabel(final String label, final 
String... moreLabels) {
+        this.asAdmin().getGremlinLang().addStep(Symbols.addLabel, label, 
moreLabels);
+        return this.asAdmin().addStep((AddLabelStep) new 
AddLabelStep<>(this.asAdmin(), label, moreLabels));
+    }
+
+    /**
+     * Adds dynamically computed labels to the current element. This is a 
side-effect step that passes the
+     * element through unchanged.
+     *
+     * @param labelTraversal the traversal that produces labels to add

Review Comment:
   > the traversal that produces labels to add
   
   labels plural? I assume it's not the case that we are going to iterate out 
all the Strings this traversal produces right? it's just pulling the first one, 
no? if not, i think that's an issue because that would cut against the `by` 
rule.  i'm not sure what that means though because then we have nothing 
analogous to `addLabel(final String label, final String... moreLabels)` - not 
quite as nice to do multiple `addLabel(Traversal)` which may get ugly if you're 
trying to pick apart a list of labels. i dunno...not sure what we want to do 
here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to