无法更改 AgnsGraph 上顶点的标签。
但是,您可以尝试添加具有相同属性的新顶点并删除旧顶点。
agens=# create (:v1{id:1})-[:e1{id:3}]->(:v1{id:2});
GRAPH WRITE (INSERT VERTEX 2, INSERT EDGE 1)
agens=# match p = ( (n1)-[r1]->(n2) ) return p;
p
---------------------------------------------------------------
[v1[3.1]{"id": 1},e1[4.1][3.1,3.2]{"id": 3},v1[3.2]{"id": 2}]
(1 row)
agens=# match (n1:v1{id:1})-[r1:e1]->(n2) create (n3:v2)-[r2:e1]->(n2) set n3 = properties(n1), r2 = properties(r1) delete r1, n1;
GRAPH WRITE (INSERT VERTEX 1, INSERT EDGE 1, DELETE VERTEX 1, DELETE EDGE 1, UPDATE PROPERTY 2)
agens=# match p = ( (n1)-[r1]->(n2) ) return p;
p
---------------------------------------------------------------
[v2[5.1]{"id": 1},e1[4.2][5.1,3.2]{"id": 3},v1[3.2]{"id": 2}]
(1 row)