[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 •Importing GML using 0.9.1 API
Page 1 of 1

Importing GML using 0.9.1 API

Posted: 27 Jul 2017 18:46
by rlb.graph
I'm in the process of upgrading from Gephi Toolkit version 0.8.7 to 0.9.1 and have hit a block.

I have a multi-threaded application and when you pound on it the threads can get stuck in Gephi code. Specifically, I reuse a named workspace so that old models are not kept in memory - if the model exists it gets cleared before adding new nodes.

In the 0.9.1 API there is a new way to create GraphModels which I really like:

GraphModel model = GraphModel.Factory.newInstance();

I am hoping this will fix my problem because there is no obvious connection to a workspace (maybe this is not a correct assumption).

My block is that I cannot figure out how to import data (e.g. from *.gml files) without relying on the following code, which still has a dependency on workspaces:

ImportController importController = Lookup.getDefault().lookup(ImportController.class);
Container container = this.importController.importFile(file);
importController.process(container, new DefaultProcessor(), workspace);

Is there any way to import data from a file without using a workspace? I tried using GraphModel.Serialization but it does not like *.gml as input.

Or, is there a better design pattern for rapidly building and discarding GraphModels in memory? My application builds GraphModels based on what rows of a table the user has selected.

Thanks very much for any assistance.

Re: Importing GML using 0.9.1 API

Posted: 30 Jul 2017 21:42
by eduramiba
Hi,
You still need to use the controllers for Gephi features. Check example https://github.com/gephi/gephi-toolkit- ... xport.java

That factory is part of the new core for graphs, graphstore, which is used by Gephi: https://github.com/gephi/graphstore