Make the find actor path query a little more succinct.
(And more importantly, this appears to work in kuzu v0.9.0 where the other did not.) FossilOrigin-Name: c1e6439201139141d0746577a70fb21ec1aee39247a9d12cc1ff81e6b572e84a
This commit is contained in:
parent
c46d76ea4a
commit
29469dc9d4
2 changed files with 1 additions and 5 deletions
|
|
@ -16,7 +16,6 @@ import
|
||||||
std/math,
|
std/math,
|
||||||
std/os,
|
std/os,
|
||||||
std/sequtils,
|
std/sequtils,
|
||||||
std/strutils,
|
|
||||||
std/strformat
|
std/strformat
|
||||||
import kuzu
|
import kuzu
|
||||||
|
|
||||||
|
|
@ -56,9 +55,7 @@ if res.getNext[0].toInt64 < 1:
|
||||||
quit 1
|
quit 1
|
||||||
|
|
||||||
stmt = conn.prepare """
|
stmt = conn.prepare """
|
||||||
MATCH (a:Actor {name:$fromActor})
|
MATCH path = (a:Actor {name:$fromActor})-[r:ActedIn* ALL SHORTEST]-(b:Actor {name:$toActor})
|
||||||
MATCH (b:Actor {name:$toActor})
|
|
||||||
MATCH path = (a)-[r:ActedIn* ALL SHORTEST]-(b)
|
|
||||||
RETURN DISTINCT nodes(path) AS nodes, length(path) AS hops
|
RETURN DISTINCT nodes(path) AS nodes, length(path) AS hops
|
||||||
ORDER BY hops
|
ORDER BY hops
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
# See: https://developer.imdb.com/non-commercial-datasets/
|
# See: https://developer.imdb.com/non-commercial-datasets/
|
||||||
|
|
||||||
import
|
import
|
||||||
std/dirs,
|
|
||||||
std/os,
|
std/os,
|
||||||
std/sequtils,
|
std/sequtils,
|
||||||
std/strformat,
|
std/strformat,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue