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