1

我在 Eclipse Java 中使用 Neo4j API 和 Gephi API,我想将我的 Neo4j 数据库导入 Gephi,我正在使用这部分代码

//Import file
 String URL = "/res/test.graphdb";  
 Container container;
 try {
      File file = new File(getClass().getResource(URL).toURI());
      container = importController.importFile(file);
      container.getLoader().setEdgeDefault(EdgeDefault.UNDIRECTED);   
 } catch (Exception ex) {
      ex.printStackTrace();
      System.out.println(e);
      return;
 }

当我执行代码时,它显示此错误:

java.lang.NullPointerException

因为变量容器总是等于null。但是当我在 URL 中使用文件 .gexf 或 .gml 时,它可以完美运行。

所以这是我的问题:

有没有办法在 Gephi API 中使用 Neo4j 数据库?或将 Neo4j 数据库转换为 .graphml 或 .gexf 以将其与 Gephi API 一起使用?

4

0 回答 0