This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 862bb93397 Correct Gremlin-Go set and composite-map-key
deserialization docs
862bb93397 is described below
commit 862bb9339777079c5cf8341306f21e2d521abc2d
Author: Stephen Mallette <[email protected]>
AuthorDate: Fri Sep 25 07:36:19 2026 +0000
Correct Gremlin-Go set and composite-map-key deserialization docs
The Limitations section stated that server set type codes deserialize into
slices and that GraphBinary maps with non-comparable keys are unsupported.
In practice a set type code deserializes into a *gremlingo.SimpleSet and
composite/non-comparable map keys are deserialized lossily rather than
rejected. Update both bullets to describe the actual behavior.
Assisted-by: Kiro:claude-opus-4.8
---
docs/src/reference/gremlin-variants.asciidoc | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/docs/src/reference/gremlin-variants.asciidoc
b/docs/src/reference/gremlin-variants.asciidoc
index f963336533..0aabe74285 100644
--- a/docs/src/reference/gremlin-variants.asciidoc
+++ b/docs/src/reference/gremlin-variants.asciidoc
@@ -739,18 +739,23 @@ each is supplied as a property value:
* The Gremlin `Character` type is not supported by Gremlin-Go.
-* There is no default `set` type in Go. Any set type code from server will be
deserialized into slices with the list
-type implementation. To input a set into Gremlin-Go, a custom struct which
implements the `gremlingo.Set` interface
-will be serialized as a set. `gremlingo.NewSimpleSet` is a basic
implementation of a set that is provided by Gremlin-Go
-that can be used to fulfill the `gremlingo.Set` interface if desired.
+* There is no default `set` type in Go. A set type code from the server is
deserialized into a
+`*gremlingo.SimpleSet`, which implements the `gremlingo.Set` interface, rather
than into a slice. To read its
+elements, the result should be type-asserted to `gremlingo.Set` and its
`ToSlice()` method called. To input a set
+into Gremlin-Go, a custom struct which implements the `gremlingo.Set`
interface will be serialized as a set.
+`gremlingo.NewSimpleSet` is a basic implementation of a set that is provided
by Gremlin-Go that can be used to
+fulfill the `gremlingo.Set` interface if desired.
* Go does not support ordered maps natively as the built-in `map` type does
not guarantee iteration order. Traversal
results which contain maps may not preserve original ordering when
deserialized into Go's native map types.
* GraphBinary `Char` values are not supported.
-* GraphBinary permits map keys of any supported type, including composite
values such as lists. Go's native `map` type
-only supports comparable keys, so GraphBinary maps with non-comparable keys
are not supported.
+* GraphBinary permits map keys of any supported type, including composite
values such as lists. Go's native `map`
+type only supports comparable keys, so GraphBinary maps with non-comparable
keys are deserialized lossily rather than
+rejected. A list key is converted to its string form through `fmt.Sprint`, so
a key such as `[marko 29]` is stored as
+the string `"[marko 29]"`, while a map key is stored under a pointer to the
key value. In both cases the original
+key's type and identity are lost, so such keys cannot be reconstructed or
looked up by their original value.
* The `subgraph()`-step returns a detached `*Graph` data container exposing
`Vertices map[interface{}]*Vertex` and `Edges map[interface{}]*Edge`. The
result is not a live `Graph` instance: