Very strange indeed...
gremlin> g = TinkerGraph.open().traversal()
==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
gremlin> g.addV().property('name','marko')
==>v[0]
gremlin> g.addV().property(single, 'name', 'stephen', id, 4L)
==>v[2]
gremlin> g.addV().property('name','daniel')
==>v[3]
gremlin> g.V().valueMap(true)
==>[id:0,label:vertex,name:[marko]]
==>[id:2,label:vertex,name:[stephen]]
==>[id:3,label:vertex,name:[daniel]]
gremlin> g.V().properties().valueMap(true)
==>[id:1,key:name,value:marko]
==>[id:4,key:name,value:stephen]
==>[id:4,key:name,value:stephen]
v3.3.3
Robert Dale
On Wed, Sep 12, 2018 at 2:21 PM Daniel Kuppitz <[email protected]> wrote:
> Right now we don't enforce uniqueness of property ids, which can lead to
> very weird results:
>
> gremlin> g = TinkerGraph.open().traversal()
> ==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
> gremlin> g.addV().property(single, 'foo', 'bar', id, 1).property(single,
> 'bar', 'baz', id, 1)
> ==>v[0]
> gremlin> g.V().properties().hasId(1)
> ==>vp[bar->baz]
> ==>vp[bar->baz]
>
>
> If we allow users to manually specify property ids, the above query should
> throw an exception.
>
> IMO, local uniqueness should be enough (given alone the complexity it would
> require to ensure global uniqueness).
>
> Thoughts? Objections? More/other suggestions?
>
> Cheers,
> Daniel
>