无法在yED中读取networkx生成的graphml文件

时间:2016-03-01 10:08:33

标签: networkx graphml

我正在基于网络分析通过python生成graphml文件。这工作正常。问题是我无法使用yED或cytoscape读取它。

这是我在yED中观察到的错误。

java.io.IOException
    at B.A.A.B.W.ă(Unknown Source)
    at B.A.A.B.W.ā(Unknown Source)
    at B.A.A.J.A.ā(Unknown Source)
    at B.A.A.J.A.ā(Unknown Source)
    at B.A.A.J.A$A.Ă(Unknown Source)
    at B.A.A.J.A.ā(Unknown Source)
    at B.A.A.K.D.ā(Unknown Source)
    at B.A.A.K.j.actionPerformed(Unknown Source)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:125)
    at java.awt.MenuItem.processActionEvent(MenuItem.java:669)
    at java.awt.MenuItem.processEvent(MenuItem.java:628)
    at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:351)
    at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:339)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:761)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NumberFormatException: For input string: "10000000000"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:583)
    at java.lang.Integer.valueOf(Integer.java:766)
    at y.H.B.A$B.Ă(Unknown Source)
    at y.H.B.B.X.ā(Unknown Source)
    at y.H.B.B.Y.ā(Unknown Source)
    at y.H.B.B.Y.ą(Unknown Source)
    at y.H.B.B.Y.ā(Unknown Source)
    at y.H.B.B.Y.Ă(Unknown Source)
    at y.H.B.B.Y.ā(Unknown Source)
    at y.H.B.B.Y.Ć(Unknown Source)
    at y.H.B.B.Y.ā(Unknown Source)
    at y.H.B.B.Y.Ą(Unknown Source)
    at y.H.B.B.Y.ā(Unknown Source)
    at y.H.B.B._.ā(Unknown Source)
    at y.H.B.B._.ā(Unknown Source)
    at y.H.B.A$13.ā(Unknown Source)
    at y.H.B.A.đ(Unknown Source)
    at y.H.B.A.ā(Unknown Source)
    at y.H.Q.ā(Unknown Source)
    at B.A.A.B.G.A.F.ā(Unknown Source)
    at B.A.A.B.G.A.D.ā(Unknown Source)
    at y.H.G.ā(Unknown Source)
    at y.B.A.M.Đ(Unknown Source)
    at y.B._.č(Unknown Source)
    at y.B._.ĺ(Unknown Source)
    at y.B._.ă(Unknown Source)
    ... 36 more

*

这是我的graphml文件 http://pastebin.com/r5xuPTXX

我是graphml格式的新手。任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:1)

事情是Java parseInt返回一个32位有符号的int,其最大值为2,147,483,647,你的值(可能是一个节点Id)是10,000,000,000。 解析器代码应返回long(64位整数)。

Networkx在这里没有错。如果您无法更改解析器,可能会尝试将大值转换为字符串类型而不是int。