Re: [TinkerPop] equal doesn't work in where('a',eq('b'))

51 views
Skip to first unread message
Message has been deleted

Robert Dale

unread,
Mar 21, 2019, 1:29:27 PM3/21/19
to gremli...@googlegroups.com
I'm not sure what you expected here.  Given any row in your screenshot, a != b.

gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().as('a').out().as('b').select('a','b').by(id).by(id)
==>[a:1,b:3]
==>[a:1,b:2]
==>[a:1,b:4]
==>[a:4,b:5]
==>[a:4,b:3]
==>[a:6,b:3]
// give any row, a != b, should not expect any results
gremlin> g.V().as('a').out().as('b').select('a','b').by(id).by(id).where('a',eq('b')) 
gremlin> g.V().as('a').out().in().as('b').select('a','b').by(id).by(id).where('a',eq('b'))
==>[a:1,b:1]
==>[a:1,b:1]
==>[a:1,b:1]
==>[a:4,b:4]
==>[a:4,b:4]
==>[a:6,b:6]
// mid-traversal V()
gremlin> g.V().as('a').V().as('b').select('a','b').by(id).by(id).where('a',eq('b'))
==>[a:1,b:1]
==>[a:2,b:2]
==>[a:3,b:3]
==>[a:4,b:4]
==>[a:5,b:5]
==>[a:6,b:6]
// and to demonstrate that there is a cross-product where a != b
gremlin> g.V().as('a').V().as('b').select('a','b').by(id).by(id).where('a',neq('b'))
==>[a:1,b:2]
==>[a:1,b:3]
==>[a:1,b:4]
==>[a:1,b:5]
==>[a:1,b:6]
==>[a:2,b:1]
==>[a:2,b:3]
==>[a:2,b:4]
==>[a:2,b:5]
==>[a:2,b:6]
==>[a:3,b:1]
==>[a:3,b:2]
==>[a:3,b:4]
==>[a:3,b:5]
==>[a:3,b:6]
==>[a:4,b:1]
==>[a:4,b:2]
==>[a:4,b:3]
==>[a:4,b:5]
==>[a:4,b:6]
==>[a:5,b:1]
==>[a:5,b:2]
==>[a:5,b:3]
==>[a:5,b:4]
==>[a:5,b:6]
==>[a:6,b:1]
==>[a:6,b:2]
==>[a:6,b:3]
==>[a:6,b:4]
==>[a:6,b:5]


Robert Dale


On Thu, Mar 21, 2019 at 10:05 AM Pareen Patel <par...@gmail.com> wrote:
g.V().has('ECCKT',textContains('101 /GE /BNT/LTR'))
.repeat(__.in().has('~label', 'Circu_Vrtx')).until(__.in().has('~label', 'Circu_Vrtx')
.count().is(0)).simplePath().dedup().order().as('a')
.V().has('ECCKT',textContains('102 /GE /LTR/LTR'))
.repeat(__.in().has('~label', 'Circu_Vrtx')).until(__.in().has('~label', 'Circu_Vrtx')
.count().is(0)).simplePath().dedup().order().as('b')
.select('a','b').by(id).by(id).where('a',eq('b'))
     .back('a').addOutE('ECCKT', 'b')



 "mid-traversal V()" b table and .select('a','b').by(id).by(id). gives me values for table a and table b.

But where('a',eq('b')) doesn't give me any match  from a and b? Any idea what can be wrong

Capture.PNG



--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/7dacd97c-22ac-45bb-bfbe-c81fce966a75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pareen Patel

unread,
Mar 21, 2019, 5:18:27 PM3/21/19
to Gremlin-users
Thanks Roberts for clearing Traversal concepts in detail.

Thanks 
Reply all
Reply to author
Forward
0 new messages