Importing CSV for Timeline

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
jdrouin
Posts:3
Joined:15 Apr 2011 19:37
[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
Importing CSV for Timeline

Post by jdrouin » 15 Apr 2011 19:54

I am trying to figure out how to import a CSV file containing bibliographic data and dates, and to generate a dynamic graph with those dates.

I created a new project and then, in the Data Laboratory, clicked on the Import CSV button. I can see all the columns of my CSV file and their data, which from left to right include Publication Date, Author, Title, Tag, Genre, Magazine. I followed the steps listed here -- http://wiki.gephi.org/index.php/Import_ ... e_Interval -- to use the Merge Columns manipulator to convert the publication dates (which are in mm/dd/yyyy format) to a column of Time Intervals. All seems to work fine.

My problem is that the graph then does not register these changes. In fact, it doesn't even import them to draw edges and nodes, as it would if I simply go to File > Open and select my CSV file.

So I guess I have two questions:

1. How do I have Gephi compute the relationships among my CSV data when I do the import through the Data Laboratory?
2. How do I get it to create a timeline from the Time Interval column?

Thanks,

Jeff

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 CSV for Timeline

Post by eduramiba » 15 Apr 2011 21:19

Hi Jeff,

It seems you are only getting nodes imported, right?

The import CSV was designed as a simple extra tool for importing data.
To import nodes/edges you need to have 2 separate files, one for nodes and one for edges.

In order to import edges you need to have a csv with at least source and target columns, and these columns need the ids of the nodes (existing in your nodes csv or not).

jdrouin
Posts:3
Joined:15 Apr 2011 19:37
[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 CSV for Timeline

Post by jdrouin » 15 Apr 2011 21:35

Thanks, eduramiba. Yes, it was nodes only. I guess it would be too difficult to generate an edge list manually with a 437-row/6-column spreadsheet. Can you recommend any links that explain how to generate edge lists automatically?

Best,

Jeff

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 CSV for Timeline

Post by eduramiba » 16 Apr 2011 21:27

Um, I don't really know. How is your data formatted? we can see where could links (edges) be extracted and how.

It depends on your needs and what you have. Also consider simple graph formats like .gdf http://gephi.org/users/supported-graph- ... gdf-format or other supported formats (http://gephi.org/users/supported-graph-formats).
All of these are imported with File menu.

Eduardo

ehorlings
Posts:1
Joined:20 Apr 2011 12:24
[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 CSV for Timeline

Post by ehorlings » 20 Apr 2011 12:41

Hi Jeff,

I have recently switched to Gephi for scientometric visualisations. A lot of that involves creating csv-files for nodes and edges.

Re your problems:

Creating an edge list for a 437 by 6 spreadsheet is a cinch. The easiest way to do it is to rearrange your data so that you have 437 rows and the identifier for the first column in column 2, below that (starting in row 438) 437 rows and the identifier for column 2, etc. That is how the edges will be arranged for input into Gephi. Each edge also has to have a type (undirected or directed), which you place in column 3. And it has a weight, which goes in column 4. I have added a sample spreadsheet so you can see how it works.

I generally don't work in spreadsheets, because my graphs tend to have hundreds of thousands of edges. So I usually construct a comma-delineated string that I paste into notepad. But for small files, you can do that in excel or save your spreadsheet as a csv-file.

When you do this for much larger files, do check if Gephi imports all your edges. Sometimes you have try a couple of times. To check open Window Context.

Your nodes should have a similar structure, in a separate csv-file. The minimum you should have is ID,Label after which you can add any attribute you want, including indicators for time.

Hope this helps.

Edwin
Sample edges.xls
Example from matrix to edges
(15KiB)Downloaded 654 times

wadeholmes
Posts:1
Joined:25 May 2011 01:59
[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 CSV for Timeline

Post by wadeholmes » 25 May 2011 02:06

a potentially stupid question that I can't seem to find the answer to - what is the difference betwen directed and undirected in the type?

Also - is there any point to having a value (weight) when the source and target are the same? (does this weight ever get used)

And then I assume to get the values for different times, I just add a "time" column in the csv export part, and then input the time (eg 7am, 8am, 9am etc)

I have my matrix set up pretty much like the excel example above (I am doing car origin and destination surveys and looking for a nice way to display the results, so I am giving Gephi a bash) - and before I go the next step just want to confirm that it is all going to work.

I assume that Gelphi can handle / display different values between the source and target eg a value from 1->2 and a different value from 2->1 (or is this part of the directed / undirected option above??)

Thanks

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