The expected behavior is to simply import the nodes data from MySQL without change:

MySQL nodes table

However, Gephi is erasing all data from the ID column and replacing it with auto-incremented ID column:

Gephi nodes table after import

leading of course to errors importing the edges:

well, d'uh

Nothing special in the import queries:

Node Query: SELECT * FROM GEPHI_nodes Edge Query: SELECT * FROM GEPHI_edges

2

There are 2 best solutions below

1
neil.millikin On BEST ANSWER

Apparently, when importing from a CSV, Gephi converts to lower case before looking for the 'id' column header:

gephi.io.importer.plugin.file.spreadsheet.process.ImportNodesProcess

lowerCaseHeaders.add(headerName.toLowerCase());

Whereas importing from database:

gephi.io.importer.plugin.database.EdgeListDatabaseImpl

offers no such niceties.

0
neil.millikin On

Note also: When Gephi imports a CSV it tries to impute a data type for each column (which can be over-riden by the user). Thus if numbers are present as text in a CSV column, they are correctly recognized as numeric by Gephi.

The behavior when importing from a database is entirely different, instead Gephi reads the datatype from the table itself. Thus, if a SQL table has numbers stored as text, Gephi won't try to correct it, and in fact gives you no evident means to over-ride this behavior.

As a result, only those certain SQL datatypes as are recognized by Gephi will be correctly imported, and all other datatypes will default to importing as strings. The correctly recognized types are listed below.

Note particularly that DECIMAL columns, not being on this list, will default to string, and thus will not register as numbers for analysis of ranges, etc.

Gephi recognized database imports:

BIGINT, TINYINT, SMALLINT, BOOLEAN, FLOAT, DOUBLE, BIT, REAL