GraphStream Users

Archives de la liste Aide

Using GraphStream as a file-format converter

Chronologique Discussions 
  • From: Geofrey Sanders <gsanders AT>
  • To: "GraphStream Users mailing list (graphstream-users AT" <graphstream-users AT>
  • Subject: Using GraphStream as a file-format converter
  • Date: Mon, 21 Feb 2011 11:36:28 -0700
  • Accept-language: en-US
  • Acceptlanguage: en-US

Hello! I am looking for an hint to what I’m doing wrong with the GraphStream library; I want to use it to convert a Graphviz file (with FileSourceDOT) to a GraphML file (with FileSinkGML).


Having set up infile and outfile as the names of the input and output,


> FileSourceDOT reader = new FileSourceDOT();

> FileSinkGML writer = new FileSinkGML();

> Graph graph = new MultiGraph("graph", true, false);


> reader.addSink(graph);

> reader.readAll(infile); // IdAlreadyInUseException here

> writer.writeAll(graph, outfile);


I get an exception thrown from the readAll method:


Exception in thread "main" org.graphstream.graph.IdAlreadyInUseException: singleton exception: id 'ICD9Code' already used, cannot add node

                at org.graphstream.graph.implementations.DefaultGraph.addNode_(


                at com.idfbins.gsanders.dot2gml.Main.main(


The exception mentions the same id, “ICD9Code”, on every run. This makes me think I’m missing an initialization step or using the wrong kind of Graph object.

So far I can’t see what to change, so any suggestions are welcome!



  • Using GraphStream as a file-format converter, Geofrey Sanders, 21/02/2011

Archives gérées par MHonArc 2.6.16.

Top of page