使用DSE v5.0.3,我遇到了丢弃边缘属性的情况。
两个gremlin控制台示例都使用以下架构配置:
gremlin> system.graph('example').create()
==>null
gremlin> :remote config alias g example.g
==>g=example.g
gremlin> schema.propertyKey('notes').Text().single().create()
==>null
gremlin> schema.vertexLabel('person').create()
==>null
gremlin> schema.edgeLabel('knows').properties('notes').create()
==>null
gremlin> schema.edgeLabel('knows').connection('person', 'person').add()
==>null
在以下示例中,删除edge属性会导致边缘本身被删除:
gremlin> person1 = g.addV('person').next()
==>v[{~label=person, community_id=1566048896, member_id=0}]
gremlin> person2 = g.addV('person').next()
==>v[{~label=person, community_id=1062113536, member_id=0}]
gremlin> knows = g.V(person1).addE('knows').to(V(person2)).property('notes', 'online').next()
==>e[{~type=knows, out_vertex={~label=person, community_id=1566048896, member_id=0}, in_vertex={~label=person, community_id=1062113536, member_id=0}, local_id=4cd8f8e2-a6b8-11e6-aa90-df2b21a156a2}][{~label=person, community_id=1566048896, member_id=0}-knows->{~label=person, community_id=1062113536, member_id=0}]
gremlin> g.E(knows)
==>e[{~type=knows, out_vertex={~label=person, community_id=1566048896, member_id=0}, in_vertex={~label=person, community_id=1062113536, member_id=0}, local_id=4cd8f8e2-a6b8-11e6-aa90-df2b21a156a2}][{~label=person, community_id=1566048896, member_id=0}-knows->{~label=person, community_id=1062113536, member_id=0}]
gremlin> g.E(knows).properties('notes')
==>p[notes->online]
gremlin> g.E(knows).properties('notes').drop()
gremlin> g.E(knows)
gremlin>
下一个示例创建相同的数据集,但不是在与addE
步骤相同的遍历中设置'notes'属性,而是在单独的遍历中创建属性。与上面的示例不同,删除'notes'属性会丢弃属性,同时保持边缘不变。
gremlin> person1 = g.addV('person').next()
==>v[{~label=person, community_id=1437137920, member_id=0}]
gremlin> person2 = g.addV('person').next()
==>v[{~label=person, community_id=1317720192, member_id=0}]
gremlin> knows = g.V(person1).addE('knows').to(V(person2)).next()
==>e[{~type=knows, out_vertex={~label=person, community_id=1437137920, member_id=0}, in_vertex={~label=person, community_id=1317720192, member_id=0}, local_id=847ebaf0-a6b8-11e6-aa90-df2b21a156a2}][{~label=person, community_id=1437137920, member_id=0}-knows->{~label=person, community_id=1317720192, member_id=0}]
gremlin> g.E(knows).property('notes', 'online')
==>e[{~type=knows, out_vertex={~label=person, community_id=1437137920, member_id=0}, in_vertex={~label=person, community_id=1317720192, member_id=0}, local_id=847ebaf0-a6b8-11e6-aa90-df2b21a156a2}][{~label=person, community_id=1437137920, member_id=0}-knows->{~label=person, community_id=1317720192, member_id=0}]
gremlin> g.E(knows).properties()
==>p[notes->online]
gremlin> g.E(knows).properties('notes').drop()
gremlin> g.E(knows)
==>e[{~type=knows, out_vertex={~label=person, community_id=1437137920, member_id=0}, in_vertex={~label=person, community_id=1317720192, member_id=0}, local_id=847ebaf0-a6b8-11e6-aa90-df2b21a156a2}][{~label=person, community_id=1437137920, member_id=0}-knows->{~label=person, community_id=1317720192, member_id=0}]
gremlin> g.E(knows).properties()
gremlin>
答案 0 :(得分:1)
感谢Leifur的反馈。这似乎是一个错误,我们已经提交了一个内部JIRA,工程团队正在调查。