Hello!I'm a newbie to OrientDB, I'm currently writing my thesis about graph databases.
I have some data which I would like to import into OrientDB.
I have info about Users:
ID, LAST_YEAR_INCOME, DATE_OF_BIRTH, STATE
0, 10000, 1990.08.11, Arizona
1, 12234, 1976.11.07, Missouri
2, 21322, 1978.01.01, Minnesota
3, 33333, 1960.05.05, Iowa
And data about relationships between them:
ID, PARENT_ID
0, 0
1, 0
2, 0
3, 1
I would like to create a tree structure from it.
I have written the following ETL json files:
users_etl.json
{
"source": { "file": { "path": "users.csv" } },
"extractor": { "row": {} },
"transformers": [
{ "csv": {} },
{ "vertex": { "class": "User" } }
],
"loader": {
"orientdb": {
"dbURL": "plocal:/home/user/orientdb/databases/thesis",
"dbType": "graph",
"classes": [
{"name": "User", "extends": "V"},
{"name": "ParentOf", "extends": "E"}
], "indexes": [
{"class":"User", "fields":["ID:Long"], "type":"UNIQUE" },
]
}
}
}
And rel_etl.json:
{
"source": { "file": { "path": "rel.csv" } },
"extractor": { "row": {} },
"transformers": [
{ "csv": {} },
{ "edge": { "class": "ParentOf",
"joinFieldName": "PARENT_ID",
"lookup": "User.ID",
"direction": "out",
}
}
],
"loader": {
"orientdb": {
"dbURL": "plocal:/home/user/orientdb/databases/thesis",
"dbType": "graph",
"classes": [
{"name": "ParentOf", "extends": "E"}
]
}
}
}
I would like to do User extends V object connected by ParentOf extends E objects,
by ID --> PARENT_ID connection.
The User objects are imported successfully but I can't get it working on the Edges.
I've found
this thread, but I can't get the command working either unfortunately.
Could you please help me getting this import done?
What am I doing wrong? The CSV import documentation one the site is kind of poorish, I can't really get it working.
Thank you!