-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypher_text.py
33 lines (26 loc) · 1.07 KB
/
cypher_text.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
create_movie_cypher = """
MERGE (m:Movie {index: $index, title: $original_title})
SET m.budget = $budget,
m.original_language = $original_language,
m.overview = $overview,
m.revenue = $revenue,
m.status = $status,
m.title = $title,
m.vote_average = $vote_average,
m.vote_count = $vote_count
WITH m
FOREACH (genre IN $genresList |
MERGE (g:Genre {name: trim(genre)})
MERGE (m)-[:IN_GENRE]->(g))
MERGE (d:Person {name: $director})
MERGE (d)-[:DIRECTED]->(m)
// Relationships with Budget, Revenue, Language, and Status
MERGE (b:Budget {amount: $budget})
MERGE (m)-[:COST]->(b)
MERGE (r:Revenue {amount: $revenue})
MERGE (m)-[:GROSSED {weight: 0.8}]->(r)
MERGE (l:Language {name: $original_language})
MERGE (m)-[:LANGUAGE_ACTED_IN {weight: 0.5}]->(l)
MERGE (s:Status {name: $status})
MERGE (m)-[:CURRENT_STATUS {weight: 1.0}]->(s)
"""