You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2023/07/11 10:17:18 UTC

[tinkerpop] branch master updated (eac6b93ffe -> d8f192d128)

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

spmallette pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


    from eac6b93ffe Merge branch '3.6-dev'
     add 1fd8d192f5 Introduce new mimeType to use Graphson-1.0 text serializer
     add f8b6d1d411 Add UT for graphson-1.0 sparse mimetype
     new fc19bda0de Merge branch 'pr-2115' into 3.6-dev
     new dd4392a310 Minor formatting CTR
     new d8f192d128 Merge branch '3.6-dev'

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.


Summary of changes:
 CHANGELOG.asciidoc                                       |  1 +
 docs/src/reference/gremlin-applications.asciidoc         |  2 +-
 .../gremlin/server/GremlinServerHttpIntegrateTest.java   | 13 +++++++++++++
 .../gremlin/util/ser/GraphSONMessageSerializerV1d0.java  |  4 ++--
 .../gremlin/util/ser/GraphSONMessageSerializerV2d0.java  | 16 ++++++++--------
 .../org/apache/tinkerpop/gremlin/util/ser/SerTokens.java |  1 +
 .../apache/tinkerpop/gremlin/util/ser/Serializers.java   |  3 +++
 7 files changed, 29 insertions(+), 11 deletions(-)


[tinkerpop] 01/03: Merge branch 'pr-2115' into 3.6-dev

Posted by sp...@apache.org.
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

commit fc19bda0ded945654dde8fcab42005d15c4f4110
Merge: 8ea4d1fb6f f8b6d1d411
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Tue Jul 11 05:59:48 2023 -0400

    Merge branch 'pr-2115' into 3.6-dev

 CHANGELOG.asciidoc                                          |  1 +
 docs/src/reference/gremlin-applications.asciidoc            |  2 +-
 .../gremlin/driver/ser/GraphSONMessageSerializerV1d0.java   |  4 ++--
 .../org/apache/tinkerpop/gremlin/driver/ser/SerTokens.java  |  1 +
 .../apache/tinkerpop/gremlin/driver/ser/Serializers.java    |  3 +++
 .../gremlin/server/GremlinServerHttpIntegrateTest.java      | 13 +++++++++++++
 6 files changed, 21 insertions(+), 3 deletions(-)



[tinkerpop] 02/03: Minor formatting CTR

Posted by sp...@apache.org.
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

commit dd4392a310a0579bf5497705a1143c0081328b65
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Tue Jul 11 06:16:43 2023 -0400

    Minor formatting CTR
---
 CHANGELOG.asciidoc                                       |  2 +-
 .../driver/ser/GraphSONMessageSerializerV2d0.java        | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 18378b4798..3e0f0848d7 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -28,6 +28,7 @@ This release also includes changes from <<release-3-5-7, 3.5.7>>.
 * Added `text/plain` MIME type to the HTTP endpoint to return a Gremlin Console-like representation of the data.
 * Added GraphBinary serialization option to the HTTP endpoint.
 * Fixed bug with `fail` step not working with a `VertexProgram` running on the server.
+* Introduced new mime-type `application/vnd.gremlin-v1.0+json;sparse=true` to allow direct specification of GraphSON 1.0 without types.
 
 [[release-3-6-4]]
 === TinkerPop 3.6.4 (Release Date: May 12, 2023)
@@ -83,7 +84,6 @@ This release also includes changes from <<release-3-5-6, 3.5.6>>.
 * TINKERPOP-2925 mergeE() in javascript producing an error
 * TINKERPOP-2926 Gremlin-Java > An UnsupportedOperationException occurs on calling next() after a merge step with the option step modulator if the element does not exist
 * TINKERPOP-2928 element() not working in conjunction with edge properties
-* TINKERPOP-2963 Introduced new mime-type application/vnd.gremlin-v1.0+json;sparse=true to use GraphSON-1.0 in text format
 
 ==== Improvements
 
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV2d0.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV2d0.java
index 3442205923..058a393469 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV2d0.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV2d0.java
@@ -52,14 +52,14 @@ public final class GraphSONMessageSerializerV2d0 extends AbstractGraphSONMessage
         header = buffer.array();
     }
 
-        /**
-         * Creates a default GraphSONMessageSerializer.
-         *
-         * By default this will internally instantiate a {@link GraphSONMapper} and register
-         * a {@link GremlinServerModule} and {@link GraphSONXModuleV2d0} to the mapper.
-         *
-         * @see #GraphSONMessageSerializerV2d0(GraphSONMapper.Builder)
-         */
+    /**
+     * Creates a default GraphSONMessageSerializer.
+     *
+     * By default this will internally instantiate a {@link GraphSONMapper} and register
+     * a {@link GremlinServerModule} and {@link GraphSONXModuleV2d0} to the mapper.
+     *
+     * @see #GraphSONMessageSerializerV2d0(GraphSONMapper.Builder)
+     */
     public GraphSONMessageSerializerV2d0() {
         super();
     }


[tinkerpop] 03/03: Merge branch '3.6-dev'

Posted by sp...@apache.org.
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

commit d8f192d128b23cb547750087b149f5424b2cd1e2
Merge: eac6b93ffe dd4392a310
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Tue Jul 11 06:17:10 2023 -0400

    Merge branch '3.6-dev'

 CHANGELOG.asciidoc                                       |  1 +
 docs/src/reference/gremlin-applications.asciidoc         |  2 +-
 .../gremlin/server/GremlinServerHttpIntegrateTest.java   | 13 +++++++++++++
 .../gremlin/util/ser/GraphSONMessageSerializerV1d0.java  |  4 ++--
 .../gremlin/util/ser/GraphSONMessageSerializerV2d0.java  | 16 ++++++++--------
 .../org/apache/tinkerpop/gremlin/util/ser/SerTokens.java |  1 +
 .../apache/tinkerpop/gremlin/util/ser/Serializers.java   |  3 +++
 7 files changed, 29 insertions(+), 11 deletions(-)

diff --cc gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphSONMessageSerializerV1d0.java
index c1291bf498,0000000000..be3e2809d4
mode 100644,000000..100644
--- a/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphSONMessageSerializerV1d0.java
+++ b/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphSONMessageSerializerV1d0.java
@@@ -1,127 -1,0 +1,127 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + * http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.tinkerpop.gremlin.util.ser;
 +
 +import io.netty.buffer.ByteBufAllocator;
 +import org.apache.tinkerpop.gremlin.util.message.RequestMessage;
 +import org.apache.tinkerpop.gremlin.util.message.ResponseMessage;
 +import org.apache.tinkerpop.gremlin.util.message.ResponseStatusCode;
 +import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper;
 +import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion;
 +import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo;
 +import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import java.nio.ByteBuffer;
 +import java.util.Map;
 +import java.util.UUID;
 +
 +/**
 + * Serialize results to JSON with version 1.0.x schema.
 + *
 + * @author Stephen Mallette (http://stephen.genoprime.com)
 + */
 +public final class GraphSONMessageSerializerV1d0 extends AbstractGraphSONMessageSerializerV1d0 implements MessageTextSerializer<ObjectMapper> {
 +    private static final Logger logger = LoggerFactory.getLogger(GraphSONMessageSerializerV1d0.class);
-     private static final String MIME_TYPE = SerTokens.MIME_JSON;
++    private static final String MIME_TYPE = SerTokens.MIME_GRAPHSON_V1D0_SPARSE;
 +
 +    private static byte[] header;
 +
 +    static {
 +        final ByteBuffer buffer = ByteBuffer.allocate(MIME_TYPE.length() + 1);
 +        buffer.put((byte) MIME_TYPE.length());
 +        buffer.put(MIME_TYPE.getBytes());
 +        header = buffer.array();
 +    }
 +
 +    public GraphSONMessageSerializerV1d0() {
 +        super();
 +    }
 +
 +    public GraphSONMessageSerializerV1d0(final GraphSONMapper mapper) {
 +        super(mapper);
 +    }
 +
 +    @Override
 +    public String[] mimeTypesSupported() {
-         return new String[]{MIME_TYPE};
++        return new String[]{MIME_TYPE, SerTokens.MIME_JSON};
 +    }
 +
 +    @Override
 +    GraphSONMapper.Builder configureBuilder(final GraphSONMapper.Builder builder) {
 +        // already set to 1.0 in AbstractGraphSONMessageSerializerV1d0
 +        return builder.addCustomModule(new GremlinServerModule())
 +                .typeInfo(TypeInfo.NO_TYPES);
 +    }
 +
 +    @Override
 +    byte[] obtainHeader() {
 +        return header;
 +    }
 +
 +    @Override
 +    public ResponseMessage deserializeResponse(final String msg) throws SerializationException {
 +        try {
 +            final Map<String, Object> responseData = mapper.readValue(msg, mapTypeReference);
 +            final Map<String, Object> status = (Map<String, Object>) responseData.get(SerTokens.TOKEN_STATUS);
 +            final Map<String, Object> result = (Map<String, Object>) responseData.get(SerTokens.TOKEN_RESULT);
 +            return ResponseMessage.build(UUID.fromString(responseData.get(SerTokens.TOKEN_REQUEST).toString()))
 +                    .code(ResponseStatusCode.getFromValue((Integer) status.get(SerTokens.TOKEN_CODE)))
 +                    .statusMessage(String.valueOf(status.get(SerTokens.TOKEN_MESSAGE)))
 +                    .statusAttributes((Map<String, Object>) status.get(SerTokens.TOKEN_ATTRIBUTES))
 +                    .result(result.get(SerTokens.TOKEN_DATA))
 +                    .responseMetaData((Map<String, Object>) result.get(SerTokens.TOKEN_META))
 +                    .create();
 +        } catch (Exception ex) {
 +            logger.warn("Response [{}] could not be deserialized by {}.", msg, AbstractGraphSONMessageSerializerV1d0.class.getName());
 +            throw new SerializationException(ex);
 +        }
 +    }
 +
 +    @Override
 +    public String serializeResponseAsString(final ResponseMessage responseMessage, final ByteBufAllocator allocator) throws SerializationException {
 +        try {
 +            return mapper.writeValueAsString(responseMessage);
 +        } catch (Exception ex) {
 +            logger.warn("Response [{}] could not be serialized by {}.", responseMessage.toString(), AbstractGraphSONMessageSerializerV1d0.class.getName());
 +            throw new SerializationException(ex);
 +        }
 +    }
 +
 +    @Override
 +    public RequestMessage deserializeRequest(final String msg) throws SerializationException {
 +        try {
 +            return mapper.readValue(msg, RequestMessage.class);
 +        } catch (Exception ex) {
 +            logger.warn("Request [{}] could not be deserialized by {}.", msg, AbstractGraphSONMessageSerializerV1d0.class.getName());
 +            throw new SerializationException(ex);
 +        }
 +    }
 +
 +    @Override
 +    public String serializeRequestAsString(final RequestMessage requestMessage, final ByteBufAllocator allocator) throws SerializationException {
 +        try {
 +            return mapper.writeValueAsString(requestMessage);
 +        } catch (Exception ex) {
 +            logger.warn("Request [{}] could not be serialized by {}.", requestMessage.toString(), AbstractGraphSONMessageSerializerV1d0.class.getName());
 +            throw new SerializationException(ex);
 +        }
 +    }
 +}
diff --cc gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphSONMessageSerializerV2d0.java
index d0a434a90b,0000000000..24dbafc460
mode 100644,000000..100644
--- a/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphSONMessageSerializerV2d0.java
+++ b/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphSONMessageSerializerV2d0.java
@@@ -1,140 -1,0 +1,140 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + * http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.tinkerpop.gremlin.util.ser;
 +
 +import io.netty.buffer.ByteBufAllocator;
 +import org.apache.tinkerpop.gremlin.util.message.RequestMessage;
 +import org.apache.tinkerpop.gremlin.util.message.ResponseMessage;
 +import org.apache.tinkerpop.gremlin.util.message.ResponseStatusCode;
 +import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper;
 +import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion;
 +import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONXModuleV2d0;
 +import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo;
 +import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import java.nio.ByteBuffer;
 +
 +/**
 + * Serialize results to JSON with version 2.0.x schema and the extended module.
 + *
 + * @author Stephen Mallette (http://stephen.genoprime.com)
 + */
 +public final class GraphSONMessageSerializerV2d0 extends AbstractGraphSONMessageSerializerV2d0 implements MessageTextSerializer<ObjectMapper> {
 +    private static final Logger logger = LoggerFactory.getLogger(GraphSONMessageSerializerV2d0.class);
 +    private static final String MIME_TYPE = SerTokens.MIME_GRAPHSON_V2D0;
 +
 +    private static byte[] header;
 +
 +    static {
 +        final ByteBuffer buffer = ByteBuffer.allocate(MIME_TYPE.length() + 1);
 +        buffer.put((byte) MIME_TYPE.length());
 +        buffer.put(MIME_TYPE.getBytes());
 +        header = buffer.array();
 +    }
 +
-         /**
-          * Creates a default GraphSONMessageSerializer.
-          *
-          * By default this will internally instantiate a {@link GraphSONMapper} and register
-          * a {@link GremlinServerModule} and {@link GraphSONXModuleV2d0} to the mapper.
-          *
-          * @see #GraphSONMessageSerializerV2d0(GraphSONMapper.Builder)
-          */
++    /**
++     * Creates a default GraphSONMessageSerializer.
++     *
++     * By default this will internally instantiate a {@link GraphSONMapper} and register
++     * a {@link GremlinServerModule} and {@link GraphSONXModuleV2d0} to the mapper.
++     *
++     * @see #GraphSONMessageSerializerV2d0(GraphSONMapper.Builder)
++     */
 +    public GraphSONMessageSerializerV2d0() {
 +        super();
 +    }
 +
 +    /**
 +     * Create a GraphSONMessageSerializer from a {@link GraphSONMapper}. Deprecated, use
 +     * {@link #GraphSONMessageSerializerV2d0(GraphSONMapper.Builder)} instead.
 +     */
 +    @Deprecated
 +    public GraphSONMessageSerializerV2d0(final GraphSONMapper mapper) {
 +        super(mapper);
 +    }
 +
 +    /**
 +     * Create a GraphSONMessageSerializer with a provided {@link GraphSONMapper.Builder}.
 +     *
 +     * Note that to make this mapper usable in the context of request messages and responses,
 +     * this method will automatically register a {@link GremlinServerModule} to the provided
 +     * mapper.
 +     */
 +    public GraphSONMessageSerializerV2d0(final GraphSONMapper.Builder mapperBuilder) {
 +        super(mapperBuilder);
 +    }
 +
 +    @Override
 +    public String[] mimeTypesSupported() {
 +        return new String[]{MIME_TYPE, SerTokens.MIME_JSON};
 +    }
 +
 +    @Override
 +    GraphSONMapper.Builder configureBuilder(final GraphSONMapper.Builder builder) {
 +        // already set to 2.0 in AbstractGraphSONMessageSerializerV2d0
 +        return builder.typeInfo(TypeInfo.PARTIAL_TYPES).addCustomModule(new GremlinServerModule());
 +    }
 +
 +    @Override
 +    byte[] obtainHeader() {
 +        return header;
 +    }
 +
 +    @Override
 +    public ResponseMessage deserializeResponse(final String msg) throws SerializationException {
 +        try {
 +            return mapper.readValue(msg, ResponseMessage.class);
 +        } catch (Exception ex) {
 +            logger.warn("Response [{}] could not be deserialized by {}.", msg, AbstractGraphSONMessageSerializerV2d0.class.getName());
 +            throw new SerializationException(ex);
 +        }
 +    }
 +
 +    @Override
 +    public String serializeResponseAsString(final ResponseMessage responseMessage, final ByteBufAllocator allocator) throws SerializationException {
 +        try {
 +            return mapper.writeValueAsString(responseMessage);
 +        } catch (Exception ex) {
 +            logger.warn("Response [{}] could not be serialized by {}.", responseMessage.toString(), AbstractGraphSONMessageSerializerV2d0.class.getName());
 +            throw new SerializationException(ex);
 +        }
 +    }
 +
 +    @Override
 +    public RequestMessage deserializeRequest(final String msg) throws SerializationException {
 +        try {
 +            return mapper.readValue(msg, RequestMessage.class);
 +        } catch (Exception ex) {
 +            logger.warn("Request [{}] could not be deserialized by {}.", msg, AbstractGraphSONMessageSerializerV2d0.class.getName());
 +            throw new SerializationException(ex);
 +        }
 +    }
 +
 +    @Override
 +    public String serializeRequestAsString(final RequestMessage requestMessage, final ByteBufAllocator allocator) throws SerializationException {
 +        try {
 +            return mapper.writeValueAsString(requestMessage);
 +        } catch (Exception ex) {
 +            logger.warn("Request [{}] could not be serialized by {}.", requestMessage.toString(), AbstractGraphSONMessageSerializerV2d0.class.getName());
 +            throw new SerializationException(ex);
 +        }
 +    }
 +}
diff --cc gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/SerTokens.java
index bbc1a5ea22,0000000000..3ce6dbcab8
mode 100644,000000..100644
--- a/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/SerTokens.java
+++ b/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/SerTokens.java
@@@ -1,46 -1,0 +1,47 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + * http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.tinkerpop.gremlin.util.ser;
 +
 +import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.HaltedTraverserStrategy;
 +
 +/**
 + * @author Stephen Mallette (http://stephen.genoprime.com)
 + */
 +public final class SerTokens {
 +    private SerTokens() {}
 +
 +    public static final String TOKEN_ATTRIBUTES = "attributes";
 +    public static final String TOKEN_RESULT = "result";
 +    public static final String TOKEN_STATUS = "status";
 +    public static final String TOKEN_DATA = "data";
 +    public static final String TOKEN_META = "meta";
 +    public static final String TOKEN_CODE = "code";
 +    public static final String TOKEN_REQUEST = "requestId";
 +    public static final String TOKEN_MESSAGE = "message";
 +    public static final String TOKEN_PROCESSOR = "processor";
 +    public static final String TOKEN_OP = "op";
 +    public static final String TOKEN_ARGS = "args";
 +
 +    public static final String MIME_JSON = "application/json";
 +    public static final String MIME_GRAPHSON_V1D0 = "application/vnd.gremlin-v1.0+json";
++    public static final String MIME_GRAPHSON_V1D0_SPARSE = "application/vnd.gremlin-v1.0+json;sparse=true";
 +    public static final String MIME_GRAPHSON_V2D0 = "application/vnd.gremlin-v2.0+json";
 +    public static final String MIME_GRAPHSON_V3D0 = "application/vnd.gremlin-v3.0+json";
 +    public static final String MIME_GRAPHBINARY_V1D0 = "application/vnd.graphbinary-v1.0";
 +}
diff --cc gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/Serializers.java
index aea03691c9,0000000000..f14f55b5a5
mode 100644,000000..100644
--- a/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/Serializers.java
+++ b/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/Serializers.java
@@@ -1,65 -1,0 +1,68 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + * http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.tinkerpop.gremlin.util.ser;
 +
 +import org.apache.tinkerpop.gremlin.util.MessageSerializer;
 +import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.HaltedTraverserStrategy;
 +
 +/**
 + * An enum of the default serializers.
 + *
 + * @author Stephen Mallette (http://stephen.genoprime.com)
 + */
 +public enum Serializers {
 +
 +    /**
 +     * GraphSON 3.0.
 +     */
 +    GRAPHSON(SerTokens.MIME_JSON),
 +    GRAPHSON_V1D0(SerTokens.MIME_GRAPHSON_V1D0),
++    GRAPHSON_V1D0_SPARSE(SerTokens.MIME_GRAPHSON_V1D0_SPARSE),
 +    GRAPHSON_V2D0(SerTokens.MIME_GRAPHSON_V2D0),
 +    GRAPHSON_V3D0(SerTokens.MIME_GRAPHSON_V3D0),
 +    GRAPHBINARY_V1D0(SerTokens.MIME_GRAPHBINARY_V1D0);
 +
 +    private String value;
 +
 +    Serializers(final String mimeType) {
 +        this.value = mimeType;
 +    }
 +
 +    public String getValue() {
 +        return value;
 +    }
 +
 +    public MessageSerializer<?> simpleInstance() {
 +        switch (value) {
 +            case SerTokens.MIME_JSON:
 +            case SerTokens.MIME_GRAPHSON_V3D0:
 +                return new GraphSONMessageSerializerV3d0();
 +            case SerTokens.MIME_GRAPHSON_V1D0:
 +                return new GraphSONMessageSerializerGremlinV1d0();
++            case SerTokens.MIME_GRAPHSON_V1D0_SPARSE:
++                return new GraphSONMessageSerializerV1d0();
 +            case SerTokens.MIME_GRAPHSON_V2D0:
 +                return new GraphSONMessageSerializerV2d0();
 +            case SerTokens.MIME_GRAPHBINARY_V1D0:
 +                return new GraphBinaryMessageSerializerV1();
 +            default:
 +                throw new RuntimeException("Could not create a simple MessageSerializer instance of " + value);
 +        }
 +    }
 +}