Orientdb导入csv作为图形从属性指定节点

时间:2017-06-28 10:53:29

标签: csv graph import attributes orientdb

我是Orientdb的新手,我有这个csv文件:

"id","p","p2","s"
"1","568703.LGG_00001","568703.LGG_01682",282
"2","568703.LGG_00001","568703.LGG_01831",183
"3","568703.LGG_00001","568703.LGG_01491",238
"4","568703.LGG_00001","568703.LRHM_1319",475

我尝试将其导入为图形,并指定顶点为p1和p2属性。并且将使用s字段创建边缘。 首先,我想到了创建顶点,然后通过创建边来继续。但我找不到从属性中指定vetices的线索。

我尝试的是:

{
  "source": { "file": { "path": "C:/Users/M/Desktop/files/file22/file.csv" } },
  "extractor": { "csv": {"separator": ","}},
  "transformers": [
    {
     "vertex": { "class": "nodes" } }

  ],
  "loader": {
    "orientdb": {

       "dbURL": "plocal:/tmp/databases/db/db1",
       "dbType": "graph",
       "classes": [
         {"name": "nodes", "extends": "V"},


       ]


    }
  }
}

Nw每行都作为顶点变形,这不是我想要的。我需要它p1,p2是顶点,s应该是顶点的属性 我想代码中缺少一些逻辑。

**架构:**

P1 ---- HAS-分数---> P2 (Has_score:将属性s作为属性)

任何帮助都将不胜感激。

0 个答案:

没有答案