Spaces:
Sleeping
Sleeping
Prathamesh1420
commited on
Commit
•
e7addce
1
Parent(s):
3b5cb60
Update app.py
Browse files
app.py
CHANGED
@@ -20,20 +20,18 @@ graph = Neo4jGraph(url=NEO4J_URI, username=NEO4J_USERNAME, password=NEO4J_PASSWO
|
|
20 |
# Load movie dataset into Neo4j
|
21 |
moview_query = """
|
22 |
LOAD CSV WITH HEADERS FROM
|
23 |
-
'https://raw.githubusercontent.com/
|
24 |
-
MERGE(m:Movie{id:row.
|
25 |
-
SET m.
|
26 |
-
m.title = row
|
27 |
-
m.
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
FOREACH (
|
32 |
-
MERGE (
|
33 |
-
MERGE (p)-[:ACTED_IN]->(m))
|
34 |
-
FOREACH (genre in split(row.genres, '|') |
|
35 |
-
MERGE (g:Genre {name:trim(genre)})
|
36 |
MERGE (m)-[:IN_GENRE]->(g))
|
|
|
37 |
"""
|
38 |
graph.query(moview_query)
|
39 |
graph.refresh_schema()
|
|
|
20 |
# Load movie dataset into Neo4j
|
21 |
moview_query = """
|
22 |
LOAD CSV WITH HEADERS FROM
|
23 |
+
'https://raw.githubusercontent.com/Pk-Kolhapurkar/graphdb_neo4j/main/indian%20movies.csv' AS row
|
24 |
+
MERGE (m:Movie {id: row.ID})
|
25 |
+
SET m.year = toInteger(row.Year),
|
26 |
+
m.title = row['Movie Name'],
|
27 |
+
m.timing = toInteger(row['Timing(min)']),
|
28 |
+
m.rating = toFloat(row['Rating(10)']),
|
29 |
+
m.votes = toInteger(row.Votes),
|
30 |
+
m.language = row.Language
|
31 |
+
FOREACH (genre IN split(row.Genre, '|') |
|
32 |
+
MERGE (g:Genre {name: trim(genre)})
|
|
|
|
|
|
|
33 |
MERGE (m)-[:IN_GENRE]->(g))
|
34 |
+
|
35 |
"""
|
36 |
graph.query(moview_query)
|
37 |
graph.refresh_schema()
|