Skip to content

Commit

Permalink
add movie sample queries
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglei1949 committed Sep 26, 2023
1 parent 00ae7bf commit 956cbd0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flex/interactive/bin/gs_interactive
Original file line number Diff line number Diff line change
Expand Up @@ -1645,8 +1645,8 @@ function do_compile() {
if [ ! -f "${HOST_DB_TMP_DIR}/.enable" ]; then
touch "${HOST_DB_TMP_DIR}/.enable"
fi
# check if the stored_procedure_name is already in .enable
if grep -q "${stored_procedure_name}" "${HOST_DB_TMP_DIR}/.enable"; then
# check if the stored_procedure_name is already in .enable, exact match
if grep -q "^${stored_procedure_name}$" "${HOST_DB_TMP_DIR}/.enable"; then
err "stored_procedure_name [${stored_procedure_name}] already exists, please use another name"
exit 1
fi
Expand Down
2 changes: 2 additions & 0 deletions flex/interactive/examples/movies/acted_in.cypher
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MATCH (actor:Person {name: $actorName})-[:ACTED_IN]->(movie:Movie)
RETURN actor.name, movie.title, movie.tagline, movie.release;
2 changes: 2 additions & 0 deletions flex/interactive/examples/movies/actor.cypher
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MATCH (actor:Person {name: $actorName})
RETURN actor.id, actor.born, actor.name;
3 changes: 3 additions & 0 deletions flex/interactive/examples/movies/coactors.cypher
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MATCH (tom:Person {name:$actorName})-[:ACTED_IN]->(m:Movie)<-[:ACTED_IN]-(coActors)
RETURN m.title AS movieTitle, m.release AS releasedYear, coActors.name AS coActorName
ORDER BY releasedYear DESC, movieTitle ASC LIMIT 10;
5 changes: 5 additions & 0 deletions flex/interactive/examples/movies/colfilter.cypher
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MATCH (actor:Person {name: $actorName})-[:ACTED_IN]->(movie1:Movie)<-[:ACTED_IN]-
(coActor:Person)-[:ACTED_IN]->(movie2:Movie)<-[:ACTED_IN]-(coCoActor:Person)
WHERE actor <> coCoActor
AND NOT (actor)-[:ACTED_IN]->(:Movie)<-[:ACTED_IN]-(coCoActor)
RETURN DISTINCT coCoActor.name LIMIT 10;

0 comments on commit 956cbd0

Please sign in to comment.