NetLogo / NetLogo/NW-Extension

Support GXL Format

Open
#121 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Scala
Stars
66
Forks
25
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with nw:load-graphml and the linked GXL sample. Read GraphMLImport.scala and GraphML.scala around the JUNG GraphMLReader2 call to understand the current import path. Done means the sample loads with the relevant GXL elements, or unsupported input produces informative errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.