In order to get access to the edges, you need to traverse them explicitely.
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().hasLabel('software').
repeat(__.inE().as('e').outV()).
emit().
property(set, 'incoming', select(last, 'e')).iterate()
gremlin> g.V().valueMap()
==>[incoming:[e[9][1-created->3],e[8][1-knows->4]],name:[marko],age:[29]]
==>[name:[vadas],age:[27]]
==>[name:[lop],lang:[java]]
==>[incoming:[e[11][4-created->3],e[10][4-created->5]],name:[josh],age:[32]]
==>[name:[ripple],lang:[java]]
==>[incoming:[e[12][6-created->3]],name:[peter],age:[35]]
I wouldn't recommend storing whole edges though; edge ids might be fine.
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().hasLabel('software').
repeat(__.inE().as('e').outV()).
emit().
property(set, 'incoming', select(last, 'e').by(id)).iterate()
gremlin> g.V().valueMap()
==>[incoming:[9,8],name:[marko],age:[29]]
==>[name:[vadas],age:[27]]
==>[name:[lop],lang:[java]]
==>[incoming:[11,10],name:[josh],age:[32]]
==>[name:[ripple],lang:[java]]
==>[incoming:[12],name:[peter],age:[35]]
UPDATE
To collect the adjacent vertex ids, it would be:
gremlin> g.V().hasLabel('software').
repeat(__.as('v').in()).
emit().
property(set, 'incoming', select(last, 'v').by(id)).iterate()
gremlin> g.V().valueMap()
==>[incoming:[3,4],name:[marko],age:[29]]
==>[name:[vadas],age:[27]]
==>[name:[lop],lang:[java]]
==>[incoming:[3,5],name:[josh],age:[32]]
==>[name:[ripple],lang:[java]]
==>[incoming:[3],name:[peter],age:[35]]