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

Unable to read graphml file generated by networkx in yED

我正在根据网络分析通过 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.access0(EventQueue.java:97)
    at java.awt.EventQueue.run(EventQueue.java:709)
    at java.awt.EventQueue.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.run(EventQueue.java:731)
    at java.awt.EventQueue.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.ā(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 格式的新手。感谢任何帮助。

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

这里没有 Networkx 的错误。如果你不能改变解析器,也许尝试将大值转换为字符串类型而不是 int。