使用顶点 ID 创建边
Creating edge using vertex ids
我正在尝试将数据批量加载到 janusgraph 中。
我正在尝试关注 bulk load recommendations
我正在为 "Add all the edges using the map to look-up JanusGraph’s vertex id and retrieving the vertices using that id"
点 (d) 而苦苦挣扎
我当前的代码 (scala) 看起来像
val key = Key[String]("Key")
val sLabel : StepLabel[Vertex] = StepLabel("target")
case (src, edgeType, dest) =>
graph.V().has(key, dest).as(sLabel).traversal.V().has(key, src).addE(edgeType).to(sLabel).traversal
.property("propertyKey", "propertyValue")
我有源顶点和目标顶点的 vertexId,但我无法弄清楚如何更改此代码以使用 vertexId 创建边。
我对 gremlin 很陌生,如有任何帮助,我们将不胜感激。
case (idSrc, edgeType, idDest) =>
g.V(idSrc).as("a").V(idDest).addE(edgeType).from("a")
我正在尝试将数据批量加载到 janusgraph 中。 我正在尝试关注 bulk load recommendations 我正在为 "Add all the edges using the map to look-up JanusGraph’s vertex id and retrieving the vertices using that id"
点 (d) 而苦苦挣扎我当前的代码 (scala) 看起来像
val key = Key[String]("Key")
val sLabel : StepLabel[Vertex] = StepLabel("target")
case (src, edgeType, dest) =>
graph.V().has(key, dest).as(sLabel).traversal.V().has(key, src).addE(edgeType).to(sLabel).traversal
.property("propertyKey", "propertyValue")
我有源顶点和目标顶点的 vertexId,但我无法弄清楚如何更改此代码以使用 vertexId 创建边。
我对 gremlin 很陌生,如有任何帮助,我们将不胜感激。
case (idSrc, edgeType, idDest) =>
g.V(idSrc).as("a").V(idDest).addE(edgeType).from("a")