我正在尝试使用OrientDB 3.0.12版在两个已经上传的顶点类A和B的顶点之间创建边。类A具有id1作为存储A1,A2,A3等的属性,类B具有id2作为存储B1,B2,B3等的属性。下面是类及其属性和存储节点的描述。
Class: B
Property: id2
B1
B2
B3
B4
Class: A
Property: id1
A1
A2
A3
A4
我正在使用一个csv文件(edges.csv)查找A和B之间的关系。A和B之间可以有多个多对多链接。以下是csv文件的一些行示例:
fromID toID
A1 B1
A2 B1
A3 B1
A1 B3
但是,问题是仅为上述csv的第一行创建了边。 示例:仅在上述示例中的A1和B1之间创建了一条边线。 我正在使用以下JSON文件创建边缘:
{
"source": { "file": { "path": "../edges.csv" } },
"extractor": { "csv": {
"separator":"," ,
"columns": ["fromID:String","toID:String"]
}
},
"transformers":
[
{
"command": {
"command": "CREATE EDGE relatedto FROM (SELECT FROM A WHERE A.id1 = '${input.fromID}') TO
(SELECT FROM B WHERE B.id2 = '${input.toID}')",
"output": "edge"
}
},
{
"field": { "fieldNames": ["fromID", "toID"], "operation": "remove" }
}
],
"loader": {
"orientdb": {
"dbURL": "plocal:../databases/demodb",
"dbUser": "admin",
"dbPassword": "admin",
"dbType": "graph",
"classes": [{"name": "relatedto", "extends": "E"}]
}
}
}