There already is a leaner version - ReferenceVertex (and similar Reference* classes). It is just what you are asking for with id and label returned with nothing else. Currently this is the default return value for Gremlin Language Variants - so if you use Gremlin Python, for example, you only get back the id/label for a vertex. We've not changed that for Gremlin string based traversals, which still return Detached*, because it would cause too great a break for too many users at this point. There are a few ways to configure Gremlin Server to return Reference* but the best way is to configured the GraphTraversalSource with HaltedTraverserStrategy and specify that it use the ReferenceFactory for detachment.
On Fri, Jan 12, 2018 at 8:41 PM, Divij Vaidya <divijvaidy...@gmail.com> wrote: > Hello, > > I have a question regarding the implementation of serializers. This > question holds true for Gryo as well as Graphson. > > What is the motivation for adding properties associated with the Vertex in > the serialized result sent back to the client? I understand that a > DetachedVertex is defined by the vertex along with the properties, but in > cases when the client is only interested in projecting out the vertex with > Id and Label, the additional computation & serialization of properties is > unnecessary. > > Do you think it would be an idea worth considering to create a leaner > version of detached vertex which consists of only the Id of the vertex? > This leaner implementation should be the output to queries which project > out a vertex such as g.V(1). > > Serializer code reference: https://github.com/apache/tinkerpop/blob/ > 4062898a0d15de030b656283a038eaa7c0b128d0/gremlin-core/src/ > main/java/org/apache/tinkerpop/gremlin/structure/ > io/gryo/GryoSerializersV3d0.java#L132 > > Regards, > Divij >