From e5b1d37843d146d733c655e723e58a133c2dd5d7 Mon Sep 17 00:00:00 2001 From: Mingxi Wu Date: Tue, 21 Jan 2025 12:32:27 -0800 Subject: [PATCH] Create q9.gsql --- .../docker/tutorial/4.x/script/q9.gsql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 demos/guru_scripts/docker/tutorial/4.x/script/q9.gsql diff --git a/demos/guru_scripts/docker/tutorial/4.x/script/q9.gsql b/demos/guru_scripts/docker/tutorial/4.x/script/q9.gsql new file mode 100644 index 00000000..d006cd3d --- /dev/null +++ b/demos/guru_scripts/docker/tutorial/4.x/script/q9.gsql @@ -0,0 +1,22 @@ +USE GRAPH financialGraph + +CREATE OR REPLACE QUERY q9 (string acctName) SYNTAX v3 { + + OrAccum EDGE @visited; + + v = SELECT b + FROM (a:Account {name: acctName})-[e:transfer]->(b:Account) + ACCUM e.@visited += TRUE; + + v = SELECT b + FROM (a:Account)-[e:transfer]->(b:Account) + WHERE NOT e.@visited; + + //output each v and their static attribute and runtime accumulators' state + PRINT v; + +} + +//it is only supported for single node, or single node mode in distributed enviroment +install query -single q9 +run query q9("Jenny")