0

I'm new to GraphX and I'm trying to load a CSV file as a graph. The CSV is in the format:

ID1      ID2      Attr1     Attr2      OtherAttr1      OtherAttr2
0        6        -2        4          soccer          basketball
3        1        5         -3         coke            software
1        0        -3        -2         software        soccer
.
.
.

The first two columns represent the IDs of the vertices, and the link is between the first one (ID1) and the second one (ID2). Attr1 and OtherAttr1 are attributes of vertex 1 (ID1), and Attr2 and OtherAttr2 are the attributes of vertex 2 (ID2).

So, in my graph I'd have 0 pointing towards 6, where 0 has attributes -2 and soccer, and 6 has attributes 4 and basketball. Then 3 points towards 1, and so on.

Also note that the attributes are consistent with the vertex, so even though vertex with ID 1 appears twice, its attributes are consistent in both rows.

Please help me out, and if there's a better way to make the table itself that'll make it easier, then please let me know!

  • are you asking how to format the csv differently to make loading as easy as possible? Or how to load a csv with the format you describe? – alex9311 Jul 22 '16 at 18:52
  • I was asking how to load the CSV with the format described, but also wanted to know if other formats would make it easier to load. Anyways, I figured it out :) – Aditya Srinivasan Jul 28 '16 at 08:32

0 Answers0