This is an automated email from the ASF dual-hosted git repository. kenhuuu pushed a commit to branch v4-graphson-props in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 3d3c9148c901af862ce4cefc6c7e07b75a0a3add Author: Ken Hu <[email protected]> AuthorDate: Thu Oct 3 16:31:21 2024 -0700 Make properties optional in GraphSONv4 again CTR --- docs/src/dev/io/graphson.asciidoc | 98 ++++++++-------------- .../io/graphson/GraphSONSerializersV4.java | 37 ++++---- .../structure/io/graphson/GraphSONMapperTest.java | 6 +- .../server/GremlinServerHttpIntegrateTest.java | 2 +- .../structure/io/graphson/bulked-traverser-v4.json | 3 +- .../structure/io/graphson/no-prop-edge-v4.json | 3 +- .../structure/io/graphson/no-prop-vertex-v4.json | 3 +- .../structure/io/graphson/prop-path-v4.json | 9 +- .../structure/io/graphson/tinker-graph-v4.json | 21 ++--- .../io/graphson/traversal-path-v4-no-types.json | 9 +- .../structure/io/graphson/traversal-path-v4.json | 9 +- .../structure/io/graphson/traversal-tree-v4.json | 6 +- .../io/graphson/traversal-vertex-v4-no-types.json | 3 +- .../structure/io/graphson/traversal-vertex-v4.json | 3 +- .../traversal-vertexproperty-v4-no-types.json | 3 +- .../io/graphson/traversal-vertexproperty-v4.json | 3 +- .../structure/io/graphson/vertex-traverser-v4.json | 3 +- .../io/AbstractUntypedCompatibilityTest.java | 6 +- 18 files changed, 88 insertions(+), 139 deletions(-) diff --git a/docs/src/dev/io/graphson.asciidoc b/docs/src/dev/io/graphson.asciidoc index ae777fd191..140b648f83 100644 --- a/docs/src/dev/io/graphson.asciidoc +++ b/docs/src/dev/io/graphson.asciidoc @@ -424,10 +424,10 @@ JSON String form of UUID. ==== Edge -JSON Object (required keys are: id, label, inVLabel, outVLabel, inV, outV, properties) + +JSON Object (required keys are: id, label, inVLabel, outVLabel, inV, outV) + "id", "inV", "outV" is any GraphSON 4.0 type + "label", "inVLabel", "outVLabel" value is a `g:List` of `String` + -"properties" is an Object containing Arrays of `g:Property` +"properties" is an optional Object containing Arrays of `g:Property` The untyped version has one additional required key "type" which is always "vertex". @@ -534,8 +534,7 @@ two required keys: "vertices" and "edges" + "value": "marko", "label": [ "name" - ], - "properties": {} + ] } } ], @@ -654,8 +653,7 @@ two required keys: "vertices" and "edges" + "value": "stephen", "label": [ "name" - ], - "properties": {} + ] } } ], @@ -751,8 +749,7 @@ two required keys: "vertices" and "edges" + "value": "matthias", "label": [ "name" - ], - "properties": {} + ] } } ], @@ -871,8 +868,7 @@ two required keys: "vertices" and "edges" + "value": "daniel", "label": [ "name" - ], - "properties": {} + ] } } ], @@ -968,8 +964,7 @@ two required keys: "vertices" and "edges" + "value": "gremlin", "label": [ "name" - ], - "properties": {} + ] } } ] @@ -998,8 +993,7 @@ two required keys: "vertices" and "edges" + "value": "tinkergraph", "label": [ "name" - ], - "properties": {} + ] } } ] @@ -1551,8 +1545,7 @@ two required keys: "vertices" and "edges" + "outV": { "@type": "g:Int32", "@value": 10 - }, - "properties": {} + } } } ] @@ -1574,8 +1567,7 @@ two required keys: "vertices" and "edges" + "name": [ { "id": 0, - "value": "marko", - "properties": {} + "value": "marko" } ], "location": [ @@ -1623,8 +1615,7 @@ two required keys: "vertices" and "edges" + "name": [ { "id": 1, - "value": "stephen", - "properties": {} + "value": "stephen" } ], "location": [ @@ -1664,8 +1655,7 @@ two required keys: "vertices" and "edges" + "name": [ { "id": 2, - "value": "matthias", - "properties": {} + "value": "matthias" } ], "location": [ @@ -1713,8 +1703,7 @@ two required keys: "vertices" and "edges" + "name": [ { "id": 3, - "value": "daniel", - "properties": {} + "value": "daniel" } ], "location": [ @@ -1754,8 +1743,7 @@ two required keys: "vertices" and "edges" + "name": [ { "id": 4, - "value": "gremlin", - "properties": {} + "value": "gremlin" } ] } @@ -1770,8 +1758,7 @@ two required keys: "vertices" and "edges" + "name": [ { "id": 5, - "value": "tinkergraph", - "properties": {} + "value": "tinkergraph" } ] } @@ -2051,8 +2038,7 @@ two required keys: "vertices" and "edges" + "software" ], "inV": 11, - "outV": 10, - "properties": {} + "outV": 10 } ] } @@ -2098,8 +2084,7 @@ Object with two required keys: "labels" and "objects" + }, "label": [ "person" - ], - "properties": {} + ] } }, { @@ -2111,8 +2096,7 @@ Object with two required keys: "labels" and "objects" + }, "label": [ "software" - ], - "properties": {} + ] } }, { @@ -2124,8 +2108,7 @@ Object with two required keys: "labels" and "objects" + }, "label": [ "software" - ], - "properties": {} + ] } } ] @@ -2148,24 +2131,21 @@ Object with two required keys: "labels" and "objects" + "label": [ "person" ], - "type": "vertex", - "properties": {} + "type": "vertex" }, { "id": 10, "label": [ "software" ], - "type": "vertex", - "properties": {} + "type": "vertex" }, { "id": 11, "label": [ "software" ], - "type": "vertex", - "properties": {} + "type": "vertex" } ] } @@ -2233,8 +2213,7 @@ JSON Object with one or more possibly nested "key" "value" pairs "value": "gremlin", "label": [ "name" - ], - "properties": {} + ] } } ] @@ -2267,8 +2246,7 @@ JSON Object with one or more possibly nested "key" "value" pairs "value": "tinkergraph", "label": [ "name" - ], - "properties": {} + ] } } ] @@ -2301,8 +2279,7 @@ JSON Object with one or more possibly nested "key" "value" pairs "name": [ { "id": 4, - "value": "gremlin", - "properties": {} + "value": "gremlin" } ] } @@ -2319,8 +2296,7 @@ JSON Object with one or more possibly nested "key" "value" pairs "name": [ { "id": 5, - "value": "tinkergraph", - "properties": {} + "value": "tinkergraph" } ] } @@ -2337,7 +2313,7 @@ JSON Object with one or more possibly nested "key" "value" pairs JSON Object with required keys: "id", "label", "properties" + "id" is any GraphSON 4.0 type + "label" is a `g:List` of `String` + -"properties" is an Object containing Arrays of `g:VertexProperty` +"properties" is an optional Object containing Arrays of `g:VertexProperty` The untyped version has one additional required key "type" which is always "vertex". @@ -2365,8 +2341,7 @@ The untyped version has one additional required key "type" which is always "vert "value": "marko", "label": [ "name" - ], - "properties": {} + ] } } ], @@ -2477,8 +2452,7 @@ The untyped version has one additional required key "type" which is always "vert "name": [ { "id": 0, - "value": "marko", - "properties": {} + "value": "marko" } ], "location": [ @@ -2524,7 +2498,7 @@ JOSN Object with required keys: "id", "value", "label", "properties" + "id" is any type GraphSON 4.0 type + "value" is any type GraphSON 4.0 type + "label" is a `g:List` of `String` + -"properties" is an Object containing Arrays of "g:Property" (metaproperties) +"properties" is an optional Object containing Arrays of "g:Property" (metaproperties) [source,json] ---- @@ -2538,8 +2512,7 @@ JOSN Object with required keys: "id", "value", "label", "properties" + "value": "marko", "label": [ "name" - ], - "properties": {} + ] } } ---- @@ -2551,8 +2524,7 @@ JOSN Object with required keys: "id", "value", "label", "properties" + "value": "marko", "label": [ "name" - ], - "properties": {} + ] } ---- @@ -2683,8 +2655,7 @@ The following `ResponseMessage` is a typical example of the typical successful r "value": "marko", "label": [ "name" - ], - "properties": {} + ] } } ], @@ -2805,8 +2776,7 @@ The following `ResponseMessage` is a typical example of the typical successful r "name": [ { "id": 0, - "value": "marko", - "properties": {} + "value": "marko" } ], "location": [ diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV4.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV4.java index 51af208b14..14af4fe71a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV4.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV4.java @@ -108,6 +108,8 @@ class GraphSONSerializersV4 { } private void writeProperties(final Vertex vertex, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) throws IOException { + if (vertex.keys().size() == 0) + return; jsonGenerator.writeFieldName(GraphSONTokens.PROPERTIES); jsonGenerator.writeStartObject(); @@ -172,23 +174,25 @@ class GraphSONSerializersV4 { final Iterator<Property<Object>> elementProperties = normalize ? IteratorUtils.list(edge.properties(), Comparators.PROPERTY_COMPARATOR).iterator() : edge.properties(); - jsonGenerator.writeFieldName(GraphSONTokens.PROPERTIES); - jsonGenerator.writeStartObject(); + if (elementProperties.hasNext()) { + jsonGenerator.writeFieldName(GraphSONTokens.PROPERTIES); + jsonGenerator.writeStartObject(); - while (elementProperties.hasNext()) { - final Property prop = elementProperties.next(); - jsonGenerator.writeFieldName(prop.key()); - jsonGenerator.writeStartArray(); + while (elementProperties.hasNext()) { + final Property prop = elementProperties.next(); + jsonGenerator.writeFieldName(prop.key()); + jsonGenerator.writeStartArray(); - if (typeInfo == TypeInfo.NO_TYPES) { - jsonGenerator.writeObject(prop.value()); - } else { - jsonGenerator.writeObject(prop); - } + if (typeInfo == TypeInfo.NO_TYPES) { + jsonGenerator.writeObject(prop.value()); + } else { + jsonGenerator.writeObject(prop); + } - jsonGenerator.writeEndArray(); + jsonGenerator.writeEndArray(); + } + jsonGenerator.writeEndObject(); } - jsonGenerator.writeEndObject(); } } @@ -246,11 +250,14 @@ class GraphSONSerializersV4 { // when "detached" you can't check features of the graph it detached from so it has to be // treated differently from a regular VertexProperty implementation. if (property instanceof DetachedVertexProperty) { - writeMetaProperties(property, jsonGenerator, normalize); + // only write meta properties key if they exist + if (property.properties().hasNext()) { + writeMetaProperties(property, jsonGenerator, normalize); + } } else { // still attached - so we can check the features to see if it's worth even trying to write the // meta properties key - if (property.graph().features().vertex().supportsMetaProperties()) { + if (property.graph().features().vertex().supportsMetaProperties() && property.properties().hasNext()) { writeMetaProperties(property, jsonGenerator, normalize); } } diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperTest.java index d6931b9a1e..0adccc7580 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperTest.java @@ -93,7 +93,7 @@ public class GraphSONMapperTest { else if (version.startsWith("v2")) assertEquals("{\"id\":123,\"label\":\"person\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"alice\",\"label\":\"name\"}],\"age\":[{\"id\":1,\"value\":\"31\",\"label\":\"age\"}]}}", json); else if (version.startsWith("v4")) - assertEquals("{\"id\":123,\"label\":[\"person\"],\"type\":\"vertex\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"alice\",\"properties\":{}}],\"age\":[{\"id\":1,\"value\":\"31\",\"properties\":{}}]}}", json); + assertEquals("{\"id\":123,\"label\":[\"person\"],\"type\":\"vertex\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"alice\"}],\"age\":[{\"id\":1,\"value\":\"31\"}]}}", json); else throw new IllegalStateException("Version not accounted for in asserts"); } @@ -146,7 +146,7 @@ public class GraphSONMapperTest { final VertexProperty p = new DetachedVertexProperty(123L, "name", "alice", Collections.emptyMap(), v); final String json = mapper.writeValueAsString(p); if (version.startsWith("v4")) { - assertEquals("{\"id\":123,\"value\":\"alice\",\"label\":[\"name\"],\"properties\":{}}", json); + assertEquals("{\"id\":123,\"value\":\"alice\",\"label\":[\"name\"]}", json); } else { assertEquals("{\"id\":123,\"value\":\"alice\",\"label\":\"name\"}", json); } @@ -165,7 +165,7 @@ public class GraphSONMapperTest { if (version.startsWith("v1") || version.startsWith("v3")) assertEquals("{\"labels\":[[\"a\"],[\"b\"],[\"c\"]],\"objects\":[{\"id\":123,\"label\":\"person\",\"type\":\"vertex\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"alice\"}],\"age\":[{\"id\":1,\"value\":\"31\"}]}},123,\"alice\"]}", json); else if (version.startsWith("v4")) - assertEquals("{\"labels\":[[\"a\"],[\"b\"],[\"c\"]],\"objects\":[{\"id\":123,\"label\":[\"person\"],\"type\":\"vertex\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"alice\",\"properties\":{}}],\"age\":[{\"id\":1,\"value\":\"31\",\"properties\":{}}]}},123,\"alice\"]}", json); + assertEquals("{\"labels\":[[\"a\"],[\"b\"],[\"c\"]],\"objects\":[{\"id\":123,\"label\":[\"person\"],\"type\":\"vertex\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"alice\"}],\"age\":[{\"id\":1,\"value\":\"31\"}]}},123,\"alice\"]}", json); else assertEquals("{\"labels\":[[\"a\"],[\"b\"],[\"c\"]],\"objects\":[{\"id\":123,\"label\":\"person\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"alice\",\"label\":\"name\"}],\"age\":[{\"id\":1,\"value\":\"31\",\"label\":\"age\"}]}},123,\"alice\"]}", json); } diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java index 72d9ad893d..061a053a15 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java @@ -1277,7 +1277,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra final String json = EntityUtils.toString(response.getEntity()); final JsonNode node = mapper.readTree(json); - assertTrue(node.get("result").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).get(GraphSONTokens.PROPERTIES).isEmpty()); + assertNull(node.get("result").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).get(GraphSONTokens.PROPERTIES)); } } diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/bulked-traverser-v4.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/bulked-traverser-v4.json index 27df3529c9..c954e4e9af 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/bulked-traverser-v4.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/bulked-traverser-v4.json @@ -22,8 +22,7 @@ "@value" : 5 }, "value" : "tinkergraph", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ] } diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/no-prop-edge-v4.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/no-prop-edge-v4.json index 9efced22c4..1c779c8349 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/no-prop-edge-v4.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/no-prop-edge-v4.json @@ -15,7 +15,6 @@ "outV" : { "@type" : "g:Int32", "@value" : 1 - }, - "properties" : { } + } } } \ No newline at end of file diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/no-prop-vertex-v4.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/no-prop-vertex-v4.json index 272638f730..a26f344e90 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/no-prop-vertex-v4.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/no-prop-vertex-v4.json @@ -5,7 +5,6 @@ "@type" : "g:Int32", "@value" : 1 }, - "label" : [ "person" ], - "properties" : { } + "label" : [ "person" ] } } \ No newline at end of file diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/prop-path-v4.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/prop-path-v4.json index f35d72bf15..a1c42274a5 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/prop-path-v4.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/prop-path-v4.json @@ -33,8 +33,7 @@ "@value" : 0 }, "value" : "marko", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ], "location" : [ { @@ -133,8 +132,7 @@ "@value" : 4 }, "value" : "gremlin", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ] } @@ -156,8 +154,7 @@ "@value" : 5 }, "value" : "tinkergraph", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ] } diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinker-graph-v4.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinker-graph-v4.json index 241b56604b..e322cfa7d7 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinker-graph-v4.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinker-graph-v4.json @@ -18,8 +18,7 @@ "@value" : 0 }, "value" : "marko", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ], "location" : [ { @@ -118,8 +117,7 @@ "@value" : 1 }, "value" : "stephen", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ], "location" : [ { @@ -198,8 +196,7 @@ "@value" : 2 }, "value" : "matthias", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ], "location" : [ { @@ -298,8 +295,7 @@ "@value" : 3 }, "value" : "daniel", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ], "location" : [ { @@ -378,8 +374,7 @@ "@value" : 4 }, "value" : "gremlin", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ] } @@ -401,8 +396,7 @@ "@value" : 5 }, "value" : "tinkergraph", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ] } @@ -828,8 +822,7 @@ "outV" : { "@type" : "g:Int32", "@value" : 10 - }, - "properties" : { } + } } } ] } diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-path-v4-no-types.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-path-v4-no-types.json index 060c0f9d49..b151aed365 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-path-v4-no-types.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-path-v4-no-types.json @@ -3,17 +3,14 @@ "objects" : [ { "id" : 1, "label" : [ "person" ], - "type" : "vertex", - "properties" : { } + "type" : "vertex" }, { "id" : 10, "label" : [ "software" ], - "type" : "vertex", - "properties" : { } + "type" : "vertex" }, { "id" : 11, "label" : [ "software" ], - "type" : "vertex", - "properties" : { } + "type" : "vertex" } ] } \ No newline at end of file diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-path-v4.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-path-v4.json index c291323752..046bb5b33b 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-path-v4.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-path-v4.json @@ -23,8 +23,7 @@ "@type" : "g:Int32", "@value" : 1 }, - "label" : [ "person" ], - "properties" : { } + "label" : [ "person" ] } }, { "@type" : "g:Vertex", @@ -33,8 +32,7 @@ "@type" : "g:Int32", "@value" : 10 }, - "label" : [ "software" ], - "properties" : { } + "label" : [ "software" ] } }, { "@type" : "g:Vertex", @@ -43,8 +41,7 @@ "@type" : "g:Int32", "@value" : 11 }, - "label" : [ "software" ], - "properties" : { } + "label" : [ "software" ] } } ] } diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-tree-v4.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-tree-v4.json index acfb6fb925..b6acb5684f 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-tree-v4.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-tree-v4.json @@ -18,8 +18,7 @@ "@value" : 4 }, "value" : "gremlin", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ] } @@ -45,8 +44,7 @@ "@value" : 5 }, "value" : "tinkergraph", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ] } diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertex-v4-no-types.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertex-v4-no-types.json index e2418dac20..49b4270c81 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertex-v4-no-types.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertex-v4-no-types.json @@ -5,8 +5,7 @@ "properties" : { "name" : [ { "id" : 0, - "value" : "marko", - "properties" : { } + "value" : "marko" } ], "location" : [ { "id" : 6, diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertex-v4.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertex-v4.json index f6a81d70b3..14d42323af 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertex-v4.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertex-v4.json @@ -15,8 +15,7 @@ "@value" : 0 }, "value" : "marko", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ], "location" : [ { diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertexproperty-v4-no-types.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertexproperty-v4-no-types.json index dc096869f6..666b12cc77 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertexproperty-v4-no-types.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertexproperty-v4-no-types.json @@ -1,6 +1,5 @@ { "id" : 0, "value" : "marko", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } \ No newline at end of file diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertexproperty-v4.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertexproperty-v4.json index 726823e926..81fed517e7 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertexproperty-v4.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/traversal-vertexproperty-v4.json @@ -6,7 +6,6 @@ "@value" : 0 }, "value" : "marko", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } \ No newline at end of file diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/vertex-traverser-v4.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/vertex-traverser-v4.json index 08c15e96da..91dcb6d8ea 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/vertex-traverser-v4.json +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/vertex-traverser-v4.json @@ -22,8 +22,7 @@ "@value" : 0 }, "value" : "marko", - "label" : [ "name" ], - "properties" : { } + "label" : [ "name" ] } } ], "location" : [ { diff --git a/gremlin-util/src/test/java/org/apache/tinkerpop/gremlin/structure/io/AbstractUntypedCompatibilityTest.java b/gremlin-util/src/test/java/org/apache/tinkerpop/gremlin/structure/io/AbstractUntypedCompatibilityTest.java index bfa600e2f2..8b6540b8fc 100644 --- a/gremlin-util/src/test/java/org/apache/tinkerpop/gremlin/structure/io/AbstractUntypedCompatibilityTest.java +++ b/gremlin-util/src/test/java/org/apache/tinkerpop/gremlin/structure/io/AbstractUntypedCompatibilityTest.java @@ -194,15 +194,13 @@ public abstract class AbstractUntypedCompatibilityTest extends AbstractCompatibi final HashMap fromStatic = read(readFromResource(resourceName), HashMap.class); final HashMap recycled = read(bytes, HashMap.class); assertNotSame(fromStatic, recycled); - assertEquals(4, fromStatic.size()); + assertEquals(3, fromStatic.size()); assertEquals(resource.id().toString(), fromStatic.get("id").toString()); assertEquals(Collections.singletonList(resource.key()), fromStatic.get("label")); assertEquals(resource.value(), fromStatic.get("value")); - assertEquals(Collections.emptyMap(), fromStatic.get("properties")); - assertEquals(4, recycled.size()); + assertEquals(3, recycled.size()); assertEquals(resource.id().toString(), fromStatic.get("id").toString()); assertEquals(Collections.singletonList(resource.key()), recycled.get("label")); assertEquals(resource.value(), recycled.get("value")); - assertEquals(Collections.emptyMap(), recycled.get("properties")); } }
