0

在 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

在以下示例中,删除边缘属性会导致边缘本身被删除:

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>

下一个示例创建相同的数据集,但不是在与步骤相同的遍历中设置“notes”属性addE,而是在单独的遍历中创建属性。与上面的示例不同,删除“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> 
4

1 回答 1

1

感谢您的反馈 Leifur。这似乎是一个错误,我们已经提交了内部 JIRA,工程团队正在调查。

于 2016-11-10T15:01:16.050 回答