简体   繁体   English

通过ETL在同一类中创建边缘

[英]Create Edges by ETL in same Class

1) Class Items with ItemId and Name ready in the database. 1)在数据库中准备好具有ItemId和Name的Class Items。 2) CSV-file: two columns, 2)CSV文件:两列,

ItemId1,ItemId2001

ItemId1,ItemId2345

ItemId1,ItemId2381

... ...

ItemId2,ItemId8393

ItemId2,ItemId8743

.. etc. ..等

Question: 题:

How to define a ETL json-file to create Edges between ItemId1 and all the ItemId's in col#2, and between ItemId2 and its col#2-peers. 如何定义一个ETL json文件,以在ItemId1和col#2中的所有ItemId之间以及ItemId2及其col#2-peers之间创建Edges。

I tried to reproduce your problem. 我试图重现您的问题。

I had this Items 我有这个项目

在此处输入图片说明

and with this code I connected them 并用这段代码将它们连接起来

{
  "source": { "file": { "path": "myPath/item.csv" } },
  "extractor": {"row": {}},
    "transformers": [{
        "csv": {
            "separator": ","
        }
    },
    {
    "command" : {
            "command" : "create edge from (select from Item where idItem= '${input.idItem1}') to (select from Item where idItem= '${input.idItem2}')",
            "output" : "edge"
        }
    }
  ],
  "loader": {
    "orientdb": {
       "dbURL": "plocal:myPath/myDb",
       "dbType": "graph"
    }
  }
}

and I got 我得到了

在此处输入图片说明

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM