OrientDB仅使用ETL工具导入边缘 [英] OrientDB import edges only using ETL tool

查看:181
本文介绍了OrientDB仅使用ETL工具导入边缘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用OETL将所有顶点插入到图形中。

I already used the OETL to insert all my Vertex to the graph.

现在,我有一个文件,它以以下方式概述了边缘:

Now I have a file that outlines the edges at the following way:


node_1,rel_type,node_2

11000001,relation_A,10208879

11000001,relation_A,10198662

11000001,relation_B,10159927

11000001,relation_C,10165779

node_1,rel_type,node_2
11000001,relation_A,10208879
11000001,relation_A,10198662
11000001,relation_B,10159927
11000001,relation_C,10165779

如何使用导入

我尝试了以下操作:

"transformers": [
    { "csv": {} },
    { "command" : {
            "command" : "create edge ${rel_type} from (select flatten(@rid) from V where node_id= ${node_1}) to (select flatten(@rid) from V where node_id = ${node_2})",
            "output" : "edge"
        }
    }
  ],

但这无法正常工作,因为它无法解析来自

But this failed to work since it can't parse the values from the csv.

推荐答案

您必须使用t他$ input变量。

You must use the $input variable.

"transformers": [{
        "csv": {
            "separator": ","
        }
    },
    {
    "command" : {
            "command" : "create edge ${input.rel_type} from (select from V where node_id= ${input.node_1}) to (select from V where node_id = ${input.node_2})",
            "output" : "edge"
        }
    }
  ],

对我有用。

希望它会有所帮助。

这篇关于OrientDB仅使用ETL工具导入边缘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆