C# 当部分查询不返回任何结果时,Gremlin查询不返回任何结果
我有一个gremlin查询,它找到了我想要归档的顶点,但它返回的是一个空数组 我的图形是以一个顶点可以有多个父节点和子节点的方式布置的。当一个顶点被归档时,它需要归档所有受影响的子体,这些子体将被此过程“孤立”。如果任何子体都有一条返回中心顶点的路径,则不应将其存档,因为它不会“孤立”C# 当部分查询不返回任何结果时,Gremlin查询不返回任何结果,c#,.net,azure-cosmosdb,gremlin,azure-cosmosdb-gremlinapi,C#,.net,Azure Cosmosdb,Gremlin,Azure Cosmosdb Gremlinapi,我有一个gremlin查询,它找到了我想要归档的顶点,但它返回的是一个空数组 我的图形是以一个顶点可以有多个父节点和子节点的方式布置的。当一个顶点被归档时,它需要归档所有受影响的子体,这些子体将被此过程“孤立”。如果任何子体都有一条返回中心顶点的路径,则不应将其存档,因为它不会“孤立” g.V(itemId) // Find the item to delete. .union(
g.V(itemId) // Find the item to delete.
.union( // Start a union to return
g.V(itemId), // both the item
g.V(itemId) // and its descendants.
.repeat(__.inE('memberOf').outV().store('x')) // Find all of its descendants.
.cap('x').unfold() // Unfold them.
.where(repeat(out('memberOf') // Check each descendant
.where(hasId(neq(itemId))).simplePath()) // to see if it has a path back that doesn't go through the original vertex
.until(hasId(centralId))) // that ends at the central vertex .
.aggregate('exception') // Aggregate these together.
.select('x').unfold() // Get all the descendants again.
.where(without('exception'))) // Remove the exceptions.
.property('deleted', true) // Set the deleted property.
.valueMap(true) // Rteurn the results.
当它发现一些子体有返回到中心顶点的路径,而这些路径没有经过原始顶点时,它就会工作并返回它应该返回的所有结果。但是,如果它找不到任何具有返回路径的子代,那么理论上它应该返回所有的子代。相反,它返回一个空数组。我的猜测是,在遍历的那个阶段之后,它被卡住了,因为它什么也找不到,所以不能继续前进
如果在那个阶段没有发现任何东西,我如何返回所有的后代
有关图表的示例,请参见。更改行:
.select('x').unfold()
致:
.cap('x').unfold()