泰坦图中的克隆顶点

Clone vertex in Titan graph

我正在寻找一种使用 groovy 代码在泰坦图中克隆顶点的方法。 我想要做的是创建一个新的顶点(我们称之为顶点 y),它包含与另一个顶点(我们称之为顶点 x)完全相同的数据。 然后我将创建一个从顶点 y 到顶点 x 的关系,然后删除之前到顶点 x 的关系。

我知道如何获取顶点 x 以及如何 create/delete 关联并添加新顶点。

我唯一的问题是,是否可以克隆一个顶点,如果可以,如何使用 groovy 来完成?

像这样:

提前致谢!

Blueprints 具有将一个元素的 属性 复制到另一个元素的辅助方法:copyProperties

 public static void copyProperties(Element from, Element to)

Copy the properties (key and value) from one element to another. The properties are preserved on the from element. ElementPropertiesRule that share the same key on the to element are overwritten.

Parameters:

  • from - the element to copy properties from
  • to - the element to copy properties to

想不出更简单的方法来做到这一点。