在gremlin中创建边缘期间添加多个属性

时间:2017-02-16 09:14:54

标签: titan gremlin tinkerpop tinkerpop3

我使用了这个查询

g.V().has('empId','123').as('a').V().has('deptId','567').addE('worksAt').properties('startedOn','17/15/07','title','manager','pay',15000) 

哪个不起作用。

添加单个属性适用于.property步骤

g.V().has('empId','123').as('a').V().has('deptId','567').addE('worksAt').property('startedOn','17/15/07') 

1 个答案:

答案 0 :(得分:2)

不是在一个property步骤中指定所有属性,而是简单地连接多个property - 步骤:

g.V().has('empId','123').as('a').V().has('deptId','567').addE('worksAt').
    property('startedOn','17/15/07').property('title','manager').property('pay',15000)

您的查询未指定边缘应连接哪些顶点。如果您希望边缘使用empId 123 从顶点出来,则必须插入from

g.V().has('empId','123').as('a').V().has('deptId','567').addE('worksAt').from('a').
    property('startedOn','17/15/07').property('title','manager').property('pay',15000)

有关详细信息,请参阅addEdge - 步骤。