You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by xi...@apache.org on 2024/09/17 04:11:08 UTC

(tinkerpop) branch graphbinary-label-list created (now a77ef9c7cc)

This is an automated email from the ASF dual-hosted git repository.

xiazcy pushed a change to branch graphbinary-label-list
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


      at a77ef9c7cc Update v4 gbin compatibility test files according to new serialization updates

This branch includes the following new commits:

     new f7872d6d62 serialize string labels as list
     new 79ccf459ba serialize label as list in python
     new a77ef9c7cc Update v4 gbin compatibility test files according to new serialization updates

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(tinkerpop) 02/03: serialize label as list in python

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiazcy pushed a commit to branch graphbinary-label-list
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 79ccf459bad5ace3452d09c12196ec67c61d66c4
Author: Yang Xia <55...@users.noreply.github.com>
AuthorDate: Mon Sep 16 20:42:09 2024 -0700

    serialize label as list in python
---
 .../gremlin_python/structure/io/graphbinaryV4.py   | 26 +++++++++++++---------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/gremlin-python/src/main/python/gremlin_python/structure/io/graphbinaryV4.py b/gremlin-python/src/main/python/gremlin_python/structure/io/graphbinaryV4.py
index 3cf8f53a3e..41fc8a47dd 100644
--- a/gremlin-python/src/main/python/gremlin_python/structure/io/graphbinaryV4.py
+++ b/gremlin-python/src/main/python/gremlin_python/structure/io/graphbinaryV4.py
@@ -535,11 +535,12 @@ class EdgeIO(_GraphBinaryTypeIO):
         cls.prefix_bytes(cls.graphbinary_type, as_value, nullable, to_extend)
 
         writer.to_dict(obj.id, to_extend)
-        StringIO.dictify(obj.label, writer, to_extend, True, False)
+        # serializing label as list here for now according to GraphBinaryV4
+        ListIO.dictify([obj.label], writer, to_extend, True, False)
         writer.to_dict(obj.inV.id, to_extend)
-        StringIO.dictify(obj.inV.label, writer, to_extend, True, False)
+        ListIO.dictify([obj.inV.label], writer, to_extend, True, False)
         writer.to_dict(obj.outV.id, to_extend)
-        StringIO.dictify(obj.outV.label, writer, to_extend, True, False)
+        ListIO.dictify([obj.outV.label], writer, to_extend, True, False)
         to_extend.extend(NULL_BYTES)
         to_extend.extend(NULL_BYTES)
 
@@ -552,9 +553,10 @@ class EdgeIO(_GraphBinaryTypeIO):
     @classmethod
     def _read_edge(cls, b, r):
         edgeid = r.read_object(b)
-        edgelbl = r.to_object(b, DataType.string, False)
-        inv = Vertex(r.read_object(b), r.to_object(b, DataType.string, False))
-        outv = Vertex(r.read_object(b), r.to_object(b, DataType.string, False))
+        # reading single string value for now according to GraphBinaryV4
+        edgelbl = r.to_object(b, DataType.list, False)[0]
+        inv = Vertex(r.read_object(b), r.to_object(b, DataType.list, False)[0])
+        outv = Vertex(r.read_object(b), r.to_object(b, DataType.list, False)[0])
         b.read(2)
         properties = r.read_object(b)
         edge = Edge(edgeid, outv, edgelbl, inv, properties)
@@ -625,7 +627,8 @@ class VertexIO(_GraphBinaryTypeIO):
     def dictify(cls, obj, writer, to_extend, as_value=False, nullable=True):
         cls.prefix_bytes(cls.graphbinary_type, as_value, nullable, to_extend)
         writer.to_dict(obj.id, to_extend)
-        StringIO.dictify(obj.label, writer, to_extend, True, False)
+        # serializing label as list here for now according to GraphBinaryV4
+        ListIO.dictify([obj.label], writer, to_extend, True, False)
         to_extend.extend(NULL_BYTES)
         return to_extend
 
@@ -635,7 +638,8 @@ class VertexIO(_GraphBinaryTypeIO):
 
     @classmethod
     def _read_vertex(cls, b, r):
-        vertex = Vertex(r.read_object(b), r.to_object(b, DataType.string, False), r.read_object(b))
+        # reading single string value for now according to GraphBinaryV4
+        vertex = Vertex(r.read_object(b), r.to_object(b, DataType.list, False)[0], r.read_object(b))
         return vertex
 
 
@@ -648,7 +652,8 @@ class VertexPropertyIO(_GraphBinaryTypeIO):
     def dictify(cls, obj, writer, to_extend, as_value=False, nullable=True):
         cls.prefix_bytes(cls.graphbinary_type, as_value, nullable, to_extend)
         writer.to_dict(obj.id, to_extend)
-        StringIO.dictify(obj.label, writer, to_extend, True, False)
+        # serializing label as list here for now according to GraphBinaryV4
+        ListIO.dictify([obj.label], writer, to_extend, True, False)
         writer.to_dict(obj.value, to_extend)
         to_extend.extend(NULL_BYTES)
         to_extend.extend(NULL_BYTES)
@@ -660,7 +665,8 @@ class VertexPropertyIO(_GraphBinaryTypeIO):
 
     @classmethod
     def _read_vertexproperty(cls, b, r):
-        vp = VertexProperty(r.read_object(b), r.to_object(b, DataType.string, False), r.read_object(b), None)
+        # reading single string value for now according to GraphBinaryV4
+        vp = VertexProperty(r.read_object(b), r.to_object(b, DataType.list, False)[0], r.read_object(b), None)
         b.read(2)
         vp.properties = r.read_object(b)
         return vp


(tinkerpop) 01/03: serialize string labels as list

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiazcy pushed a commit to branch graphbinary-label-list
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit f7872d6d624261f77b408a310eed6f01e3adc91f
Author: Yang Xia <55...@users.noreply.github.com>
AuthorDate: Mon Sep 16 09:08:35 2024 -0700

    serialize string labels as list
---
 .../structure/io/binary/types/EdgeSerializer.java      | 18 ++++++++++++------
 .../io/binary/types/VertexPropertySerializer.java      |  6 ++++--
 .../structure/io/binary/types/VertexSerializer.java    |  8 ++++++--
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/EdgeSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/EdgeSerializer.java
index 6c52b815e5..32d3550faf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/EdgeSerializer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/EdgeSerializer.java
@@ -29,6 +29,8 @@ import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -42,12 +44,15 @@ public class EdgeSerializer extends SimpleTypeSerializer<Edge> {
     @Override
     protected Edge readValue(final Buffer buffer, final GraphBinaryReader context) throws IOException {
         final Object id = context.read(buffer);
-        final String label = context.readValue(buffer, String.class, false);
+        // reading single string value for now according to GraphBinaryV4
+        final String label = (String) context.readValue(buffer, ArrayList.class, false).get(0);
 
         final Object inVId = context.read(buffer);
-        final String inVLabel = context.readValue(buffer, String.class, false);
+        // reading single string value for now according to GraphBinaryV4
+        final String inVLabel = (String) context.readValue(buffer, ArrayList.class, false).get(0);
         final Object outVId = context.read(buffer);
-        final String outVLabel = context.readValue(buffer, String.class, false);
+        // reading single string value for now according to GraphBinaryV4
+        final String outVLabel = (String) context.readValue(buffer, ArrayList.class, false).get(0);
 
         // discard the parent vertex
         context.read(buffer);
@@ -72,12 +77,13 @@ public class EdgeSerializer extends SimpleTypeSerializer<Edge> {
     protected void writeValue(final Edge value, final Buffer buffer, final GraphBinaryWriter context) throws IOException {
 
         context.write(value.id(), buffer);
-        context.writeValue(value.label(), buffer, false);
+        // serializing label as list here for now according to GraphBinaryV4
+        context.writeValue(Collections.singletonList(value.label()), buffer, false);
 
         context.write(value.inVertex().id(), buffer);
-        context.writeValue(value.inVertex().label(), buffer, false);
+        context.writeValue(Collections.singletonList(value.inVertex().label()), buffer, false);
         context.write(value.outVertex().id(), buffer);
-        context.writeValue(value.outVertex().label(), buffer, false);
+        context.writeValue(Collections.singletonList(value.outVertex().label()), buffer, false);
 
         // we don't serialize the parent Vertex for edges.
         context.write(null, buffer);
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/VertexPropertySerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/VertexPropertySerializer.java
index dd3afbec05..7c0297cabf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/VertexPropertySerializer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/VertexPropertySerializer.java
@@ -28,6 +28,7 @@ import org.apache.tinkerpop.gremlin.structure.io.Buffer;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
@@ -44,7 +45,7 @@ public class VertexPropertySerializer extends SimpleTypeSerializer<VertexPropert
     protected VertexProperty readValue(final Buffer buffer, final GraphBinaryReader context) throws IOException {
         final DetachedVertexProperty.Builder builder = DetachedVertexProperty.build()
                 .setId(context.read(buffer))
-                .setLabel(context.readValue(buffer, String.class, false))
+                .setLabel((String) context.readValue(buffer, ArrayList.class, false).get(0))
                 .setValue(context.read(buffer));
 
         // discard the parent vertex - we only send "references"
@@ -61,7 +62,8 @@ public class VertexPropertySerializer extends SimpleTypeSerializer<VertexPropert
     @Override
     protected void writeValue(final VertexProperty value, final Buffer buffer, final GraphBinaryWriter context) throws IOException {
         context.write(value.id(), buffer);
-        context.writeValue(value.label(), buffer, false);
+        // serializing label as list here for now according to GraphBinaryV4
+        context.writeValue(Collections.singletonList(value.label()), buffer, false);
         context.write(value.value(), buffer);
 
         // we don't serialize the parent vertex, let's hold a place for it
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/VertexSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/VertexSerializer.java
index f25055e9a2..ea2a2e77d8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/VertexSerializer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/VertexSerializer.java
@@ -28,6 +28,8 @@ import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
 
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -41,7 +43,8 @@ public class VertexSerializer extends SimpleTypeSerializer<Vertex> {
     @Override
     protected Vertex readValue(final Buffer buffer, final GraphBinaryReader context) throws IOException {
         final Object id = context.read(buffer);
-        final String label = context.readValue(buffer, String.class, false);
+        // reading single string value for now according to GraphBinaryV4
+        final String label = (String) context.readValue(buffer, ArrayList.class, false).get(0);
         final List<DetachedVertexProperty> properties = context.read(buffer);
 
         final DetachedVertex.Builder builder = DetachedVertex.build().setId(id).setLabel(label);
@@ -58,7 +61,8 @@ public class VertexSerializer extends SimpleTypeSerializer<Vertex> {
     @Override
     protected void writeValue(final Vertex value, final Buffer buffer, final GraphBinaryWriter context) throws IOException {
         context.write(value.id(), buffer);
-        context.writeValue(value.label(), buffer, false);
+        // serializing label as list here for now according to GraphBinaryV4
+        context.writeValue(Collections.singletonList(value.label()), buffer, false);
         if (value.properties() == null) {
             context.write(null, buffer);
         }


(tinkerpop) 03/03: Update v4 gbin compatibility test files according to new serialization updates

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiazcy pushed a commit to branch graphbinary-label-list
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit a77ef9c7ccca6c8e1d4bf56244a38127831905f3
Author: Yang Xia <55...@users.noreply.github.com>
AuthorDate: Mon Sep 16 21:10:56 2024 -0700

    Update v4 gbin compatibility test files according to new serialization updates
---
 CHANGELOG.asciidoc                                    |   1 +
 .../structure/io/binary/types/GraphSerializer.java    |  17 +++++++++++------
 .../structure/io/graphbinary/bulked-traverser-v4.gbin | Bin 81 -> 93 bytes
 .../io/graphbinary/max-offsetdatetime-v4.gbin         | Bin 20 -> 20 bytes
 .../io/graphbinary/meta-vertexproperty-v4.gbin        | Bin 55 -> 61 bytes
 .../io/graphbinary/min-offsetdatetime-v4.gbin         | Bin 20 -> 20 bytes
 .../structure/io/graphbinary/no-prop-edge-v4.gbin     | Bin 62 -> 80 bytes
 .../structure/io/graphbinary/no-prop-vertex-v4.gbin   | Bin 24 -> 30 bytes
 .../structure/io/graphbinary/prop-path-v4.gbin        | Bin 575 -> 635 bytes
 .../set-cardinality-vertexproperty-v4.gbin            | Bin 72 -> 78 bytes
 .../structure/io/graphbinary/tinker-graph-v4.gbin     | Bin 2264 -> 2504 bytes
 .../structure/io/graphbinary/traversal-edge-v4.gbin   | Bin 81 -> 99 bytes
 .../structure/io/graphbinary/traversal-path-v4.gbin   | Bin 108 -> 126 bytes
 .../structure/io/graphbinary/traversal-tree-v4.gbin   | Bin 152 -> 176 bytes
 .../structure/io/graphbinary/traversal-vertex-v4.gbin | Bin 405 -> 441 bytes
 .../io/graphbinary/traversal-vertexproperty-v4.gbin   | Bin 39 -> 45 bytes
 .../structure/io/graphbinary/var-type-map-v4.gbin     | Bin 79 -> 95 bytes
 .../structure/io/graphbinary/vertex-traverser-v4.gbin | Bin 415 -> 451 bytes
 .../apache/tinkerpop/gremlin/structure/io/Model.java  |   7 ++++---
 19 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index e561a2154e..6aaf4aa92d 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -65,6 +65,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Remove serializers for datatype removed from GraphBinaryV4 IO spec.
 * Add `DateTime` serializer for Java and Python according to GraphBinaryV4 IO spec.
 * Replaced `Date` with `OffsetDateTime` in Java core.
+* Update serializers for `label` as a singleton list of string according to GraphBinaryV4 IO spec.
 * The `maxContentLength` setting for Gremlin Driver has been renamed to `maxResponseContentLength` and now blocks incoming responses that are too large based on total response size.
 * The `maxContentLength` setting for Gremlin Server has been renamed to `maxRequestContentLength`.
 
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/GraphSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/GraphSerializer.java
index f107b8afac..d81ce100c9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/GraphSerializer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/GraphSerializer.java
@@ -35,6 +35,7 @@ import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -63,12 +64,13 @@ public class GraphSerializer extends SimpleTypeSerializer<Graph> {
             final Graph graph = (Graph) openMethod.invoke(null, conf);
             final int vertexCount = context.readValue(buffer, Integer.class, false);
             for (int ix = 0; ix < vertexCount; ix++) {
-                final Vertex v = graph.addVertex(T.id, context.read(buffer), T.label, context.readValue(buffer, String.class, false));
+                final Vertex v = graph.addVertex(T.id, context.read(buffer), T.label, context.readValue(buffer, ArrayList.class, false).get(0));
                 final int vertexPropertyCount = context.readValue(buffer, Integer.class, false);
 
                 for (int iy = 0; iy < vertexPropertyCount; iy++) {
                     final Object id = context.read(buffer);
-                    final String label = context.readValue(buffer, String.class, false);
+                    // reading single string value for now according to GraphBinaryV4
+                    final String label = (String) context.readValue(buffer, ArrayList.class, false).get(0);
                     final Object val = context.read(buffer);
                     context.read(buffer); // toss parent as it's always null
                     final VertexProperty<Object> vp = v.property(VertexProperty.Cardinality.list, label, val, T.id, id);
@@ -83,7 +85,8 @@ public class GraphSerializer extends SimpleTypeSerializer<Graph> {
             final int edgeCount = context.readValue(buffer, Integer.class, false);
             for (int ix = 0; ix < edgeCount; ix++) {
                 final Object id = context.read(buffer);
-                final String label = context.readValue(buffer, String.class, false);
+                // reading single string value for now according to GraphBinaryV4
+                final String label = (String) context.readValue(buffer, ArrayList.class, false).get(0);
                 final Object inId = context.read(buffer);
                 final Vertex inV = graph.vertices(inId).next();
                 context.read(buffer);  // toss in label - always null in this context
@@ -131,12 +134,13 @@ public class GraphSerializer extends SimpleTypeSerializer<Graph> {
         final List<VertexProperty<Object>> vertexProperties = IteratorUtils.list(vertex.properties());
 
         context.write(vertex.id(), buffer);
-        context.writeValue(vertex.label(), buffer, false);
+        // serializing label as list here for now according to GraphBinaryV4
+        context.writeValue(Collections.singletonList(vertex.label()), buffer, false);
         context.writeValue(vertexProperties.size(), buffer, false);
 
         for (VertexProperty<Object> vp : vertexProperties) {
             context.write(vp.id(), buffer);
-            context.writeValue(vp.label(), buffer, false);
+            context.writeValue(Collections.singletonList(vp.label()), buffer, false);
             context.write(vp.value(), buffer);
 
             // maintain the VertexProperty format we have with this empty parent.........
@@ -149,7 +153,8 @@ public class GraphSerializer extends SimpleTypeSerializer<Graph> {
 
     private void writeEdge(Buffer buffer, GraphBinaryWriter context, Edge edge) throws IOException {
         context.write(edge.id(), buffer);
-        context.writeValue(edge.label(), buffer, false);
+        // serializing label as list here for now according to GraphBinaryV4
+        context.writeValue(Collections.singletonList(edge.label()), buffer, false);
 
         context.write(edge.inVertex().id(), buffer);
 
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/bulked-traverser-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/bulked-traverser-v4.gbin
index ec0a589053..8878bbec8e 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/bulked-traverser-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/bulked-traverser-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/max-offsetdatetime-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/max-offsetdatetime-v4.gbin
index 620169668a..e59db1ee46 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/max-offsetdatetime-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/max-offsetdatetime-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/meta-vertexproperty-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/meta-vertexproperty-v4.gbin
index f06f76cbc4..dd181d43da 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/meta-vertexproperty-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/meta-vertexproperty-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/min-offsetdatetime-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/min-offsetdatetime-v4.gbin
index b915bea8ca..e1ca5d6caf 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/min-offsetdatetime-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/min-offsetdatetime-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/no-prop-edge-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/no-prop-edge-v4.gbin
index 201264742c..17ebdda413 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/no-prop-edge-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/no-prop-edge-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/no-prop-vertex-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/no-prop-vertex-v4.gbin
index cb85436422..462187167c 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/no-prop-vertex-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/no-prop-vertex-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/prop-path-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/prop-path-v4.gbin
index 9306df5aa8..4213e12a18 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/prop-path-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/prop-path-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/set-cardinality-vertexproperty-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/set-cardinality-vertexproperty-v4.gbin
index 133922bb45..a5ee87ec28 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/set-cardinality-vertexproperty-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/set-cardinality-vertexproperty-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/tinker-graph-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/tinker-graph-v4.gbin
index a0a76d1396..c1f53cba3a 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/tinker-graph-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/tinker-graph-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-edge-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-edge-v4.gbin
index f5404427d4..25b658ecd1 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-edge-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-edge-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-path-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-path-v4.gbin
index 5a0a2e5ef3..fda24e98c5 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-path-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-path-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-tree-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-tree-v4.gbin
index 5e589e15f7..e1112df6e9 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-tree-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-tree-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-vertex-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-vertex-v4.gbin
index 4347734a13..6b592bf0f2 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-vertex-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-vertex-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-vertexproperty-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-vertexproperty-v4.gbin
index 8ddbebdefc..4120d8c419 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-vertexproperty-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/traversal-vertexproperty-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/var-type-map-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/var-type-map-v4.gbin
index e2d511ef03..66d876a173 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/var-type-map-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/var-type-map-v4.gbin differ
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/vertex-traverser-v4.gbin b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/vertex-traverser-v4.gbin
index 2448b5c74f..46e02df795 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/vertex-traverser-v4.gbin and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphbinary/vertex-traverser-v4.gbin differ
diff --git a/gremlin-util/src/test/java/org/apache/tinkerpop/gremlin/structure/io/Model.java b/gremlin-util/src/test/java/org/apache/tinkerpop/gremlin/structure/io/Model.java
index 2e309d4fb1..52db0ce318 100644
--- a/gremlin-util/src/test/java/org/apache/tinkerpop/gremlin/structure/io/Model.java
+++ b/gremlin-util/src/test/java/org/apache/tinkerpop/gremlin/structure/io/Model.java
@@ -38,7 +38,9 @@ import java.math.BigInteger;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 import java.time.Duration;
+import java.time.Instant;
 import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
 import java.time.temporal.ChronoUnit;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -105,9 +107,8 @@ public class Model {
 
         final Map<Object,Object> map = new HashMap<>();
         map.put("test", 123);
-        map.put(new Date(1481295L), "red");
-        map.put(Arrays.asList(1,2,3), new Date(1481295L));
-        map.put(null, null);
+        map.put(OffsetDateTime.ofInstant(Instant.ofEpochMilli(1481295L), ZoneOffset.UTC), "red");
+        map.put(Arrays.asList(1,2,3), OffsetDateTime.ofInstant(Instant.ofEpochMilli(1481295L), ZoneOffset.UTC));
         addCoreEntry(map, "var-type-map", "Map is redefined so that to provide the ability to allow for non-String keys, which is not possible in JSON.");
         addCoreEntry(Collections.EMPTY_MAP, "empty-map");