[ 
https://issues.apache.org/jira/browse/TINKERPOP-2978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17778852#comment-17778852
 ] 

ASF GitHub Bot commented on TINKERPOP-2978:
-------------------------------------------

kenhuuu commented on code in PR #2302:
URL: https://github.com/apache/tinkerpop/pull/2302#discussion_r1369372294


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java:
##########
@@ -1672,6 +1678,90 @@ public default GraphTraversal<S, Long> dateDiff(final 
Traversal<?, Date> dateTra
         return this.asAdmin().addStep(new DateDiffStep<>(this.asAdmin(), 
dateTraversal));
     }
 
+    /**
+     * Calculates the difference between the list traverser and list argument.
+     *
+     * @return the traversal with an appended {@link DifferenceStep}.
+     * @see <a 
href="http://tinkerpop.apache.org/docs/${project.version}/reference/#difference-step";
 target="_blank">Reference Documentation - Difference Step</a>
+     * @since 3.7.1
+     */
+    public default GraphTraversal<S, Set<?>> difference(final Object values) {
+        this.asAdmin().getBytecode().addStep(Symbols.difference, values);
+        return this.asAdmin().addStep(new DifferenceStep<>(this.asAdmin(), 
values));
+    }
+
+    /**
+     * Calculates the disjunction between the list traverser and list argument.
+     *
+     * @return the traversal with an appended {@link DisjunctStep}.
+     * @see <a 
href="http://tinkerpop.apache.org/docs/${project.version}/reference/#disjunct-step";
 target="_blank">Reference Documentation - Disjunct Step</a>
+     * @since 3.7.1
+     */
+    public default GraphTraversal<S, Set<?>> disjunct(final Object values) {
+        this.asAdmin().getBytecode().addStep(Symbols.disjunct, values);
+        return this.asAdmin().addStep(new DisjunctStep<>(this.asAdmin(), 
values));
+    }
+
+    /**
+     * Calculates the intersection between the list traverser and list 
argument.
+     *
+     * @return the traversal with an appended {@link IntersectStep}.
+     * @see <a 
href="http://tinkerpop.apache.org/docs/${project.version}/reference/#intersect-step";
 target="_blank">Reference Documentation - Intersect Step</a>
+     * @since 3.7.1
+     */
+    public default GraphTraversal<S, Set<?>> intersect(final Object values) {
+        this.asAdmin().getBytecode().addStep(Symbols.intersect, values);
+        return this.asAdmin().addStep(new IntersectStep<>(this.asAdmin(), 
values));
+    }
+
+    /**
+     * Joins together the elements of the incoming list traverser together 
with the provided delimiter.
+     *
+     * @return the traversal with an appended {@link ConjoinStep}.
+     * @see <a 
href="http://tinkerpop.apache.org/docs/${project.version}/reference/#join-step"; 
target="_blank">Reference Documentation - Join Step</a>

Review Comment:
   updated.





> Add List Manipulation Steps to Gremlin
> --------------------------------------
>
>                 Key: TINKERPOP-2978
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2978
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: language
>            Reporter: Cole Greer
>            Priority: Major
>
> Today Gremlin requires that users fall back to closures to handle many common 
> list manipulation options that users want to do on data in the graph.  This 
> is a problem for many users as many of the providers prevent the use of 
> closures due to the security risks so for these users there is no way to 
> manipulate lists directly.
> A full list of proposed functions and semantics is detailed here: 
> https://github.com/apache/tinkerpop/blob/3.7.0/docs/src/dev/future/proposal-3-remove-closures.asciidoc



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to