GET SUBGRAPH WITH PROP 1 STEPS... YIELD VERTICES as v | \
YIELD $-.v as v WHERE all(i IN $-.v WHERE i.HiveTable.safety== "s3")
貌似这个过滤条件只针对了起点(也就是0层),往下一层/n层的节点全部被过滤掉了。
我使用了如下语句,可以成功过滤,但是丢失了下游节点的层数信息(某个节点是下游第几层的)
GET SUBGRAPH WITH PROP 1 STEPS ... YIELD VERTICES AS v | \
UNWIND $-.v AS v | \
YIELD id($-.v) AS vid WHERE $-.v.HiveTable.safety == "S2"
问题二:另外想确认一下是否可以针对边也一起过滤?比如:
GET SUBGRAPH WITH PROP 1 STEPS... YIELD EDGES AS e | \
YIELD $-.e as e WHERE all(i IN $-.e WHERE src($-.e).HiveTable.safety == "S2" AND dst($-.e).HiveTable.safety == "S2" )
上面的语句需要把起点排除,不然 all 中的结果确实都含有一个 false,可以按照如下的方式修改:
GET SUBGRAPH WITH PROP 1 STEPS... YIELD VERTICES as v | \
YIELD $-.v as v WHERE all(i IN $-.v WHERE i.HiveTable.safety== "s3" or id(i)=="bdsp:hivetb:id:xxxxxx")
你再试试看,如果不清楚 all 中的值对不对,可以通过下面的方式来调试:
GET SUBGRAPH WITH PROP 1 STEPS... YIELD VERTICES as v | \
YIELD [i IN $-.v | i.HiveTable.safety== "s3" or id(i)=="bdsp:hivetb:id:xxxxxx"]