Importing GML using 0.9.1 API

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
rlb.graph
Posts:2
Joined:23 Jun 2016 21:44
[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 GML using 0.9.1 API

Post by rlb.graph » 27 Jul 2017 18:46

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.

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 GML using 0.9.1 API

Post by eduramiba » 30 Jul 2017 21:42

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

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