Using AWS Neptune, I need to find a traversal strategy that takes one reference vertex, and by traversing along one edge type, it finds another vertices that has exactly the same neighbors, ie. not more, not less.
g.V('1').as('ref_vertex').out('created').as('creations').in('created')
Finds vertices that also created the same things as "1", but it also scopes in vertexes (a) that created something else too, and also (b) those that did not create everything that "1" created.
g.V('1').as('ref_vertex')
.out('created').as('creations').in('created')
.not(out('created').where(neq('creations'))
Helps only problem (a), getting rid of persons created something extra.
How to i continue this query to skip (b) vertices from the result ?
g.V('1').aggregate('ref_vertex').
out('created').
sideEffect(aggregate('neighbors')). /* get neighbors of 'ref_vertex' */
in('created').groupCount().unfold(). /* group count in('created') by its occurrence times */
as('candidate_shared_neighbor_cnt_pair').
where('candidate_shared_neighbor_cnt_pair', eq('neighbors')). /* select only the vertices have the same occurrence times as 'ref_vertex' */
by(select(values)).
by(unfold().count()).
select(keys).
where(without('ref_vertex'))