You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Kelvin R. Lawrence (JIRA)" <ji...@apache.org> on 2015/06/10 20:58:00 UTC

[jira] [Created] (TINKERPOP3-721) Reduce confusion between when IDs are treated as strings and not.

Kelvin R. Lawrence created TINKERPOP3-721:
---------------------------------------------

             Summary: Reduce confusion between when IDs are treated as strings and not.
                 Key: TINKERPOP3-721
                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-721
             Project: TinkerPop 3
          Issue Type: Improvement
            Reporter: Kelvin R. Lawrence
            Priority: Minor


Opening this per request from Marko on the Gremlin-Users list.

The normalization of IDs to strings in certain cases causes unexpected (or at least inconsistent) behaviour patterns for users of Gremlin and at least in my case caused confusion.

Here is a specific example:

If I code this, id is treated as a string (not what I wanted)

gremlin> g.V().has(id,lt(10))
==>v[1]

So I ended up trying this and it works as expected.

gremlin> g.V().as('x').id.is(lt(10)).select('x')
==>v[1]
==>v[2]
==>v[3]
==>v[4]
==>v[5]
==>v[6]
==>v[7]
==>v[8]
==>v[9]

Marko pointed out that I could have coded::

g.V.where(id().is(lt(10)))

Which indeed does work as id() returns a long integer.

As a side note I have the following base configuration set:

conf = new BaseConfiguration()
conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
graph = TinkerGraph.open(conf)






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)