[Gephi] Loading Nodes and Edges Files

  1. 準備兩個檔案,分別是 node.csv 和 edge.csv,其中 node.csv 長這樣

    請在第一行加上 label,id,label 可以視為 user name,id 則是 user id

    一樣在第一行加上 source,target,type,這是為了符合 Gephi 載入格式
    其中 source 與 target 對應到 node.csv 的 id
    type 有兩種,分別是 Directed (預設) 和 Undirected
  2. 以 New Project 開啟 Gephi
  3. 切換到 『Data Laboratory』,選擇『Import Spreadsheet』
  4. 先選擇要 node.csv,並以『Node table』載入

    可以看到下方 Preview 將 label 和 id 作為 title
  5. 下一步以後

  6. 載入 node.csv 的 Nodes 結果
  7. 在接著載入 edge.csv,注意要切換成載入為『Edge table』
  8. 下一步

    這裡可以看到有說 Source 和 Target 都需要是 id of node,所以你要是填寫成 label 的話,就會因為 missing node,所以會自動 create 在 node table 中
  9. 沒問題就按下完成

    注意到最右邊那一欄的 Weight,第二個是 2,是因為我們在 edge.csv 中,有兩個 1,5,Undirected,所以 Gephi 自動幫我們加成 weight 為 2,這個可以用在兩個人共同對多少個不同的第三對象有關係,例如以下關係:
    A 和 B 都喜歡吃 apple
    A 和 C 都喜歡吃 apple
    A 和 C 都喜歡吃 banana
    則在編制 edge.csv 時,就會寫成:
  10. 接著就可以切換到 Overview 來看關係圖,可以看到 a (id=1) 和 i (id=5) 的線比較粗,就是因為們的權重是 2

(Thanks for advise from Mr. Shiug-Feng Shih @ IM Lab NCCU-CS, Taiwan)

Gephi on Mac OS X

Original Post:

This took me a while as well :-/
As this is a show-stopper for every normal Mac user here the steps to get it running on Mac OS X 10.9:

download and install this: http://support.apple.com/kb/DL1572
delete your gephi settings dir: rm -r ~/Library/Application\ Support/gephi
find your java home with /usr/libexec/java_home -v 1.6, it should print something like /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
if there is a message about being unable to find any JVMs matching version 1.6 something is wrong, fix it
edit /Applications/Gephi.app/Contents/Resources/gephi/etc/gephi.conf to set your jdkhome e.g. like this: echo “jdkhome=\"$(/usr/libexec/java_home -v 1.6)\"" >> /Applications/Gephi.app/Contents/Resources/gephi/etc/gephi.conf
start gephi and open the Les Miserables sample, if you see the graph good.
check gephi’s about for the line saying Java: 1.6.0_65; Java HotSpot(TM) 64-Bit Server VM 20.65-b04-462
as simple as that ^^

This critical bug was reported over a year ago… Until Java 7 is supported I suggest solving it similar to other apps like yEd by a dialog guiding the user through the installation of Java 6.
In the meantime please just check the Java Version on startup and properly explain the problem and how to solve it instead of that ugly nothing saying “unable to load libjogl_awt" error message.

We all like gephi, but due to this i guess only < 1 % of your mac users are left 😦