LoginSignup
1
1

More than 1 year has passed since last update.

Amazon NeptuneフォーマットのcsvをGremlinロード形式に変換する

Last updated at Posted at 2022-03-02

こちらのツールを使います。

以下のcsvファイルを入力にしてみます。

air-routes-latest-edges.csv
~id,~from,~to,~label,dist:int
3748,1,3,route,809
3749,1,4,route,214
3750,1,5,route,945
3751,1,6,route,576

実行

% python csv-gremlin.py air-routes-latest-edges.csv > air-routes-latest-edges

Processing Summary
------------------
Rows=5, IDs=4, Duplicate IDs=0, Vertices=0, Edges=4, Properties=4, Errors=0
%

結果

air-routes-latest-edges
g
.addE("route").property(id,"3748").from(V("1")).to(V("3")).property("dist",809)
.addE("route").property(id,"3749").from(V("1")).to(V("4")).property("dist",214)
.addE("route").property(id,"3750").from(V("1")).to(V("5")).property("dist",945)
.addE("route").property(id,"3751").from(V("1")).to(V("6")).property("dist",576)

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1