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