NW-Extension icon indicating copy to clipboard operation
NW-Extension copied to clipboard

Support GXL Format

Open ToonTalk opened this issue 10 years ago • 2 comments

Running nw:load-graphml on the sample model at

http://www.gupro.de/GXL/examples/instance/gxl/simpleExample/content.html

raises the exception below.

I discovered that if the element is removed that this exception is avoided.

But then the elements caused errors.

Removing them and adding edgedefault="undirected" fixed those errors.

Then changing 'to' to 'target' and 'from' to 'source' finally allowed the file to load.

Ideally more of the GXL standard should be supported. Minimally much more informative error messages since I had to discover these problems by trial and error.

Extension exception: Unable to read Graph from document - the document could be empty error while observer running NW:LOAD-GRAPHML called by Command Center

org.nlogo.nvm.EngineException: Extension exception: Unable to read Graph from document - the document could be empty at edu.uci.ics.jung.io.graphml.GraphMLReader2.readGraph(GraphMLReader2.java:295) at org.nlogo.extensions.nw.jung.io.GraphMLImport$.load(GraphMLImport.scala:164) at org.nlogo.extensions.nw.prim.jung.LoadGraphML.createTurtles(GraphML.scala:27) at org.nlogo.extensions.nw.prim.jung.LoadGraphML.createTurtles(GraphML.scala:24) at org.nlogo.extensions.nw.NetworkExtensionUtil$TurtleCreatingCommand$class.perform(NetworkExtensionUtil.scala:108) at org.nlogo.extensions.nw.prim.jung.LoadGraphML.perform(GraphML.scala:24) at org.nlogo.prim._extern.perform(_extern.java:54) at org.nlogo.nvm.Context.stepConcurrent(Context.java:91) at org.nlogo.nvm.ConcurrentJob.step(ConcurrentJob.java:82) at org.nlogo.job.JobThread.org$nlogo$job$JobThread$$runPrimaryJobs(JobThread.scala:143) at org.nlogo.job.JobThread$$anonfun$run$1.apply$mcV$sp(JobThread.scala:78) at org.nlogo.job.JobThread$$anonfun$run$1.apply(JobThread.scala:76) at org.nlogo.job.JobThread$$anonfun$run$1.apply(JobThread.scala:76) at scala.util.control.Exception$Catch.apply(Exception.scala:88) at org.nlogo.util.Exceptions$.handling(Exceptions.scala:41) at org.nlogo.job.JobThread.run(JobThread.scala:75)

NetLogo 5.1.0-RC2 main: org.nlogo.app.AppFrame thread: JobThread Java HotSpot(TM) Server VM 1.6.0_45 (Sun Microsystems Inc.; 1.6.0_45-b06) operating system: Windows 7 6.1 (x86 processor) Scala version 2.9.2 JOGL: (3D View not initialized) OpenGL Graphics: (3D View not initialized) model: Untitled

01:43:22.428 RuntimeErrorEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 01:43:22.428 PeriodicUpdateEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 01:43:22.326 AddJobEvent (org.nlogo.app.CommandLine) AWT-EventQueue-0 01:43:22.326 OutputEvent (org.nlogo.app.CommandLine) AWT-EventQueue-0 01:43:22.325 CompiledEvent (org.nlogo.window.CompilerManager) AWT-EventQueue-0 01:43:22.314 CompileMoreSourceEvent (org.nlogo.app.CommandLine) AWT-EventQueue-0 01:43:22.171 PeriodicUpdateEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 01:43:21.971 PeriodicUpdateEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 01:43:21.771 PeriodicUpdateEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 01:43:21.571 PeriodicUpdateEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0

ToonTalk avatar Jun 26 '14 13:06 ToonTalk

Thanks for the report! load-graphml is only intended to work on GraphML, which is related to but different from GXL. Is it alright if I change this to a feature request for GXL support?

qiemem avatar Jun 26 '14 16:06 qiemem

Sure, change it to a feature request. I'm just learning about these standards -- perhaps the documentation should say something about this as well.

ToonTalk avatar Jun 26 '14 18:06 ToonTalk