How to Create Only Edges Through OrientDb ETL -


i have csv file, having id1 , id2. id1 , id2 vertex of 2 different classes. want make edge between id1 , id2. can achieved etl?
can add edge configuration of transformers achieve this.

i assume, that

  • the 2 classes a , b
  • a has id1
  • b has id2
  • the class of edge atob
  • a , b instances present in db
  • the atob.csv like

    aid,bid

    a1,b1

    a2,b2

    a2,b3

then following etl config do

{   "source": { "file": { "path": "...\atob.csv" } },   "extractor": { "csv": { } },   "transformers": [     { "merge": {         "joinfieldname": "bid",         "lookup": "b.id2",         "unresolvedlinkaction": "warning" } },     { "vertex": { "class": "b" } },     { "edge": {         "class": "atob",         "joinfieldname": "aid",         "lookup": "a.id1",         "direction": "in" } },     { "field": {         "fieldnames": ["aid", "bid"],         "operation": "remove" } }   ],   "loader": {     "orientdb": {        "dburl": "plocal:../databases/...",        "dbtype": "graph",        "uselightweightedges": false,        "classes": [          { "name": "a", "extends": "v" },          { "name": "b", "extends": "v" },          { "name": "atob", "extends": "e" }        ]     }   } } 

the result be

  • (a1) ➡ (b1)
  • (a2) ➡ (b2)
  • (a2) ➡ (b3)

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -