Re: Gremlin Query to return count for nodes and edges


hadoopmarc@...
 

Hi Vinayak,

A new attempt:

g = TinkerFactory.createModern().traversal()   
g.withSideEffect('vs', new HashSet()).withSideEffect('es', new HashSet()).
    V(1,2).aggregate('vs').outE().aggregate('es').inV().aggregate('vs').cap('vs', 'es').
    project('vs', 'es').
    by(select('vs').unfold().count()).
    by(select('es').unfold().count())
==>[vs:4,es:3]
This still looks clunky to me, so I challenge other readers to get rid of the project().by(select()) construct.

Best wishes,    Marc

Join {janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.