[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
Gephi forums •[SOLVED] Importing nodes & edges with text IDs
Page 1 of 1

[SOLVED] Importing nodes & edges with text IDs

Posted: 18 Feb 2013 18:30
by panklam
Hi,

I am having trouble importing CSV files for edges. My nodes CSV file has the labels:

ID , Network, Network Number, Year, [other data]

IDs are all text. After Import, Gephi has placed the ID text into columns both for Nodes and Id.

The edges CSV file has the labels:

Source, Target, Weight

when this file is loaded into Gelphi, all the text names for sources and targets have a "-null" appended to their names. And Gephi has added new nodes and Ids for all the names into the Nodes table.

What am I not doing correctly or understanding?

thanks,

/patti

Re: Importing nodes & edges with text IDs

Posted: 18 Feb 2013 19:11
by eduramiba
Hi patti,
Can you share your files or some sample of them to see what's wrong?

Eduardo

Re: Importing nodes & edges with text IDs

Posted: 18 Feb 2013 21:24
by panklam
Here is a modified version of my data. On loading the edges, it only creates new nodes for some of the existing nodes.

Thanks for any assistance you can offer!

Re: Importing nodes & edges with text IDs

Posted: 19 Feb 2013 10:14
by seinecle
Hi,
- the "null" appearing in your edge table simply refers to the fact that your nodes have no labels. Indeed if you see your Label column in the nodes table, it's empty. That's ok and does not indicate an error.
If you want to remove the null stuff, add labels to your nodes: in the nodes table, click on "Copy data to other column", and follow the steps to copy your id column to your label column.
Alternatively, if you are happy with having no labels, and don't want to be annoyed by this "null" indication, click on the "Configuration" button in the datalab icons, and untick "Show label of source and target nodes".

I am not sure there is any other issue. What I did with your sample dataset is:
-> import the nodes.
-> import the edges. Made sure the "create new nodes" tick box was left unchecked, because I assumed that all nodes present in your edges were already present in your nodes file.
-> done.

I hope it helps?

Best,

Clement

Re: [SOLVED] Importing nodes & edges with text IDs

Posted: 19 Feb 2013 15:05
by panklam
Thanks, I am a bit farther along, thanks to the "Don't create new nodes" trick. Now I seem to have a problem in that it is not loading all the edges data. (In some cases, I have multiple occurrences of the same source and target. Gephi is adding the values of these, which I suppose makes sense but it is not what I need!)

Will post further when I have time to make an example file.

I very much appreciate all your quick responses!

/patti

Re: [SOLVED] Importing nodes & edges with text IDs

Posted: 19 Feb 2013 15:14
by seinecle
Sure,
Gephi does not support multiple edges between the same nodes. When it finds several edges; it performs some form of aggregation of them.

There is no real solution to that; except adapting your dataset and research question accordingly. If multiple edges are absolutely necessary to you, then the software ORA (http://www.casos.cs.cmu.edu/projects/ora/) or Graphviz (http://www.graphviz.org/) do support them.

Best,

Clement

Re: [SOLVED] Importing nodes & edges with text IDs

Posted: 19 Feb 2013 22:11
by panklam
Ok, so I fixed that -- I now have only one relation for each source/target pair.

But when I import the edges.CSV into Gephi, it only imports 142 of the 346 edges! Can you think of any other reason that it would not import all the edges? (I have unchecked "create new nodes".)

And it is not the case that the import was truncated. It skips the edges for the first source, includes the edge for the second source, then includes 3 out of 19 edges for the third source, and on unpredictably.

Re: [SOLVED] Importing nodes & edges with text IDs

Posted: 20 Feb 2013 07:08
by seinecle
Looks like a problem with the spelling... double check the lower / upper case of your source and targets (ids are sensitive to case I believe), and trailing spaces as you already mentioned. If the problem persists, please post a new sample here?

Re: Importing nodes & edges with text IDs

Posted: 22 Feb 2013 13:22
by panklam
Looks like that was it ... some data had trailing spaces. Thanks again for your attentiveness!