Updating data in a project

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
sebc28
Posts:5
Joined:30 Aug 2014 19:34
[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
Updating data in a project

Post by sebc28 » 30 Aug 2014 19:52

Hello,
I am still new with Gephi, so perhaps some experienced user can share some useful advice on this (I think) simple problem.

My goal is to map several people and their associated "tags".

To generate the edge table, I now have a CSV file containing something like:

Source Target
John golf
John ski
John baker
Susan golf
Susan soccer
Mary golf
Mary teacher


I then count on Gephi to generate the Nodes table.


Here is where I could use some help:

1) My list will probably evolve through time (adding people, or adding/modifying tags), and I found no easy way to update the table(s). I have the impression that the safest and quickest way is to start a new project, but then I lose all changes in the Node table, and any visual effects I applied on the map. Is there any standard procedure to "update" the table?

2) I would like to add a column in the Node table to identify the people nodes as 1, and the tag nodes as 0 (in order to easily distinguish them by color or size in the overview). I understand how to do this manually, I first fill in the column with 0s, but it is then quite tedious to find the people nodes and type in a "1" in each cell (and when my list will exceed 20 people, it will become too time consuming). Also, if I update the Edge table as described in 1), the Node table is regenerated and I have to start over.

I hope my situation is clear enough, and if anyone has been through this and has some good advice, please let me know :)

Seb

hbruch
Posts:11
Joined:27 Jul 2014 16:57
Location:Germany, Stuttgart
[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: Updating data in a project

Post by hbruch » 04 Sep 2014 23:39

Hi Seb,

1: did you try the Data Laboratory "Import Spreadsheet" function? With it, you should be able to update existing nodes (be sure to deselect the option "Force nodes to be created as new one"). If you have doubts concerning the file format, you could export an existing graph via "Export table" and modify it.

For edges, this procedure will not update the attributes but only increase the weight for each occurence of an already existing edge, but you could delete the edges and reimport the modified version. Via the data lab your nodes should stay untouched.

2: I'm not aware of an option to edit a value for multiple rows at once, except filling all rows of a column. As your graph seems to be directed and bipartite, you might use the "Average degree" statstics to generate new columns "in-degree", "out-degree", which will be 0 for e.g. people and >0 for tags. The data lab again provides various options to process theses columns further (creating new columns with regexp, copying values to another column, etc.)

Best regards,
Holger

sebc28
Posts:5
Joined:30 Aug 2014 19:34
[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: Updating data in a project

Post by sebc28 » 17 Sep 2014 20:44

Hi,
Many thanks for your reply. Still having some trouble with the automatic updating procedure.

1a. I did try using the Import Spreadsheet to overwrite the existing Edge file (also using the export spreadsheet to ensure the format is the same and correct). The problem is, in some cases, it doesn't recognize the existing nodes, and so it creates another set of nodes with new IDs.
1b. In the end, even if I figure out how to update these data tables (thanks to your tips I might get there :)), I still believe there is some work to be done, as the new edges/nodes won't obey the operations/calculations applied to the layout.
Isn't there a way (via macros?) to —after I spent some time on a dataset, applied a structure algorithm, calculated Modularity values, colored the clusters, saved the project, and after a few weeks— update the dataset (adding new edges or nodes), import it and have the layout automatically adapt to the new info in real time? Is that too ambitious or are there some solutions out there?

2. Thanks a lot! That tip was actually helpful, I could indeed use the in- and out-degrees to distinguish the nodes, as one type of nodes (the tags) only had inward relations. A bit tricky to get the visuals right, but at least those values are easier to generate than by hand.

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