Я попробовал ваше дело, и оно сработало
database.json
[
{
"name": "Joe",
"id": 1,
"friends": [2,4,5],
"enemies": [6]
},
{
"name": "Suzie",
"id": 2,
"friends": [1,4,6],
"enemies": [5,2]
}
]
import.json
{
"config": {
"log": "debug"
},
"source" : {
"file": { "path": "database.json" }
},
"extractor" : {
"json": {}
},
"transformers" : [
{ "merge": { "joinFieldName": "id", "lookup": "Account.id" } },
{ "vertex": { "class": "Account"} },
{ "edge": {
"class": "Friend",
"joinFieldName": "friends",
"lookup": "Account.id",
"unresolvedLinkAction": "CREATE"
} },
{ "edge": {
"class": "Enemy",
"joinFieldName": "enemies",
"lookup": "Account.id",
"unresolvedLinkAction": "CREATE"
} } ], "loader" : {
"orientdb": {
"dbURL": "remote:localhost/db_name",
"serverUser": "server_username",
"serverPassword": "server_password",
"dbUser": "db_username",
"dbPassword": "db_password",
"dbAutoDropIfExists": true,
"dbAutoCreate": true,
"standardElementConstraints": false,
"tx": false,
"wal": false,
"batchCommit": 1000,
"dbType": "graph",
"classes": [{"name": "Account", "extends":"V"}, {"name": "Friend", "extends":"E"}, {"name": 'Enemy', "extends":"E"}],
"indexes": [{"class":"Account", "fields":["id:integer"], "type":"UNIQUE_HASH_INDEX" }]
} } }
Затем я запустил oetl.bat import.json, и вот что я получаю:
select from V
+----+-----+-------+----+-------------+-----+-------+-------+-------------------+-------------+--------+
|# |@RID |@CLASS |id |in_Friend |name |friends|enemies|out_Friend |out_Enemy |in_Enemy|
+----+-----+-------+----+-------------+-----+-------+-------+-------------------+-------------+--------+
|0 |#17:0|Account|2 |[#21:0] |Suzie|[1,4,6]|[5,2] |[#24:0,#21:1,#22:1]|[#26:0,#27:0]|[#27:0] |
|1 |#17:1|Account|6 |[#22:1] | | | | | |[#25:0] |
|2 |#18:0|Account|1 |[#24:0] |Joe |[2,4,5]|[6] |[#21:0,#22:0,#23:0]|[#25:0] | |
|3 |#19:0|Account|4 |[#22:0,#21:1]| | | | | | |
|4 |#20:0|Account|5 |[#23:0] | | | | | |[#26:0] |
+----+-----+-------+----+-------------+-----+-------+-------+-------------------+-------------+--------+
Надеюсь, что это поможет
С уважением