JanusGraph / janusgraph

JanusGraph: an open-source, distributed graph database
https://janusgraph.org
Other
5.28k stars 1.17k forks source link

As and Select do not work as expected #2654

Closed ntrhieu89 closed 3 years ago

ntrhieu89 commented 3 years ago

Hi, I have two queries below to add vertices if not exists (in this case, both vertices were there):

gremlin> g.V().hasLabel('employee').has('employeeId', 8).fold().coalesce(unfold(), addV('employee').property('employeeId', 8)).as('v0')
==>v[368640]

gremlin> g.V().hasLabel('employee').has('employeeId', 18).fold().coalesce(unfold(), addV('employee').property('employeeId', 18)).as('v1')
==>v[372736]

But when I combine them into a single graph traversal and use select step, none of the above vertices returned.

g.V().hasLabel('employee').has('employeeId', 8).fold().coalesce(unfold(), addV('employee').property('employeeId', 8)).as('v0') .V().hasLabel('employee').has('employeeId', 18).fold().coalesce(unfold(), addV('employee').property('employeeId', 18)).as('v1').select('v0', 'v1')

Could you confirm whether it is a bug, or am I missing something? The JanusGraph version in the test is 0.5.3.

Thanks,

li-boxuan commented 3 years ago

This is not a JanusGraph problem. Asking in the TinkerPop user group would be a better idea.

Tip: use TinkerGraph.open() to open a TinkerGraph (standard in-memory TinkerPop graph) so that you can test whether an issue is related to JanusGraph or TinkerPop (gremlin) in general.