1
我必須將數據從JSON文件映射到DSE。 一切工作正常,但我沒有找到任何有關如何映射連接到不同節點但共享相同標籤的邊緣的文檔。DSE圖形加載器映射邊緣
實施例:
[A:Car] -- [OWNER] --> [B:Person]
[C:Car] -- [OWNER] --> [D:Company]
我嘗試不同的方法,最後我添加了明確地描述了類的節點的自定義字段:
數據樣本
// Nodes
{"id":"A","label":"Car"}
{"id":"B","label":"Person"}
{"id":"C","label":"Car"}
{"id":"D","label":"Company"}
// Edges
{"out":"A","label":"OWNER","in":"B", "outLabel":"Car","inLabel":"Person"}
{"out":"C","label":"OWNER","in":"D", "outLabel":"Car","inLabel":"Company"}
這是映射腳本
load(nodesInput).asVertices {
labelField "label"
key "id"
}
load(edgesInput).asEdges {
label "OWNER"
outV "out", {
key "id"
label "Car"
}
inV "in", {
key "id"
labelField "inLabel" <-- this declaration seems to fail
}
}
有什麼想法?
謝謝,我會試試看。 –
它似乎沒有工作。屬性「inLabel」不被識別爲「it」對象中的鍵。 –