【发布时间】:2019-07-04 08:46:55
【问题描述】:
在 Amazon Neptune 中,我想在 Java 中将多个 Gremlin 命令作为单个事务运行。该文档说不支持 tx.commit() 和 tx.rollback() 。它表明这一点 - 由分号 (;) 或换行符 (\n) 分隔的多个语句包含在单个事务中。
文档中的示例显示 Java 支持 Gremlin,但我不明白如何“用分号分隔多个语句”
GraphTraversalSource g = traversal().withRemote(DriverRemoteConnection.using(cluster));
// Add a vertex.
// Note that a Gremlin terminal step, e.g. next(), is required to make a request to the remote server.
// The full list of Gremlin terminal steps is at https://tinkerpop.apache.org/docs/current/reference/#terminal-steps
g.addV("Person").property("Name", "Justin").next();
// Add a vertex with a user-supplied ID.
g.addV("Custom Label").property(T.id, "CustomId1").property("name", "Custom id vertex 1").next();
g.addV("Custom Label").property(T.id, "CustomId2").property("name", "Custom id vertex 2").next();
g.addE("Edge Label").from(g.V("CustomId1")).to(g.V("CustomId2")).next();
【问题讨论】:
标签: amazon-neptune