In addition to the Edge class, there is another abstraction that the GraphX library provides, which is known as EdgeTriplet. EdgeTriplet extends the Edge class and adds properties of source OS destination vertices as well.
So in addition to fields of the Edge class such as ID of source vertex, ID of the destination vertex and edge property, it also contains properties of the source and destination vertices.
Logical representation of EdgeTriplet
The triplets() function on the graph provides the EdgeTriplets of the graph as follows:
RDD<EdgeTriplet<string, string>> triplets = graph.triplets();
All EdgeTriplet elements of the graph can be printed as follows:
graph.triplets().toJavaRDD().collect().forEach(System.out::println);