GraphStream Users

Archives de la liste Aide

Re: Exporting graph in GEXF format

Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT>
  • To: Rajesh Veeranki <rveeranki01 AT>
  • Cc: graphstream-users AT
  • Subject: Re: Exporting graph in GEXF format
  • Date: Mon, 2 Jul 2012 15:12:39 +0200

I put FileSinkGEXF on github.
It should work but please report bugs you find !

It is only a static output (using writeAll()).
Here is a short example :

| Graph g = new AdjacencyListGraph("g");
| g.addNode("A").addAttribute("label", "Node A");
| g.addNode("B").addAttribute("test", 1.0);
| g.addNode("C").addAttribute("test", "Test");
| g.addNode("D").addAttribute("other", true);
| g.addEdge("AB", "A", "B");
| FileSinkGEXF out = new FileSinkGEXF();
| out.writeAll(g, System.out);


2012/7/2 Rajesh Veeranki <rveeranki01 AT>
Hope the feature will be added soon.

Rajesh V. 

On Mon, Jul 2, 2012 at 2:20 AM, guilhelm savin <guilhelm.savin AT> wrote:
Sorry, I was wrong.

FileSinkGEXF is not just experimental : it is a work in progress.
It will not export the graph.

We will try to finalize it soon ...

2012/7/1 guilhelm savin <guilhelm.savin AT>
Hi Rajesh,

Maybe trying to set fsb to a new FileSinkGEXF.

Graph g = new SingleGraph("");
| FileSinkBase fsb = new FileSinkGEXF();
| FileWriter f = new FileWriter("out.txt");
| PrintWriter pw = new PrintWriter(f);
| fsb.writeAll(g, pw);

FileSinkGEXF is experimental. You may encoutered bugs ...


2012/7/1 Rajesh Veeranki <rveeranki01 AT>
Hi ,
I'm back with a new question.I want to export the graph into GEXF format. I tried something like this, but its giving a null pointer exception.
                Graph g = new SingleGraph("");
                FileSinkBase fsb = null;
FileWriter f = new FileWriter("out.txt");
PrintWriter pw = new PrintWriter(f);
fsb.writeAll(g, pw);
Please help  me regarding this and how to export it.

Rajesh V.

Guilhelm Savin
PhD Student of Computer Science

Guilhelm Savin
PhD Student of Computer Science

Guilhelm Savin
PhD Student of Computer Science

Archives gérées par MHonArc 2.6.16.

Top of page