【问题标题】:How to store result of query (ODocument List) in orientdb graphdatabase?如何将查询结果(ODocument 列表)存储在 orientdb 图形数据库中?
【发布时间】:2013-09-30 21:04:32
【问题描述】:

我是 orientDB 的新手,需要一些帮助:( 我使用 orientDB 来存储一些大图,有时我需要使用简单的选择查询。它有效,我可以获取并打印我的查询结果,但我们想将它存储在新的图形数据库中。这很重要,因为我们需要将这个新的“查询”数据库导出为 graphml 文件以供项目的后续步骤使用。我可以这样做吗?如果不是,为什么 - 如果是,如何? :) 这里有一段代码

    OGraphDatabase maindatabase = new OGraphDatabase(ishod);
    OGraphDatabase resultgraphdb = new OGraphDatabase(resultname);
   maindatabase.open("admin", "admin");

    List<ODocument> resultlist = maindatabase.query(new OSQLSynchQuery("select from V limit 20"));              //It's works fine, size of this list = 20    

    for (int i = 0; i < resultlist.size(); i++) {
     //MY PROBLEMS ARE HERE - HOW TO IMPORT resultlist TO resultgraphbd

    }

谢谢。

【问题讨论】:

    标签: graph orientdb tinkerpop


    【解决方案1】:

    您可以打开 2 个数据库实例并在数据库之间移动记录。请注意在执行任何操作之前手动设置当前数据库:

    https://github.com/orientechnologies/orientdb/wiki/Java-Multi-Threading

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-12
      • 1970-01-01
      • 2013-11-20
      • 2012-06-12
      • 2021-11-09
      • 1970-01-01
      • 2021-12-28
      相关资源
      最近更新 更多