0

The statement is like below:

$src=lookup on table where table.table_name == "da_pubdata_bline_stat_df" ; $dst=lookup on table where table.table_name == "da_pubtb_opt_di" ; FIND shortest PATH WITH PROP FROM $src TO $dst OVER * BIDIRECT;

If I want to find the vid of the table vertex through the table property, and then insert the queried value into the FIND statement to query the path between the two tables. I have written the statement like above, but it gives failed hint. How should the grammar be written?

Checked every detail of the statement and found nothing wrong. Expect to know why the statement I write is wrong.

Lisa Liu
  • 139
  • 1
  • 6

1 Answers1

0

You could either do so with variables like this(to specify the varible with dot):

$v1=lookup on table where table.table_name == “da_pubdata_bline_stat_df” yield id(vertex) as src
$v2=lookup on table where table.table_name == “da_pubtb_opt_di” yield id(vertex) as dst;
FIND shortest PATH WITH PROP FROM $v1.src TO $v2.dst OVER * BIDIRECT;

Or, alternatively, use cypher multiple MATCH(to get start and end node first) together with the shortestPath function.

The shortestPath expression is like:

MATCH p = shortestPath((a:player)-[e:follow*..2]-(b:player))\
        WHERE a.player.age >  45 AND b.player.age < 30 \
        RETURN p;
Wey Gu
  • 575
  • 1
  • 6
  • 11