[SOLVED] Importing nodes & edges with text IDs

Get help with your data
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
panklam
Posts:9
Joined:04 Oct 2012 21:48
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[SOLVED] Importing nodes & edges with text IDs

Post by panklam » 18 Feb 2013 18:30

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

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Importing nodes & edges with text IDs

Post by eduramiba » 18 Feb 2013 19:11

Hi patti,
Can you share your files or some sample of them to see what's wrong?

Eduardo

panklam
Posts:9
Joined:04 Oct 2012 21:48
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Importing nodes & edges with text IDs

Post by panklam » 18 Feb 2013 21:24

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!
Attachments
Patti example edges.csv
Edges
(1014Bytes)Downloaded 1099 times
Patti Example Nodes.csv
Nodes
(705Bytes)Downloaded 968 times

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Importing nodes & edges with text IDs

Post by seinecle » 19 Feb 2013 10:14

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

panklam
Posts:9
Joined:04 Oct 2012 21:48
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

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

Post by panklam » 19 Feb 2013 15:05

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

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

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

Post by seinecle » 19 Feb 2013 15:14

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

panklam
Posts:9
Joined:04 Oct 2012 21:48
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

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

Post by panklam » 19 Feb 2013 22:11

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.

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

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

Post by seinecle » 20 Feb 2013 07:08

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?

panklam
Posts:9
Joined:04 Oct 2012 21:48
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Importing nodes & edges with text IDs

Post by panklam » 22 Feb 2013 13:22

Looks like that was it ... some data had trailing spaces. Thanks again for your attentiveness!

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable