Skip to content

Commit d5357d0

Browse files
committed
Cypher: Fix Q14
1 parent f633c3d commit d5357d0

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

cypher/queries/interactive-complex-14.cypher

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@
66
27 AS person2Id
77
}
88
*/
9-
// Check whether a path exists -- if there is no path, the query will return an empty result
10-
MATCH
11-
(person1:Person {id: $person1Id}),
12-
(person2:Person {id: $person2Id}),
13-
path = shortestPath((person1)-[:KNOWS*]-(person2))
9+
CALL gds.graph.drop('q14graph', false)
10+
YIELD graphName
1411

1512
// ----------------------------------------------------------------------------------------------------
16-
WITH person1, person2
13+
WITH count(*) AS dummy
1714
// ----------------------------------------------------------------------------------------------------
1815

19-
CALL gds.graph.drop('q14graph', false)
20-
YIELD graphName
16+
// Check whether a path exists -- if there is no path, the query will return an empty result
17+
MATCH
18+
path = shortestPath((person1 {id: $person1Id})-[:KNOWS*]-(person2 {id: $person2Id}))
2119

2220
// ----------------------------------------------------------------------------------------------------
23-
WITH person1, person2
21+
// the actual values are not important,
22+
// we are only interested in whether there is a row or not
23+
WITH 42 AS dummy
2424
// ----------------------------------------------------------------------------------------------------
2525

26+
MATCH (person1:Person {id: $person1Id}), (person2:Person {id: $person2Id})
2627
CALL gds.graph.project.cypher(
2728
'q14graph',
2829
'MATCH (p:Person) RETURN id(p) AS id',

0 commit comments

Comments
 (0)