Home Wiki Blog Forum GEXF.net

Gephi forums

Community support

importing CSV data: please improve and explain

Once it's running

importing CSV data: please improve and explain

Postby Isee... » 23 May 2012 23:25

PB: Importing is not straightforward and is not clearly explained.

Apparently:
1 you need two CSV files: nodes, and edges
2 the nodes file should contain ID and Label,, and possibly Modularity class (?)
3 then you must build an edge file, where you use ID, source, target, edgelabel. It does not contain the nodelabels (Myriel, Napoleon), but only "A", "B"... It is hard to build and illegible for maintenance !


Suggestions:
allow a single table (Graphviz DOTfiles allow this). On could perfectly leave some cells blank
or at least
allow mentioning nonambiguous nodenames (Myriel, Napoleon) in the edge table
Isee...
 
Posts: 5
Joined: 20 Jun 2011 18:06

Re: importing CSV data: please improve and explain

Postby seinecle » 24 May 2012 11:51

Hi,

Thanks for your comments.

For nodes, you just need an id. Here is an example for a network of nodes Myriel and Napoleon:
id
Myriel
Napoleon

For edges, you just need "source" and "target", which take the nodes ids for values. Example:

source,target
Myriel,Napoleon

That's it.

If you want more complicated things (edge ids, labels, weights, directed or undirected edges, etc.) this is possible as well:

Imagine a network of Myriel and Napoleon, weighted, undirected, with edge ids and node attributes:

for nodes:
id,label,gender
a,Myriel,male
b,Napoleon,male

for edges:
id,source,target,weight,label,type
1,a,b,0.8,edge_1,undirected

Note that I used commas in these examples, but that Gephi allows for semicolons, tabs and spaces as well.

I hope this clarifies.

Best,

Clement
http://www.clementlevallois.net
Gephi tutorials and personalized trainings: http://www.clementlevallois.net/training.html
Join the Gephi Facebook group for help and support: https://www.facebook.com/groups/gephi/
User avatar
seinecle
Gephi Community Support
 
Posts: 539
Joined: 08 Feb 2010 17:55
Location: Lyon, France


Return to How-To and Troubleshooting

Who is online

Users browsing this forum: No registered users and 0 guests

cron
sports medicine portsmouth nh where to buy metronidazole