Re: hey guys ,how to query a person relational depth

李平 <lipin...@...>

ok  thanks   ,another question , how to skip a super vertex ,this vertex has lots of edge ,for example .the phone is 911 or this phone is custom service,  so a lots of people has relation with this vertex , when I query a person two layer relation depth, it will query a lots of person
custom service;

在 2017年8月25日星期五 UTC+8上午2:32:17,Daniel Kuppitz写道:

Any of the following 2 queries should do the trick:

gremlin> g.V().has('name','A').

gremlin> g.V().has('name','A').
             by(select(all, 'x').count(local))

Pretty much depends on how you define "relation depth".


On Wed, Aug 23, 2017 at 7:26 PM, 李平 <li...@...> wrote:
gremlin> g.addV().property('name', 'A').as('a'). addV().property('phone', '110').as('b'). addV().property('name', 'C').as('c'). addV().property('phone', '111').as('d'). addV().property('name', 'E').as('e'). addV().property('phone', '112').as('f'). addV().property('name', 'G').as('g'). addE('hasPhone').from('a').to('b'). addE('hasPhone').from('c').to('d'). addE('hasPhone').from('c').to('b'). addE('hasPhone').from('e').to('d').
addE('hasPhone').from('e').to('f'). addE('hasPhone').from('g').to('b').iterate()

if I want to know vertex A's relation depth how to write the gremlin commond,   

I  write like this 


but it seem endless loop,
在 2017年8月23日星期三 UTC+8下午9:16:21,Jason Plurad写道:
There's a recipe for this

On Wednesday, August 23, 2017 at 3:52:14 AM UTC-4, 李平 wrote:
I want to know ,one person in the janusGraph ,his relational depth,use gremlin

You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Join to automatically receive all group messages.