Looks like dedup can take only one by() modulator do you can't do g.V().as('a').outE().as('b').inV().as('c').dedup('a','b','c').by('name').by(label).by('name').
If deduping on a single property per element is sufficient, then you can do something like g.V().as('a').outE().as('b').inV().as('c').select('a','b','c').by('name').by(label).by('name').dedup().select('a','b','c')
gremlin> graph = TinkerFactory.createModern()
==>tinkergraph[vertices:6 edges:6]
gremlin> g = graph.traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
// current number of knows relationships
gremlin> g.V().hasLabel('person').as('a').outE('knows').as('b').inV().hasLabel('person').as('c').count()
==>2
// add some duplicate vertices
gremlin> g.V().hasLabel('person').as('a').addV('person').property('name',select('a').values('name')).count()
==>4
// add plenty of duplicate relationships
gremlin> g.V().hasLabel('person').as('a').V().hasLabel('person').as('b').addE('knows').from('a').count()
==>64
gremlin> g.V().hasLabel('person').as('a').V().hasLabel('person').as('b').addE('knows').from('a').count()
==>64
// let's count them: 2+64+64 =
gremlin> g.V().hasLabel('person').as('a').outE('knows').as('b').inV().hasLabel('person').as('c').count()
==>130
// dedup
gremlin> g.V().hasLabel('person').as('a').outE('knows').as('b').inV().hasLabel('person').as('c').select('a','b','c').by('name').by(label).by('name').dedup().count()
==>16
// let's look at the results: it gives only the selected criteria
gremlin> g.V().hasLabel('person').as('a').outE('knows').as('b').inV().hasLabel('person').as('c').select('a','b','c').by('name').by(label).by('name').dedup()
==>[a:marko,b:knows,c:vadas]
==>[a:marko,b:knows,c:josh]
...
// let's get back the elements
gremlin> g.V().hasLabel('person').as('a').as('a1').outE('knows').as('b').as('b1').inV().hasLabel('person').as('c').as('c1').select('a','b','c').by('name').by(label).by('name').dedup().select('a1','b1','c1')
==>[a1:v[1],b1:e[7][1-knows->2],c1:v[2]]
==>[a1:v[1],b1:e[8][1-knows->4],c1:v[4]]
...