gremlin outputs different from as seen on the internet, I think in bytes

77 views Asked by At

How to get gremlin output normal indices along with v

Currently it outputs something like this

gremlin> g.V
WARN  com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx  - Query requires iterating over all vertices [()]. For better performance, use indexes
gremlin> juno = g.addVertex(null);
==>v[128824]
gremlin> june = g.addVertex(null);
==>v[128828]
gremlin> jape = g.addVertex(null);
==>v[128832]

But as I saw on the internet it should be output something like this when a vertex is added in the graph

gremlin> g.V
WARN  com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx  - Query requires iterating over all vertices [()]. For better performance, use indexes
gremlin> juno = g.addVertex(null);
==>v[1]
gremlin> june = g.addVertex(null);
==>v[2]
gremlin> jape = g.addVertex(null);
==>v[3]

The same problem occurs when I try to load about 10000 vertices. All these vertices have _id field in it but after loading this field is gone. It also not that the vertices have been loaded with this id....same is the case with _type field its also not present after loading.

I need these id and type because they map to something in other table too.

Here is a look at my rexter doghouse about the 3 loaded vertices

https://i.stack.imgur.com/qrheG.png

So bit confused about all this stuff.

Thanks in advance

1

There are 1 answers

3
stephen mallette On BEST ANSWER

When vertices are added to Titan an Element identifier is assigned. That value is up to Titan and you should not expect it to start at "1" or any other specific number when you do. If you need there to be some kind of number like that you should add it yourself.

With respect to the _id and _type fields, I'm assuming that you are referring to fields found in JSON output from Rexster. Note that those are Rexster fields that are appended to the output. _id is always there and should map directly to Vertex.id() or Edge.id() depending on the data you are returning. _type just refers to the whether the JSON returned is representative of a "vertex" or an "edge". That data is not stored in Titan itself.