You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ke...@apache.org on 2025/04/14 00:15:21 UTC
(tinkerpop) 01/02: update
This is an automated email from the ASF dual-hosted git repository.
kenhuuu pushed a commit to branch TINKERPOP-2974
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 8ac68a0ccae3c0a1ddb42c8be51ee186236ab7e1
Author: Ken Hu <10...@users.noreply.github.com>
AuthorDate: Sun Apr 13 14:36:57 2025 -0700
update
---
docs/src/dev/provider/gremlin-semantics.asciidoc | 8 +++---
docs/src/upgrade/release-3.8.x.asciidoc | 29 ++++++++--------------
.../traversal/step/map/PropertyMapStep.java | 2 +-
.../process/traversal/step/map/ValueMapTest.java | 2 +-
4 files changed, 16 insertions(+), 25 deletions(-)
diff --git a/docs/src/dev/provider/gremlin-semantics.asciidoc b/docs/src/dev/provider/gremlin-semantics.asciidoc
index 37610d9d5d..01ff54125c 100644
--- a/docs/src/dev/provider/gremlin-semantics.asciidoc
+++ b/docs/src/dev/provider/gremlin-semantics.asciidoc
@@ -1638,11 +1638,9 @@ specified by propertyKeys. If the list is empty, then all properties are include
*Modulation:*
-* `by(Traversal)` - Semantics depend on whether the implementation is capable of iterating the result map in order.
-** If iteration order guaranteed - applies the by() traversals in a round-robin fashion to the map values.
-** If iteration order randomized - allows only a single by() traversal and applies it to all map values. An attempt to
-add more than one by() will result in an Exception that contains the message "valueMap() step only accepts one by()
-modulator which has already been set".
+* `by(Traversal)` - Only a single by() modulator is allowed and it applies to all map values. An attempt to add more
+than one by() will result in an Exception that contains the message "valueMap()/propertyMap() step can only have one by
+modulator".
* `with(key, value)` - Determines which optional entries to add to the map. The key is "tinkerpop.valueMap.tokens" and
the possible values are:
** 0 for no tokens
diff --git a/docs/src/upgrade/release-3.8.x.asciidoc b/docs/src/upgrade/release-3.8.x.asciidoc
index 51968400a2..e553a40cc6 100644
--- a/docs/src/upgrade/release-3.8.x.asciidoc
+++ b/docs/src/upgrade/release-3.8.x.asciidoc
@@ -210,6 +210,13 @@ gremlin> g.V().has("person","name",P.within("vadas","peter")).group().by().by(__
See: link:https://issues.apache.org/jira/browse/TINKERPOP-2971[TINKERPOP-2971]
+==== valueMap() and propertyMap() By Modulation Semantics
+
+The `valueMap()` and `propertyMap()`steps have been changed to throw an error if multiple `by()` modulators are applied.
+The previous behavior attempted to round-robin the by() but this wasn't possible for all providers.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-2974[TINKERPOP-2974]
+
==== groupCount() By Modulation Semantics
The `groupCount()` step has been changed to throw an error if multiple `by()` modulators are applied. The previous
@@ -221,26 +228,12 @@ See: link:https://issues.apache.org/jira/browse/TINKERPOP-3121[TINKERPOP-3121]
==== Graph System Providers
-===== Semantics change for valueMap()
+===== Semantics change for PropertyMapStep
-The semantics have changed for the handling of by modulators to the `valueMap()` step. Providers will now have two
-different options. If map entries are iterated in the same order as the keys given argument list, then nothing has
-changed and the by modulators should be applied in a round robin fashion. If the map entries aren't iterated in, then
-only one by modulator is required to be accepted and an exception should be thrown when there are more than one by()
-modulators. The exception thrown should contain the following: "valueMap() step only accepts one by() modulator which
-has already been set"
-
-The reference implementation of `valueMap()` in `gremlin-core` has been updated to handle this. In particular, it makes
-use of a new Graph Feature to determine what should be done. See the next section for more information.
+The semantics have changed for the handling of by modulators to the `valueMap` and `propertyMap` steps. Only one by
+modulator is required to be accepted and an exception should be thrown when there are more than one by() modulators.
+The exception thrown should contain the following: "valueMap()/propertyMap() step can only have one by modulator".
See: link:https://issues.apache.org/jira/browse/TINKERPOP-2974[TINKERPOP-2974]
-===== New Graph Features for ordering
-
-`supportsOrderedProperties()` has been added to `ElementFeatures` to allow providers to advertise whether or not they
-are able to return properties in the order that they are specified in
-`Iterator<? extends Property<V>> properties(final String... propertyKeys)`. If the `Iterator` returned by
-`properties(String...)` will yield results in the exact order provided by the `String...` argument then the provider
-should return `true`.
-
==== Graph Driver Providers
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertyMapStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertyMapStep.java
index e79db88f1f..3534b7e313 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertyMapStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertyMapStep.java
@@ -122,7 +122,7 @@ public class PropertyMapStep<K,E> extends ScalarMapStep<Element, Map<K, E>>
if (null == valueTraversal) {
this.valueTraversal = this.integrateChild(selectTraversal);
} else {
- throw new IllegalArgumentException("propertyMap() step can only have one by modulator");
+ throw new IllegalArgumentException("valueMap()/propertyMap() step can only have one by modulator");
}
}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ValueMapTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ValueMapTest.java
index 506f88b440..f54df0c5ad 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ValueMapTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ValueMapTest.java
@@ -354,7 +354,7 @@ public abstract class ValueMapTest extends AbstractGremlinProcessTest {
assertFalse(traversal.hasNext());
fail("Should have failed as multiple by() not allowed for valueMap");
} catch (Exception ex) {
- assertThat(ex.getMessage(), containsString("propertyMap() step can only have one by modulator"));
+ assertThat(ex.getMessage(), containsString("valueMap()/propertyMap() step can only have one by modulator"));
}
}