Search code examples
networkxgraphml

Unable to read graphml file generated by networkx in yED


I am generating a graphml file via python based on network analysis. This is working fine. The problem is that I am unable to read it using yED or cytoscape.

Here is the error that I am observing in 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

*

and here is my graphml file http://pastebin.com/r5xuPTXX

I am new to the graphml format. Any help is appreciated.


Solution

  • The thing is Java parseInt returns a 32bit signed int which has a maximal value of 2,147,483,647, your value (maybe an node Id) is 10,000,000,000. The parser code should return a long (a 64 bit integer) instead.

    Networkx is not at fault here. If you cannot change the parser, maybe try to cast big values as string type instead of int.