Re: Gremlin Query to return count for nodes and edges

Graham Wallis <graham_wallis@...>

Good query from @hadoopmarc and I like @cmilowka's suggestion, although I needed to modify it very slightly as follows:

g.V().hasLabel('A').union( __.count(), __.outE().count(), __.outE().inV().count() )

That has to be the shortest and neatest solution. Certainly far better than my rather basic effort below, which surely gets the prize for the longest solution :-)


Best regards,

Graham Wallis
IBM Open Software
Internet: graham_wallis@...    
IBM, Hursley Park, Hursley, Hampshire SO21 2JN

From:        "cmilowka" <cmilowka@...>
To:        janusgraph-users@...
Date:        23/02/2021 22:49
Subject:        [EXTERNAL] Re: [janusgraph-users] Gremlin Query to return count for nodes and edges
Sent by:        janusgraph-users@...

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Join to automatically receive all group messages.