Skip to content

Instantly share code, notes, and snippets.

@wware
Last active December 30, 2025 18:40
Show Gist options
  • Select an option

  • Save wware/b8d5c78026da5ff4392c2cf53722e530 to your computer and use it in GitHub Desktop.

Select an option

Save wware/b8d5c78026da5ff4392c2cf53722e530 to your computer and use it in GitHub Desktop.

Graph-RAG with Neo4j and MCP

A hands-on introduction to graph databases using Neo4j's classic movie dataset, accessible through both the Neo4j web interface and AI-powered natural language queries via Cursor IDE.

What Are Graph Databases?

Imagine you're organizing information about movies and actors. A traditional database stores these as separate tables:

Movies Table:        Actors Table:        Acted_In Table:
--------------       --------------       -----------------
| The Matrix |       | Keanu Reeves |     | Movie | Actor |
| Top Gun    |       | Tom Cruise   |     | ...   | ...   |

A graph database stores the same information as connected dots:

(Keanu Reeves) --[ACTED_IN]--> (The Matrix)
(Tom Cruise)   --[ACTED_IN]--> (Top Gun)

Why is this useful?

  • Natural for connected data: "Find actors who worked together"
  • Multi-hop queries: "Find actors who worked with someone who worked with Keanu"
  • Relationships are first-class: They have types (ACTED_IN, DIRECTED) and properties

What is Graph-RAG?

Traditional RAG (Retrieval Augmented Generation) finds relevant text chunks using semantic similarity - like searching "things that sound related."

Graph-RAG uses relationship structures instead:

  • "Who did Tom Hanks work with?" → Follow ACTED_IN relationships
  • "Find connections between Kevin Bacon and Tom Hanks" → Traverse the relationship graph
  • "What movies did directors who worked with Keanu make?" → Multi-hop traversals

The LLM translates natural language into structured graph queries (Cypher), then Neo4j returns exact facts - no hallucinations, just data.

Neo4j: The Graph Database

Neo4j started in 2007 as an early native graph database. Today it's the most popular graph database, used by NASA, Walmart, eBay, and many others for recommendations, fraud detection, knowledge graphs, and more.

Neo4J web UI screenshot

Key Interfaces

  • Port 7474: Web-based Browser UI for visual graph exploration
  • Port 7687: Bolt protocol for programmatic access (what our MCP server uses)

Why Neo4j?

  • Cypher query language: Intuitive, pattern-matching syntax
  • ACID transactions: Reliable like traditional databases
  • Visualization: Built-in tools to see your graph
  • Performance: Optimized for relationship traversal

Cypher Query Language Basics

Cypher uses ASCII-art patterns to describe graph structures:

// Nodes use parentheses
(p:Person {name: 'Tom Hanks'})
       ↑             ↑
     label       property

// Relationships use arrows
(p:Person)-[:ACTED_IN]->(m:Movie)
           ↑
      relationship type

Important Syntax Notes

Variable Scoping with Semicolons:

  • Semicolons end statements and cause variables to fall out of scope
  • Use semicolons to separate independent operations
  • Avoid semicolons when variables need to flow between clauses

MERGE vs CREATE:

  • CREATE always creates new nodes/relationships (can create duplicates)
  • MERGE acts like "CREATE IF NOT EXISTS" (prevents duplicates)
  • Use MERGE when you want to ensure unique entities

Example Queries

Simple lookup:

// Find Tom Hanks
MATCH (p:Person {name: 'Tom Hanks'})
RETURN p;

Follow a relationship:

// What movies did Tom Hanks act in?
MATCH (p:Person {name: 'Tom Hanks'})-[:ACTED_IN]->(m:Movie)
RETURN m.title, m.released
ORDER BY m.released DESC;

Reverse traversal:

// Who directed The Matrix?
MATCH (m:Movie {title: 'The Matrix'})<-[:DIRECTED]-(d:Person)
RETURN d.name;

Multi-hop relationships:

// Who acted with Tom Hanks?
MATCH (tom:Person {name: 'Tom Hanks'})-[:ACTED_IN]->(m:Movie)<-[:ACTED_IN]-(costar)
WHERE costar <> tom
RETURN DISTINCT costar.name
ORDER BY costar.name;

Complex multi-hop with paths:

// Find shortest path between Kevin Bacon and Tom Hanks
MATCH path = shortestPath(
  (bacon:Person {name: 'Kevin Bacon'})-[*..6]-(hanks:Person {name: 'Tom Hanks'})
)
RETURN path;

Aggregation:

// How many movies has each actor been in?
MATCH (p:Person)-[:ACTED_IN]->(m:Movie)
RETURN p.name, COUNT(m) AS movie_count
ORDER BY movie_count DESC
LIMIT 10;

Cross-reference analysis:

// Find directors who also acted
MATCH (p:Person)-[:DIRECTED]->(m1:Movie)
MATCH (p)-[:ACTED_IN]->(m2:Movie)
RETURN p.name, 
       COLLECT(DISTINCT m1.title) AS directed,
       COLLECT(DISTINCT m2.title) AS acted_in;

Setup and Startup

Prerequisites

  • Docker installed
  • Movies dataset (movies.cypher)
  • Cursor IDE or Claude Desktop if you want MCP functionality

Simplified Startup

We'll use Docker directly with Neo4j's official image:

Option A: Simple docker run (recommended)

Create start.sh:

#!/bin/bash

docker run \
  --name neo4j-movies \
  --rm \
  -p 7474:7474 \
  -p 7687:7687 \
  -v $(pwd)/movies.cypher:/import/movies.cypher \
  -e NEO4J_AUTH=neo4j/graphrag123 \
  -e NEO4J_PLUGINS='["apoc"]' \
  -e NEO4J_apoc_import_file_enabled=true \
  -e NEO4J_dbms_security_procedures_unrestricted=apoc.* \
  neo4j:5.15-community

Then after it starts (wait ~30 seconds), load the data:

docker exec neo4j-movies \
  cypher-shell -u neo4j -p graphrag123 \
  "CALL apoc.cypher.runFile('/import/movies.cypher');"

Or load directly:

docker exec neo4j-movies \
  cypher-shell -u neo4j -p graphrag123 \
  < movies.cypher

Option B: Using docker-compose

If you prefer docker-compose, create docker-compose.yml:

version: '3.8'
services:
  neo4j:
    image: neo4j:5.15-community
    container_name: neo4j-movies
    ports:
      - "7474:7474"
      - "7687:7687"
    volumes:
      - ./movies.cypher:/import/movies.cypher
    environment:
      - NEO4J_AUTH=neo4j/graphrag123
      - NEO4J_PLUGINS=["apoc"]
      - NEO4J_apoc_import_file_enabled=true
      - NEO4J_dbms_security_procedures_unrestricted=apoc.*

Then start:

docker-compose up -d

Verify It's Running

Check that Neo4j is ready:

curl http://localhost:7474

You should see HTML output from the Neo4j Browser.

Verify data loaded correctly:

docker exec neo4j-movies \
  cypher-shell -u neo4j -p graphrag123 \
  "MATCH (n) RETURN labels(n), count(n);"

You should see counts for Person and Movie nodes.

Using the Neo4j Web Interface

  1. Open your browser to http://localhost:7474

  2. Login:

    • Username: neo4j
    • Password: graphrag123
  3. Try these queries in the query box:

See the overall graph structure:

MATCH (n) 
RETURN labels(n), count(n);

Visualize a subset of the graph:

MATCH (p:Person)-[r:ACTED_IN]->(m:Movie) 
WHERE m.released >= 1999 AND m.released <= 2000
RETURN p, r, m 
LIMIT 50;

Click on nodes to explore connections visually.

Find all movies from 1999:

MATCH (m:Movie)
WHERE m.released = 1999
RETURN m.title, m.tagline
ORDER BY m.title;

Explore Tom Hanks' career:

MATCH (tom:Person {name: 'Tom Hanks'})-[:ACTED_IN]->(m:Movie)
RETURN tom, m
ORDER BY m.released;

This returns both Tom and his movies as a subgraph you can visualize.

Find co-stars who worked together multiple times:

MATCH (a1:Person)-[:ACTED_IN]->(m:Movie)<-[:ACTED_IN]-(a2:Person)
WHERE a1.name < a2.name  // Avoid duplicates
WITH a1, a2, COLLECT(m.title) AS movies
WHERE SIZE(movies) > 1
RETURN a1.name AS actor1, 
       a2.name AS actor2, 
       movies, 
       SIZE(movies) AS collaboration_count
ORDER BY collaboration_count DESC;

Find prolific directors:

MATCH (d:Person)-[:DIRECTED]->(m:Movie)
WITH d, COUNT(m) AS movie_count, COLLECT(m.title) AS movies
WHERE movie_count > 1
RETURN d.name, movie_count, movies
ORDER BY movie_count DESC;

Degrees of Kevin Bacon:

MATCH path = shortestPath(
  (bacon:Person {name: 'Kevin Bacon'})-[*..6]-(other:Person)
)
WHERE other <> bacon 
  AND any(rel in relationships(path) WHERE type(rel) = 'ACTED_IN')
RETURN other.name, length(path) AS bacon_number
ORDER BY bacon_number, other.name
LIMIT 20;

Find actors who also directed:

MATCH (p:Person)-[:ACTED_IN]->(acted:Movie)
MATCH (p)-[:DIRECTED]->(directed:Movie)
RETURN p.name, 
       COUNT(DISTINCT acted) AS movies_acted,
       COUNT(DISTINCT directed) AS movies_directed,
       COLLECT(DISTINCT directed.title) AS directed_films
ORDER BY movies_directed DESC;

Tips for the Neo4j Browser

  • Double-click nodes to expand their relationships
  • Click "Table" view to see results as a table instead of graph
  • Save queries with the star icon
  • View schema with :schema command
  • Clear canvas with the trash icon
  • Use LIMIT for large result sets to avoid overwhelming the browser

Setting Up Cursor IDE with MCP

The Model Context Protocol (MCP) lets Cursor talk directly to your Neo4j database using natural language.

1. Install the Official Neo4j MCP Server

Download the binary for your OS from: https://github.com/neo4j/mcp/releases

On Linux:

# Download and extract (check for latest version)
wget https://github.com/neo4j/mcp/releases/download/v0.x.x/neo4j-mcp-linux-amd64.tar.gz
tar -xzf neo4j-mcp-linux-amd64.tar.gz

# Move to your PATH
sudo mv neo4j-mcp /usr/local/bin/
chmod +x /usr/local/bin/neo4j-mcp

# Verify installation
neo4j-mcp --version

2. Create MCP Wrapper Script

Create mcp_server_wrapper.sh in your project directory:

#!/bin/bash
# MCP Server Wrapper for Neo4j (stdio mode)

neo4j-mcp \
  --neo4j-uri "bolt://localhost:7687" \
  --neo4j-username "neo4j" \
  --neo4j-password "graphrag123" \
  --neo4j-database "neo4j" \
  --neo4j-read-only false

Make it executable:

chmod +x mcp_server_wrapper.sh

3. Configure Cursor

Create ~/.cursor/mcp.json:

{
  "mcpServers": {
    "neo4j": {
      "command": "/full/path/to/your/mcp_server_wrapper.sh"
    }
  }
}

Replace /full/path/to/your/ with the actual path (e.g., /home/username/graph-project/).

4. Restart Cursor

Completely quit and reopen Cursor (not just reload window).

5. Try Natural Language Queries

Open Cursor Composer (Ctrl+I or Cmd+I) and try:

Check it's working:

"What tools do you have available?"

You should see Neo4j tools listed.

Simple queries:

"What movies did Tom Hanks act in?"

"Show me the database schema"

"Who directed The Matrix?"

Cross-reference queries:

"Find actors who appeared in multiple movies together"

"Show me directors who also acted in movies"

"What movies did Keanu Reeves and Hugo Weaving both appear in?"

Analysis queries:

"Which actor has been in the most movies?"

"Find the shortest connection between Kevin Bacon and Tom Hanks"

"Show me all movies from the 1990s with their directors"

Complex analysis:

"Find actors who worked with both Tom Hanks and Tom Cruise"

"What are the most common actor-director collaborations?"

"Show me actors who appeared in movies across multiple decades"

How It Works

  1. You ask a question in plain English
  2. Cursor's AI translates it to a Cypher query
  3. The MCP server executes it against your Neo4j database
  4. Results come back and Cursor formats them naturally

The AI sees the database schema and knows what's possible. It generates actual Cypher queries - you can even ask it to show you the query it used!

Database Schema

Nodes:

  • Person - Properties: name (string), born (integer)
  • Movie - Properties: title (string), released (integer), tagline (string)

Relationships:

  • [:ACTED_IN] - Person → Movie (can have roles property as array)
  • [:DIRECTED] - Person → Movie
  • [:PRODUCED] - Person → Movie
  • [:WROTE] - Person → Movie

Sample Data Coverage:

  • Classic movies: The Matrix trilogy, Forrest Gump, Top Gun, etc.
  • Popular actors: Tom Hanks, Keanu Reeves, Tom Cruise, Jack Nicholson
  • Notable directors: Steven Spielberg, Rob Reiner, Wachowskis, etc.
  • Cross-connections: Many actors appear in multiple films creating rich graph structure

Next Steps

Explore the data:

  • Find interesting connection paths between actors
  • Discover prolific directors or producers
  • Analyze release year trends and actor career spans

Practice Cypher queries:

  • Start with simple MATCH patterns
  • Progress to multi-hop relationship traversals
  • Experiment with aggregation and filtering

Extend the dataset:

  • Add more movies using the MERGE pattern from movies.cypher
  • Add new relationship types (CINEMATOGRAPHY, MUSIC_BY, etc.)
  • Add movie genres, ratings, budget information

Advanced analysis:

  • Co-occurrence patterns (who works with whom repeatedly)
  • Career timeline analysis (actor's movies by year)
  • Network analysis (find central/influential actors)
  • Genre analysis (if you add genre data)

Experiment with MCP:

  • Ask Cursor to generate complex queries
  • Request data visualization code
  • Have it explain the Cypher it generates
  • Try asking for analysis insights

Troubleshooting

Neo4j won't start:

# Check if ports are already in use
lsof -i :7687
lsof -i :7474

# View logs
docker logs neo4j-movies

# Try stopping any existing Neo4j containers
docker stop $(docker ps -q --filter ancestor=neo4j)

Can't connect to Neo4j Browser:

  • Wait 30-60 seconds after starting - Neo4j takes time to initialize
  • Check http://localhost:7474 (not https)
  • Verify docker container is running: docker ps
  • Check firewall settings

Movies data not loading or syntax errors:

# Check if nodes were created
docker exec neo4j-movies \
  cypher-shell -u neo4j -p graphrag123 \
  "MATCH (n) RETURN labels(n), count(n);"

# If count is 0, ensure you're using the corrected dataset
docker exec neo4j-movies \
  cypher-shell -u neo4j -p graphrag123 \
  < full_movie_dataset_merge.cypher

# Check for syntax errors by running a small subset first

Cursor can't find MCP server:

  • Verify neo4j-mcp is in your PATH: which neo4j-mcp
  • Check the path in ~/.cursor/mcp.json is absolute, not relative
  • Restart Cursor completely (quit and reopen)
  • Check the wrapper script is executable: ls -l mcp_server_wrapper.sh
  • Test the wrapper script manually: ./mcp_server_wrapper.sh

MCP server connection errors:

# Test Neo4j connection manually
docker exec neo4j-movies \
  cypher-shell -u neo4j -p graphrag123 \
  "RETURN 'Connection works' AS status;"

# Verify the bolt port is accessible
telnet localhost 7687

Performance issues with large queries:

  • Use LIMIT clauses when exploring data
  • Add WHERE filters to narrow results
  • Use PROFILE or EXPLAIN to analyze query performance
  • Consider adding indexes for frequently queried properties

Resources


Happy graph querying! 🎬🎥

Start with the Neo4j Browser to see the visual graph, then graduate to natural language queries in Cursor. Both interfaces show the power of graph databases for connected data. Remember that graph databases excel at relationship traversals - questions like "who worked with whom" and "how are X and Y connected" are exactly what graphs are designed for!

1. AWS Deployment and Scaling Strategy

This document outlines a strategy for deploying the Graph-RAG prototype from a local environment to a scalable, production-ready architecture on Amazon Web Services (AWS). The goal is to handle a high volume of data and a high rate of natural language queries.

1. Current Local Architecture

The current prototype runs locally and consists of two main components:

  1. Neo4j Database: A Neo4j instance running inside a Docker container, holding the movie graph data.
  2. MCP Server: A neo4j-mcp server process that connects to the Neo4j database and translates natural language queries from a developer's IDE into Cypher queries.

This setup is excellent for development and prototyping but is not suitable for a production environment due to limitations in scalability, availability, and security.

2. Proposed AWS Production Architecture

To meet the requirements of a production environment, we propose a serverless and managed services-first architecture on AWS. This approach minimizes operational overhead and maximizes scalability and reliability.

Architectural Diagram (High-Level)

                               +-----------------------+
(End Users / Clients) -------> |  Amazon API Gateway   |
                               | (REST API)            |
                               +-----------+-----------+
                                           |
                                           v
                         +-----------------+------------------+
                         |  Application Load Balancer (ALB)  |
                         +-----------------+------------------+
                                           |
                                           v
                  +--------------------------------------------------+
                  |  Amazon ECS on AWS Fargate                       |
                  |                                                  |
                  |  +-----------+     +-----------+     +-----------+
                  |  | MCP Server|     | MCP Server|     | MCP Server|
                  |  | Container |     | Container |     | Container |
                  |  +-----------+     +-----------+     +-----------+
                  |                                                  |
                  |  (Auto-scaling service)                          |
                  +----------------------+---------------------------+
                                         | (VPC Peering or PrivateLink)
                                         v
+------------------+         +--------------------------+        +--------------------------+
|  Amazon S3 Bucket|         |   Neo4j AuraDB on AWS    |        |  AWS Secrets Manager     |
| (for data files) |         |   (Managed Neo4j)        |        | (DB Credentials)         |
+--------+---------+         +--------------------------+        +------------+-------------+
         |                                                                     |
         | (S3 Event Trigger)                                                  |
         v                                                                     |
+--------+---------+         +-------------------------------------------------+
|  AWS Lambda      |         |
|  (Data Processor)|--------->
+------------------+

3. Core Components and Justification

a. Database: Neo4j AuraDB on AWS

  • What it is: A fully managed, cloud-native graph database service for Neo4j.
  • Why we use it:
    • Scalability: AuraDB can be scaled vertically (more resources) and horizontally (read replicas) with zero downtime.
    • High Availability & Durability: It is self-healing, runs across multiple AWS Availability Zones (AZs), and includes automated backups.
    • Reduced Operational Overhead: Eliminates the need to manage servers, patches, backups, or database administration, allowing the team to focus on the application.
    • Security: AuraDB provides end-to-end encryption and is designed with security best practices.

b. Application Layer: AWS Fargate with Amazon ECS

  • What it is: AWS Fargate is a serverless compute engine for containers. Amazon ECS (Elastic Container Service) is a container orchestration service.
  • How it works: We will package the neo4j-mcp server (or a custom Python application that performs the same function) into a Docker container. ECS will run these containers on Fargate.
  • Why we use it:
    • Serverless: No EC2 instances to provision or manage.
    • Scalability: We can configure the ECS service to automatically scale the number of container tasks based on CPU/memory usage or the number of incoming requests. This ensures we can handle high request rates.
    • Resilience: ECS can automatically restart failed containers and distribute tasks across multiple AZs.

c. API Layer: Amazon API Gateway and Application Load Balancer (ALB)

  • What it is: API Gateway is a managed service for creating, publishing, and securing APIs. An ALB distributes incoming application traffic.
  • How it works:
    1. API Gateway serves as the public endpoint for all incoming queries.
    2. It handles authentication (e.g., API keys, IAM, or JWT tokens), throttling, and caching.
    3. It forwards valid requests to the ALB.
    4. The ALB then distributes traffic evenly across the running MCP server containers in Fargate.
  • Why we use it:
    • Security & Control: API Gateway provides a secure front door for our application, protecting it from DDoS attacks and managing access.
    • Scalability: Both services are highly scalable and managed by AWS.
    • Decoupling: It decouples the public-facing API from the backend service, allowing for independent scaling and versioning.

d. Data Ingestion: Amazon S3 and AWS Lambda

  • What it is: S3 is an object storage service. Lambda is a serverless, event-driven compute service.
  • How it works:
    1. The raw data files (like movies.cypher, etc.) are uploaded to a dedicated S3 bucket.
    2. An S3 event trigger is configured to invoke a Lambda function whenever a new file is uploaded.
    3. The Lambda function (written in Python) reads the new file, parses the data, and executes the necessary Cypher queries to load the data into AuraDB.
  • Why we use it:
    • Automation: This creates a fully automated, event-driven data ingestion pipeline, replacing the manual docker exec process.
    • Scalability: Both S3 and Lambda scale automatically to handle large files and a high frequency of updates.
    • Cost-Effective: You only pay for the compute time used by the Lambda function.

e. Security and Configuration

  • AWS Secrets Manager: Used to securely store and manage the credentials for the Neo4j AuraDB instance. The Fargate tasks and Lambda functions will retrieve these credentials at runtime via an IAM role, avoiding hardcoded secrets in the code.
  • Amazon VPC (Virtual Private Cloud): All resources (Fargate, ALB, AuraDB) will be deployed within a VPC to isolate them from the public internet and control network traffic. We can use VPC Peering or AWS PrivateLink to establish a secure connection between the Fargate service and AuraDB.

4. Deployment Workflow

  1. Provision AuraDB: Create a new Neo4j AuraDB instance through the AWS Marketplace or Neo4j's website. Store the credentials in AWS Secrets Manager.
  2. Containerize the Application: Create a Dockerfile for the MCP server application.
  3. Set up Data Ingestion:
    • Create an S3 bucket for data files.
    • Write and deploy a Lambda function that connects to AuraDB and processes the data.
    • Configure the S3 trigger for the Lambda function.
  4. Deploy Application Layer:
    • Define an ECS Task Definition for the MCP container, including IAM roles to access Secrets Manager.
    • Create an ECS Service to run the task on Fargate, with auto-scaling policies.
    • Configure an ALB to route traffic to the ECS service.
  5. Expose the API:
    • Create an API Gateway REST API.
    • Configure a route that integrates with the ALB.
    • Implement authentication and rate limiting as needed.
  6. Load Initial Data: Upload the existing movies.cypher file to the S3 bucket to trigger the initial data load.

This architecture provides a clear path to transforming the local prototype into a secure, scalable, and maintainable production application on AWS.

{
"mcpServers": {
"neo4j": {
"command": "/home/wware/graphrag123/mcp_server_wrapper.sh",
"args": []
}
}
}
#!/bin/bash
# MCP Server Wrapper for Neo4j (stdio)
neo4j-mcp \
--neo4j-uri "bolt://localhost:7687" \
--neo4j-username "neo4j" \
--neo4j-password "graphrag123" \
--neo4j-database "neo4j" \
--neo4j-read-only false \
--neo4j-telemetry true
// Classic Neo4j Movie Graph Dataset - Using Individual MERGE Pattern
// This pattern ensures all nodes exist before relationships are created
// =============================================================================
// MERGE ALL PERSON NODES FIRST
// =============================================================================
MERGE (Keanu:Person {name:'Keanu Reeves', born:1964})
MERGE (Carrie:Person {name:'Carrie-Anne Moss', born:1967})
MERGE (Laurence:Person {name:'Laurence Fishburne', born:1961})
MERGE (Hugo:Person {name:'Hugo Weaving', born:1960})
MERGE (LillyW:Person {name:'Lilly Wachowski', born:1967})
MERGE (LanaW:Person {name:'Lana Wachowski', born:1965})
MERGE (JoelS:Person {name:'Joel Silver', born:1952})
MERGE (Charlize:Person {name:'Charlize Theron', born:1975})
MERGE (Al:Person {name:'Al Pacino', born:1940})
MERGE (Taylor:Person {name:'Taylor Hackford', born:1944})
MERGE (TomC:Person {name:'Tom Cruise', born:1962})
MERGE (JackN:Person {name:'Jack Nicholson', born:1937})
MERGE (DemiM:Person {name:'Demi Moore', born:1962})
MERGE (KevinB:Person {name:'Kevin Bacon', born:1958})
MERGE (KieferS:Person {name:'Kiefer Sutherland', born:1966})
MERGE (NoahW:Person {name:'Noah Wyle', born:1971})
MERGE (CubaG:Person {name:'Cuba Gooding Jr.', born:1968})
MERGE (KevinP:Person {name:'Kevin Pollak', born:1957})
MERGE (JTW:Person {name:'J.T. Walsh', born:1943})
MERGE (JamesM:Person {name:'James Marshall', born:1967})
MERGE (ChristopherG:Person {name:'Christopher Guest', born:1948})
MERGE (RobR:Person {name:'Rob Reiner', born:1947})
MERGE (AaronS:Person {name:'Aaron Sorkin', born:1961})
MERGE (KellyM:Person {name:'Kelly McGillis', born:1957})
MERGE (ValK:Person {name:'Val Kilmer', born:1959})
MERGE (AnthonyE:Person {name:'Anthony Edwards', born:1962})
MERGE (TomS:Person {name:'Tom Skerritt', born:1933})
MERGE (MegR:Person {name:'Meg Ryan', born:1961})
MERGE (TonyS:Person {name:'Tony Scott', born:1944})
MERGE (JimC:Person {name:'Jim Cash', born:1941})
MERGE (ReneeZ:Person {name:'Renee Zellweger', born:1969})
MERGE (KellyP:Person {name:'Kelly Preston', born:1962})
MERGE (JayM:Person {name:'Jay Mohr', born:1970})
MERGE (BonnieH:Person {name:'Bonnie Hunt', born:1961})
MERGE (ReginaK:Person {name:'Regina King', born:1971})
MERGE (JonathanL:Person {name:'Jonathan Lipnicki', born:1996})
MERGE (CameronC:Person {name:'Cameron Crowe', born:1957})
MERGE (RiverP:Person {name:'River Phoenix', born:1970})
MERGE (CoreyF:Person {name:'Corey Feldman', born:1971})
MERGE (WilW:Person {name:'Wil Wheaton', born:1972})
MERGE (JohnC:Person {name:'John Cusack', born:1966})
MERGE (MarshallB:Person {name:'Marshall Bell', born:1942})
MERGE (TomH:Person {name:'Tom Hanks', born:1956})
MERGE (SallyF:Person {name:'Sally Field', born:1946})
MERGE (RobinWright:Person {name:'Robin Wright', born:1966})
MERGE (MykeltiW:Person {name:'Mykelti Williamson', born:1957})
MERGE (MichaelC:Person {name:'Michael Conner Humphreys', born:1985})
MERGE (GaryS:Person {name:'Gary Sinise', born:1955})
MERGE (RobertZ:Person {name:'Robert Zemeckis', born:1951})
MERGE (HelenH:Person {name:'Helen Hunt', born:1963})
MERGE (EdH:Person {name:'Ed Harris', born:1950})
MERGE (BillPax:Person {name:'Bill Paxton', born:1955})
MERGE (RonH:Person {name:'Ron Howard', born:1954})
MERGE (MichaelD:Person {name:'Michael Clarke Duncan', born:1957})
MERGE (DavidM:Person {name:'David Morse', born:1953})
MERGE (SamR:Person {name:'Sam Rockwell', born:1968})
MERGE (PatriciaC:Person {name:'Patricia Clarkson', born:1959})
MERGE (FrankD:Person {name:'Frank Darabont', born:1959})
MERGE (JamesC:Person {name:'James Cromwell', born:1940})
MERGE (MattD:Person {name:'Matt Damon', born:1970})
MERGE (TomSizemore:Person {name:'Tom Sizemore', born:1961})
MERGE (BarryP:Person {name:'Barry Pepper', born:1970})
MERGE (AdamG:Person {name:'Adam Goldberg', born:1970})
MERGE (VinD:Person {name:'Vin Diesel', born:1967})
MERGE (StevenS:Person {name:'Steven Spielberg', born:1946})
MERGE (EdwardB:Person {name:'Edward Burns', born:1968})
MERGE (ParkerP:Person {name:'Parker Posey', born:1968})
MERGE (DaveC:Person {name:'Dave Chappelle', born:1973})
MERGE (SteveZ:Person {name:'Steve Zahn', born:1967})
MERGE (NoraE:Person {name:'Nora Ephron', born:1941})
MERGE (GregK:Person {name:'Greg Kinnear', born:1963})
MERGE (RitaW:Person {name:'Rita Wilson', born:1956})
MERGE (BillPull:Person {name:'Bill Pullman', born:1953})
MERGE (VictorG:Person {name:'Victor Garber', born:1949})
MERGE (DenzelW:Person {name:'Denzel Washington', born:1954})
MERGE (AntonioB:Person {name:'Antonio Banderas', born:1960})
MERGE (JonathanD:Person {name:'Jonathan Demme', born:1944})
MERGE (BillyC:Person {name:'Billy Crystal', born:1948})
MERGE (CarrieF:Person {name:'Carrie Fisher', born:1956})
MERGE (BrunoK:Person {name:'Bruno Kirby', born:1949})
MERGE (JamesB:Person {name:'James L. Brooks', born:1940})
MERGE (AnnabellaS:Person {name:'Annabella Sciorra', born:1960})
MERGE (MaxS:Person {name:'Max von Sydow', born:1929})
MERGE (WernerH:Person {name:'Werner Herzog', born:1942})
MERGE (Robin:Person {name:'Robin Williams', born:1951})
MERGE (VincentW:Person {name:'Vincent Ward', born:1956})
MERGE (EthanH:Person {name:'Ethan Hawke', born:1970})
MERGE (RickY:Person {name:'Rick Yune', born:1971})
MERGE (ScottH:Person {name:'Scott Hicks', born:1953})
MERGE (Takeshi:Person {name:'Takeshi Kitano', born:1947})
MERGE (Dina:Person {name:'Dina Meyer', born:1968})
MERGE (IceT:Person {name:'Ice-T', born:1958})
MERGE (RobertL:Person {name:'Robert Longo', born:1953})
MERGE (Brooke:Person {name:'Brooke Langton', born:1970})
MERGE (Gene:Person {name:'Gene Hackman', born:1930})
MERGE (Orlando:Person {name:'Orlando Jones', born:1968})
MERGE (Howard:Person {name:'Howard Deutch', born:1950})
MERGE (DianeK:Person {name:'Diane Keaton', born:1946})
MERGE (NancyM:Person {name:'Nancy Meyers', born:1949})
MERGE (HalleB:Person {name:'Halle Berry', born:1966})
MERGE (JimB:Person {name:'Jim Broadbent', born:1949})
MERGE (TomT:Person {name:'Tom Tykwer', born:1965})
MERGE (DavidMitchell:Person {name:'David Mitchell', born:1969})
MERGE (StefanArndt:Person {name:'Stefan Arndt', born:1961})
MERGE (IanM:Person {name:'Ian McKellen', born:1939})
MERGE (AudreyT:Person {name:'Audrey Tautou', born:1976})
MERGE (PaulB:Person {name:'Paul Bettany', born:1971})
MERGE (NatalieP:Person {name:'Natalie Portman', born:1981})
MERGE (StephenR:Person {name:'Stephen Rea', born:1946})
MERGE (JohnH:Person {name:'John Hurt', born:1940})
MERGE (BenM:Person {name:'Ben Miles', born:1967})
MERGE (EmileH:Person {name:'Emile Hirsch', born:1985})
MERGE (JohnG:Person {name:'John Goodman', born:1960})
MERGE (SusanS:Person {name:'Susan Sarandon', born:1946})
MERGE (MatthewF:Person {name:'Matthew Fox', born:1966})
MERGE (ChristinaR:Person {name:'Christina Ricci', born:1980})
MERGE (Rain:Person {name:'Rain', born:1982})
MERGE (NaomieH:Person {name:'Naomie Harris'})
MERGE (JohnS:Person {name:'John Patrick Stanley', born:1950})
MERGE (PennyM:Person {name:'Penny Marshall', born:1943})
MERGE (ElizabethP:Person {name:'Elizabeth Perkins', born:1960})
MERGE (RobertL2:Person {name:'Robert Loggia', born:1930})
MERGE (DarylH:Person {name:'Daryl Hannah', born:1960})
MERGE (JohnCandy:Person {name:'John Candy', born:1950})
MERGE (EugeneL:Person {name:'Eugene Levy', born:1946})
MERGE (LeonardoD:Person {name:'Leonardo DiCaprio', born:1974})
MERGE (ChristopherW:Person {name:'Christopher Walken', born:1943})
MERGE (AmyA:Person {name:'Amy Adams', born:1974})
MERGE (CatherineZ:Person {name:'Catherine Zeta-Jones', born:1969})
MERGE (StanleyT:Person {name:'Stanley Tucci', born:1960})
MERGE (TimA:Person {name:'Tim Allen', born:1953})
MERGE (DonR:Person {name:'Don Rickles', born:1926})
MERGE (JohnL:Person {name:'John Lasseter', born:1957});
// =============================================================================
// MERGE ALL MOVIE NODES
// =============================================================================
MERGE (TheMatrix:Movie {title:'The Matrix', released:1999, tagline:'Welcome to the Real World'})
MERGE (TheMatrixReloaded:Movie {title:'The Matrix Reloaded', released:2003, tagline:'Free your mind'})
MERGE (TheMatrixRevolutions:Movie {title:'The Matrix Revolutions', released:2003, tagline:'Everything that has a beginning has an end'})
MERGE (AFewGoodMen:Movie {title:"A Few Good Men", released:1992, tagline:"In the heart of the nation's capital, in a courthouse of the U.S. government, one man will stop at nothing to keep his honor, and one will stop at nothing to find the truth."})
MERGE (TopGun:Movie {title:"Top Gun", released:1986, tagline:'I feel the need, the need for speed.'})
MERGE (JerryMaguire:Movie {title:'Jerry Maguire', released:2000, tagline:'The rest of his life begins now.'})
MERGE (StandByMe:Movie {title:"Stand By Me", released:1986, tagline:"For some, it's the last real taste of innocence, and the first real taste of life. But for everyone, it's the time that memories are made of."})
MERGE (ForrestGump:Movie {title:'Forrest Gump', released:1994, tagline:'Life is like a box of chocolates, you never know what you are gonna get.'})
MERGE (CastAway:Movie {title:'Cast Away', released:2000, tagline:'At the edge of the world, his journey begins.'})
MERGE (Apollo13:Movie {title:'Apollo 13', released:1995, tagline:'Houston, we have a problem.'})
MERGE (TheGreenMile:Movie {title:'The Green Mile', released:1999, tagline:"Walk a mile you'll never forget."})
MERGE (SavingPrivateRyan:Movie {title:'Saving Private Ryan', released:1998, tagline:'The mission is a man.'})
MERGE (SleeplessInSeattle:Movie {title:'Sleepless in Seattle', released:1993, tagline:'What if someone you never met, someone you never saw, someone you never knew was the only someone for you?'})
MERGE (Philadelphia:Movie {title:'Philadelphia', released:1993, tagline:'No one would take on his case... until one man was willing to take on the system.'})
MERGE (WhenHarryMetSally:Movie {title:'When Harry Met Sally', released:1989, tagline:'Can two friends sleep together and still love each other in the morning?'})
MERGE (AsGoodAsItGets:Movie {title:'As Good as It Gets', released:1997, tagline:'A comedy from the heart that goes for the throat.'})
MERGE (WhatDreamsMayCome:Movie {title:'What Dreams May Come', released:1998, tagline:'After life there is more. The end is just the beginning.'})
MERGE (SnowFallingonCedars:Movie {title:'Snow Falling on Cedars', released:1999, tagline:'First loves last. Forever.'})
MERGE (JohnnyMnemonic:Movie {title:'Johnny Mnemonic', released:1995, tagline:'The hottest data on earth. In the coolest head in town'})
MERGE (TheReplacements:Movie {title:'The Replacements', released:2000, tagline:'Throw the ball. Catch the ball. Tackle the guy with the ball.'})
MERGE (CloudAtlas:Movie {title:'Cloud Atlas', released:2012, tagline:'Everything is connected'})
MERGE (TheDaVinciCode:Movie {title:'The Da Vinci Code', released:2006, tagline:'Break The Codes'})
MERGE (VforVendetta:Movie {title:'V for Vendetta', released:2006, tagline:'Freedom! Forever!'})
MERGE (SpeedRacer:Movie {title:'Speed Racer', released:2008, tagline:'Speed has no limits'})
MERGE (NinjaAssassin:Movie {title:'Ninja Assassin', released:2009, tagline:'Prepare to enter a secret world of assassins'})
MERGE (JoeVersustheVolcano:Movie {title:'Joe Versus the Volcano', released:1990, tagline:'A story of love, lava and burning desire.'})
MERGE (Big:Movie {title:'Big', released:1988, tagline:'You are what you wish for.'})
MERGE (Splash:Movie {title:'Splash', released:1984, tagline:'A different kind of love story.'})
MERGE (CatchMeIfYouCan:Movie {title:'Catch Me If You Can', released:2002, tagline:'The true story of a real fake.'})
MERGE (TheTerminal:Movie {title:'The Terminal', released:2004, tagline:'Life is waiting.'})
MERGE (ToyStory:Movie {title:'Toy Story', released:1995, tagline:'Hang on for the comedy that goes to infinity and beyond!'})
MERGE (ToyStory2:Movie {title:'Toy Story 2', released:1999, tagline:'The toys are back!'});
// =============================================================================
// MERGE ALL RELATIONSHIPS INDIVIDUALLY
// =============================================================================
// The Matrix relationships
MATCH (a:Person {name: 'Keanu Reeves'}) MATCH (b:Movie {title: 'The Matrix'}) MERGE (a)-[:ACTED_IN {roles:['Neo']}]->(b);
MATCH (a:Person {name: 'Carrie-Anne Moss'}) MATCH (b:Movie {title: 'The Matrix'}) MERGE (a)-[:ACTED_IN {roles:['Trinity']}]->(b);
MATCH (a:Person {name: 'Laurence Fishburne'}) MATCH (b:Movie {title: 'The Matrix'}) MERGE (a)-[:ACTED_IN {roles:['Morpheus']}]->(b);
MATCH (a:Person {name: 'Hugo Weaving'}) MATCH (b:Movie {title: 'The Matrix'}) MERGE (a)-[:ACTED_IN {roles:['Agent Smith']}]->(b);
MATCH (a:Person {name: 'Lilly Wachowski'}) MATCH (b:Movie {title: 'The Matrix'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Lana Wachowski'}) MATCH (b:Movie {title: 'The Matrix'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Joel Silver'}) MATCH (b:Movie {title: 'The Matrix'}) MERGE (a)-[:PRODUCED]->(b);
// The Matrix Reloaded relationships
MATCH (a:Person {name: 'Keanu Reeves'}) MATCH (b:Movie {title: 'The Matrix Reloaded'}) MERGE (a)-[:ACTED_IN {roles:['Neo']}]->(b);
MATCH (a:Person {name: 'Carrie-Anne Moss'}) MATCH (b:Movie {title: 'The Matrix Reloaded'}) MERGE (a)-[:ACTED_IN {roles:['Trinity']}]->(b);
MATCH (a:Person {name: 'Laurence Fishburne'}) MATCH (b:Movie {title: 'The Matrix Reloaded'}) MERGE (a)-[:ACTED_IN {roles:['Morpheus']}]->(b);
MATCH (a:Person {name: 'Hugo Weaving'}) MATCH (b:Movie {title: 'The Matrix Reloaded'}) MERGE (a)-[:ACTED_IN {roles:['Agent Smith']}]->(b);
MATCH (a:Person {name: 'Lilly Wachowski'}) MATCH (b:Movie {title: 'The Matrix Reloaded'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Lana Wachowski'}) MATCH (b:Movie {title: 'The Matrix Reloaded'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Joel Silver'}) MATCH (b:Movie {title: 'The Matrix Reloaded'}) MERGE (a)-[:PRODUCED]->(b);
// The Matrix Revolutions relationships
MATCH (a:Person {name: 'Keanu Reeves'}) MATCH (b:Movie {title: 'The Matrix Revolutions'}) MERGE (a)-[:ACTED_IN {roles:['Neo']}]->(b);
MATCH (a:Person {name: 'Carrie-Anne Moss'}) MATCH (b:Movie {title: 'The Matrix Revolutions'}) MERGE (a)-[:ACTED_IN {roles:['Trinity']}]->(b);
MATCH (a:Person {name: 'Laurence Fishburne'}) MATCH (b:Movie {title: 'The Matrix Revolutions'}) MERGE (a)-[:ACTED_IN {roles:['Morpheus']}]->(b);
MATCH (a:Person {name: 'Hugo Weaving'}) MATCH (b:Movie {title: 'The Matrix Revolutions'}) MERGE (a)-[:ACTED_IN {roles:['Agent Smith']}]->(b);
MATCH (a:Person {name: 'Lilly Wachowski'}) MATCH (b:Movie {title: 'The Matrix Revolutions'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Lana Wachowski'}) MATCH (b:Movie {title: 'The Matrix Revolutions'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Joel Silver'}) MATCH (b:Movie {title: 'The Matrix Revolutions'}) MERGE (a)-[:PRODUCED]->(b);
// The Devil's Advocate relationships
MATCH (a:Person {name: 'Keanu Reeves'}) MATCH (b:Movie {title: 'The Devil\'s Advocate'}) MERGE (a)-[:ACTED_IN {roles:['Kevin Lomax']}]->(b);
MATCH (a:Person {name: 'Charlize Theron'}) MATCH (b:Movie {title: 'The Devil\'s Advocate'}) MERGE (a)-[:ACTED_IN {roles:['Mary Ann Lomax']}]->(b);
MATCH (a:Person {name: 'Al Pacino'}) MATCH (b:Movie {title: 'The Devil\'s Advocate'}) MERGE (a)-[:ACTED_IN {roles:['John Milton']}]->(b);
MATCH (a:Person {name: 'Taylor Hackford'}) MATCH (b:Movie {title: 'The Devil\'s Advocate'}) MERGE (a)-[:DIRECTED]->(b);
// A Few Good Men relationships
MATCH (a:Person {name: 'Tom Cruise'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Lt. Daniel Kaffee']}]->(b);
MATCH (a:Person {name: 'Jack Nicholson'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Col. Nathan R. Jessup']}]->(b);
MATCH (a:Person {name: 'Demi Moore'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Lt. Cdr. JoAnne Galloway']}]->(b);
MATCH (a:Person {name: 'Kevin Bacon'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Capt. Jack Ross']}]->(b);
MATCH (a:Person {name: 'Kiefer Sutherland'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Lt. Jonathan Kendrick']}]->(b);
MATCH (a:Person {name: 'Noah Wyle'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Cpl. Jeffrey Barnes']}]->(b);
MATCH (a:Person {name: 'Cuba Gooding Jr.'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Cpl. Carl Hammaker']}]->(b);
MATCH (a:Person {name: 'Kevin Pollak'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Lt. Sam Weinberg']}]->(b);
MATCH (a:Person {name: 'J.T. Walsh'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Lt. Col. Matthew Andrew Markinson']}]->(b);
MATCH (a:Person {name: 'James Marshall'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Pfc. Louden Downey']}]->(b);
MATCH (a:Person {name: 'Christopher Guest'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Dr. Stone']}]->(b);
MATCH (a:Person {name: 'Aaron Sorkin'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:ACTED_IN {roles:['Man in Bar']}]->(b);
MATCH (a:Person {name: 'Rob Reiner'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Aaron Sorkin'}) MATCH (b:Movie {title: 'A Few Good Men'}) MERGE (a)-[:WROTE]->(b);
// Top Gun relationships
MATCH (a:Person {name: 'Tom Cruise'}) MATCH (b:Movie {title: 'Top Gun'}) MERGE (a)-[:ACTED_IN {roles:['Maverick']}]->(b);
MATCH (a:Person {name: 'Kelly McGillis'}) MATCH (b:Movie {title: 'Top Gun'}) MERGE (a)-[:ACTED_IN {roles:['Charlie']}]->(b);
MATCH (a:Person {name: 'Val Kilmer'}) MATCH (b:Movie {title: 'Top Gun'}) MERGE (a)-[:ACTED_IN {roles:['Iceman']}]->(b);
MATCH (a:Person {name: 'Anthony Edwards'}) MATCH (b:Movie {title: 'Top Gun'}) MERGE (a)-[:ACTED_IN {roles:['Goose']}]->(b);
MATCH (a:Person {name: 'Tom Skerritt'}) MATCH (b:Movie {title: 'Top Gun'}) MERGE (a)-[:ACTED_IN {roles:['Viper']}]->(b);
MATCH (a:Person {name: 'Meg Ryan'}) MATCH (b:Movie {title: 'Top Gun'}) MERGE (a)-[:ACTED_IN {roles:['Carole']}]->(b);
MATCH (a:Person {name: 'Tony Scott'}) MATCH (b:Movie {title: 'Top Gun'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Jim Cash'}) MATCH (b:Movie {title: 'Top Gun'}) MERGE (a)-[:WROTE]->(b);
// Jerry Maguire relationships
MATCH (a:Person {name: 'Tom Cruise'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:ACTED_IN {roles:['Jerry Maguire']}]->(b);
MATCH (a:Person {name: 'Cuba Gooding Jr.'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:ACTED_IN {roles:['Rod Tidwell']}]->(b);
MATCH (a:Person {name: 'Renee Zellweger'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:ACTED_IN {roles:['Dorothy Boyd']}]->(b);
MATCH (a:Person {name: 'Kelly Preston'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:ACTED_IN {roles:['Avery Bishop']}]->(b);
MATCH (a:Person {name: 'Jerry O\'Connell'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:ACTED_IN {roles:['Frank Cushman']}]->(b);
MATCH (a:Person {name: 'Jay Mohr'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:ACTED_IN {roles:['Bob Sugar']}]->(b);
MATCH (a:Person {name: 'Bonnie Hunt'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:ACTED_IN {roles:['Laurel Boyd']}]->(b);
MATCH (a:Person {name: 'Regina King'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:ACTED_IN {roles:['Marcee Tidwell']}]->(b);
MATCH (a:Person {name: 'Jonathan Lipnicki'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:ACTED_IN {roles:['Ray Boyd']}]->(b);
MATCH (a:Person {name: 'Cameron Crowe'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Cameron Crowe'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:PRODUCED]->(b);
MATCH (a:Person {name: 'Cameron Crowe'}) MATCH (b:Movie {title: 'Jerry Maguire'}) MERGE (a)-[:WROTE]->(b);
// Stand By Me relationships
MATCH (a:Person {name: 'Wil Wheaton'}) MATCH (b:Movie {title: 'Stand By Me'}) MERGE (a)-[:ACTED_IN {roles:['Gordie Lachance']}]->(b);
MATCH (a:Person {name: 'River Phoenix'}) MATCH (b:Movie {title: 'Stand By Me'}) MERGE (a)-[:ACTED_IN {roles:['Chris Chambers']}]->(b);
MATCH (a:Person {name: 'Jerry O\'Connell'}) MATCH (b:Movie {title: 'Stand By Me'}) MERGE (a)-[:ACTED_IN {roles:['Vern Tessio']}]->(b);
MATCH (a:Person {name: 'Corey Feldman'}) MATCH (b:Movie {title: 'Stand By Me'}) MERGE (a)-[:ACTED_IN {roles:['Teddy Duchamp']}]->(b);
MATCH (a:Person {name: 'John Cusack'}) MATCH (b:Movie {title: 'Stand By Me'}) MERGE (a)-[:ACTED_IN {roles:['Denny Lachance']}]->(b);
MATCH (a:Person {name: 'Kiefer Sutherland'}) MATCH (b:Movie {title: 'Stand By Me'}) MERGE (a)-[:ACTED_IN {roles:['Ace Merrill']}]->(b);
MATCH (a:Person {name: 'Marshall Bell'}) MATCH (b:Movie {title: 'Stand By Me'}) MERGE (a)-[:ACTED_IN {roles:['Mr. Lachance']}]->(b);
MATCH (a:Person {name: 'Rob Reiner'}) MATCH (b:Movie {title: 'Stand By Me'}) MERGE (a)-[:DIRECTED]->(b);
// Forrest Gump relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Forrest Gump'}) MERGE (a)-[:ACTED_IN {roles:['Forrest Gump']}]->(b);
MATCH (a:Person {name: 'Robin Wright'}) MATCH (b:Movie {title: 'Forrest Gump'}) MERGE (a)-[:ACTED_IN {roles:['Jenny Curran']}]->(b);
MATCH (a:Person {name: 'Gary Sinise'}) MATCH (b:Movie {title: 'Forrest Gump'}) MERGE (a)-[:ACTED_IN {roles:['Lt. Dan Taylor']}]->(b);
MATCH (a:Person {name: 'Sally Field'}) MATCH (b:Movie {title: 'Forrest Gump'}) MERGE (a)-[:ACTED_IN {roles:['Mrs. Gump']}]->(b);
MATCH (a:Person {name: 'Mykelti Williamson'}) MATCH (b:Movie {title: 'Forrest Gump'}) MERGE (a)-[:ACTED_IN {roles:['Bubba Blue']}]->(b);
MATCH (a:Person {name: 'Michael Conner Humphreys'}) MATCH (b:Movie {title: 'Forrest Gump'}) MERGE (a)-[:ACTED_IN {roles:['Young Forrest']}]->(b);
MATCH (a:Person {name: 'Robert Zemeckis'}) MATCH (b:Movie {title: 'Forrest Gump'}) MERGE (a)-[:DIRECTED]->(b);
// Cast Away relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Cast Away'}) MERGE (a)-[:ACTED_IN {roles:['Chuck Noland']}]->(b);
MATCH (a:Person {name: 'Helen Hunt'}) MATCH (b:Movie {title: 'Cast Away'}) MERGE (a)-[:ACTED_IN {roles:['Kelly Frears']}]->(b);
MATCH (a:Person {name: 'Robert Zemeckis'}) MATCH (b:Movie {title: 'Cast Away'}) MERGE (a)-[:DIRECTED]->(b);
// Apollo 13 relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Apollo 13'}) MERGE (a)-[:ACTED_IN {roles:['Jim Lovell']}]->(b);
MATCH (a:Person {name: 'Kevin Bacon'}) MATCH (b:Movie {title: 'Apollo 13'}) MERGE (a)-[:ACTED_IN {roles:['Jack Swigert']}]->(b);
MATCH (a:Person {name: 'Ed Harris'}) MATCH (b:Movie {title: 'Apollo 13'}) MERGE (a)-[:ACTED_IN {roles:['Gene Kranz']}]->(b);
MATCH (a:Person {name: 'Bill Paxton'}) MATCH (b:Movie {title: 'Apollo 13'}) MERGE (a)-[:ACTED_IN {roles:['Fred Haise']}]->(b);
MATCH (a:Person {name: 'Gary Sinise'}) MATCH (b:Movie {title: 'Apollo 13'}) MERGE (a)-[:ACTED_IN {roles:['Ken Mattingly']}]->(b);
MATCH (a:Person {name: 'Ron Howard'}) MATCH (b:Movie {title: 'Apollo 13'}) MERGE (a)-[:DIRECTED]->(b);
// The Green Mile relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'The Green Mile'}) MERGE (a)-[:ACTED_IN {roles:['Paul Edgecomb']}]->(b);
MATCH (a:Person {name: 'Michael Clarke Duncan'}) MATCH (b:Movie {title: 'The Green Mile'}) MERGE (a)-[:ACTED_IN {roles:['John Coffey']}]->(b);
MATCH (a:Person {name: 'David Morse'}) MATCH (b:Movie {title: 'The Green Mile'}) MERGE (a)-[:ACTED_IN {roles:['Brutus "Brutal" Howell']}]->(b);
MATCH (a:Person {name: 'Bonnie Hunt'}) MATCH (b:Movie {title: 'The Green Mile'}) MERGE (a)-[:ACTED_IN {roles:['Jan Edgecomb']}]->(b);
MATCH (a:Person {name: 'James Cromwell'}) MATCH (b:Movie {title: 'The Green Mile'}) MERGE (a)-[:ACTED_IN {roles:['Warden Hal Moores']}]->(b);
MATCH (a:Person {name: 'Sam Rockwell'}) MATCH (b:Movie {title: 'The Green Mile'}) MERGE (a)-[:ACTED_IN {roles:['"Wild Bill" Wharton']}]->(b);
MATCH (a:Person {name: 'Gary Sinise'}) MATCH (b:Movie {title: 'The Green Mile'}) MERGE (a)-[:ACTED_IN {roles:['Burt Hammersmith']}]->(b);
MATCH (a:Person {name: 'Patricia Clarkson'}) MATCH (b:Movie {title: 'The Green Mile'}) MERGE (a)-[:ACTED_IN {roles:['Melinda Moores']}]->(b);
MATCH (a:Person {name: 'Frank Darabont'}) MATCH (b:Movie {title: 'The Green Mile'}) MERGE (a)-[:DIRECTED]->(b);
// Saving Private Ryan relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Saving Private Ryan'}) MERGE (a)-[:ACTED_IN {roles:['Captain John H. Miller']}]->(b);
MATCH (a:Person {name: 'Matt Damon'}) MATCH (b:Movie {title: 'Saving Private Ryan'}) MERGE (a)-[:ACTED_IN {roles:['Private James Francis Ryan']}]->(b);
MATCH (a:Person {name: 'Tom Sizemore'}) MATCH (b:Movie {title: 'Saving Private Ryan'}) MERGE (a)-[:ACTED_IN {roles:['Sergeant Mike Horvath']}]->(b);
MATCH (a:Person {name: 'Edward Burns'}) MATCH (b:Movie {title: 'Saving Private Ryan'}) MERGE (a)-[:ACTED_IN {roles:['Private Richard Reiben']}]->(b);
MATCH (a:Person {name: 'Barry Pepper'}) MATCH (b:Movie {title: 'Saving Private Ryan'}) MERGE (a)-[:ACTED_IN {roles:['Private Daniel Jackson']}]->(b);
MATCH (a:Person {name: 'Adam Goldberg'}) MATCH (b:Movie {title: 'Saving Private Ryan'}) MERGE (a)-[:ACTED_IN {roles:['Private Stanley Mellish']}]->(b);
MATCH (a:Person {name: 'Vin Diesel'}) MATCH (b:Movie {title: 'Saving Private Ryan'}) MERGE (a)-[:ACTED_IN {roles:['Private Adrian Caparzo']}]->(b);
MATCH (a:Person {name: 'Steven Spielberg'}) MATCH (b:Movie {title: 'Saving Private Ryan'}) MERGE (a)-[:DIRECTED]->(b);
// You've Got Mail relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'You\'ve Got Mail'}) MERGE (a)-[:ACTED_IN {roles:['Joe Fox']}]->(b);
MATCH (a:Person {name: 'Meg Ryan'}) MATCH (b:Movie {title: 'You\'ve Got Mail'}) MERGE (a)-[:ACTED_IN {roles:['Kathleen Kelly']}]->(b);
MATCH (a:Person {name: 'Greg Kinnear'}) MATCH (b:Movie {title: 'You\'ve Got Mail'}) MERGE (a)-[:ACTED_IN {roles:['Frank Navasky']}]->(b);
MATCH (a:Person {name: 'Parker Posey'}) MATCH (b:Movie {title: 'You\'ve Got Mail'}) MERGE (a)-[:ACTED_IN {roles:['Patricia Eden']}]->(b);
MATCH (a:Person {name: 'Dave Chappelle'}) MATCH (b:Movie {title: 'You\'ve Got Mail'}) MERGE (a)-[:ACTED_IN {roles:['Kevin Jackson']}]->(b);
MATCH (a:Person {name: 'Steve Zahn'}) MATCH (b:Movie {title: 'You\'ve Got Mail'}) MERGE (a)-[:ACTED_IN {roles:['George Pappas']}]->(b);
MATCH (a:Person {name: 'Nora Ephron'}) MATCH (b:Movie {title: 'You\'ve Got Mail'}) MERGE (a)-[:DIRECTED]->(b);
// Sleepless in Seattle relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Sleepless in Seattle'}) MERGE (a)-[:ACTED_IN {roles:['Sam Baldwin']}]->(b);
MATCH (a:Person {name: 'Meg Ryan'}) MATCH (b:Movie {title: 'Sleepless in Seattle'}) MERGE (a)-[:ACTED_IN {roles:['Annie Reed']}]->(b);
MATCH (a:Person {name: 'Rita Wilson'}) MATCH (b:Movie {title: 'Sleepless in Seattle'}) MERGE (a)-[:ACTED_IN {roles:['Suzy']}]->(b);
MATCH (a:Person {name: 'Bill Pullman'}) MATCH (b:Movie {title: 'Sleepless in Seattle'}) MERGE (a)-[:ACTED_IN {roles:['Walter']}]->(b);
MATCH (a:Person {name: 'Victor Garber'}) MATCH (b:Movie {title: 'Sleepless in Seattle'}) MERGE (a)-[:ACTED_IN {roles:['Greg']}]->(b);
MATCH (a:Person {name: 'Rosie O\'Donnell'}) MATCH (b:Movie {title: 'Sleepless in Seattle'}) MERGE (a)-[:ACTED_IN {roles:['Becky']}]->(b);
MATCH (a:Person {name: 'Nora Ephron'}) MATCH (b:Movie {title: 'Sleepless in Seattle'}) MERGE (a)-[:DIRECTED]->(b);
// Philadelphia relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Philadelphia'}) MERGE (a)-[:ACTED_IN {roles:['Andrew Beckett']}]->(b);
MATCH (a:Person {name: 'Denzel Washington'}) MATCH (b:Movie {title: 'Philadelphia'}) MERGE (a)-[:ACTED_IN {roles:['Joe Miller']}]->(b);
MATCH (a:Person {name: 'Antonio Banderas'}) MATCH (b:Movie {title: 'Philadelphia'}) MERGE (a)-[:ACTED_IN {roles:['Miguel Alvarez']}]->(b);
MATCH (a:Person {name: 'Jonathan Demme'}) MATCH (b:Movie {title: 'Philadelphia'}) MERGE (a)-[:DIRECTED]->(b);
// When Harry Met Sally relationships
MATCH (a:Person {name: 'Billy Crystal'}) MATCH (b:Movie {title: 'When Harry Met Sally'}) MERGE (a)-[:ACTED_IN {roles:['Harry Burns']}]->(b);
MATCH (a:Person {name: 'Meg Ryan'}) MATCH (b:Movie {title: 'When Harry Met Sally'}) MERGE (a)-[:ACTED_IN {roles:['Sally Albright']}]->(b);
MATCH (a:Person {name: 'Carrie Fisher'}) MATCH (b:Movie {title: 'When Harry Met Sally'}) MERGE (a)-[:ACTED_IN {roles:['Marie']}]->(b);
MATCH (a:Person {name: 'Bruno Kirby'}) MATCH (b:Movie {title: 'When Harry Met Sally'}) MERGE (a)-[:ACTED_IN {roles:['Jess']}]->(b);
MATCH (a:Person {name: 'Rob Reiner'}) MATCH (b:Movie {title: 'When Harry Met Sally'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Rob Reiner'}) MATCH (b:Movie {title: 'When Harry Met Sally'}) MERGE (a)-[:PRODUCED]->(b);
MATCH (a:Person {name: 'Nora Ephron'}) MATCH (b:Movie {title: 'When Harry Met Sally'}) MERGE (a)-[:PRODUCED]->(b);
MATCH (a:Person {name: 'Nora Ephron'}) MATCH (b:Movie {title: 'When Harry Met Sally'}) MERGE (a)-[:WROTE]->(b);
// As Good as It Gets relationships
MATCH (a:Person {name: 'Jack Nicholson'}) MATCH (b:Movie {title: 'As Good as It Gets'}) MERGE (a)-[:ACTED_IN {roles:['Melvin Udall']}]->(b);
MATCH (a:Person {name: 'Helen Hunt'}) MATCH (b:Movie {title: 'As Good as It Gets'}) MERGE (a)-[:ACTED_IN {roles:['Carol Connelly']}]->(b);
MATCH (a:Person {name: 'Greg Kinnear'}) MATCH (b:Movie {title: 'As Good as It Gets'}) MERGE (a)-[:ACTED_IN {roles:['Simon Bishop']}]->(b);
MATCH (a:Person {name: 'Cuba Gooding Jr.'}) MATCH (b:Movie {title: 'As Good as It Gets'}) MERGE (a)-[:ACTED_IN {roles:['Frank Sachs']}]->(b);
MATCH (a:Person {name: 'James L. Brooks'}) MATCH (b:Movie {title: 'As Good as It Gets'}) MERGE (a)-[:DIRECTED]->(b);
// What Dreams May Come relationships
MATCH (a:Person {name: 'Robin Williams'}) MATCH (b:Movie {title: 'What Dreams May Come'}) MERGE (a)-[:ACTED_IN {roles:['Chris Nielsen']}]->(b);
MATCH (a:Person {name: 'Cuba Gooding Jr.'}) MATCH (b:Movie {title: 'What Dreams May Come'}) MERGE (a)-[:ACTED_IN {roles:['Albert Lewis']}]->(b);
MATCH (a:Person {name: 'Annabella Sciorra'}) MATCH (b:Movie {title: 'What Dreams May Come'}) MERGE (a)-[:ACTED_IN {roles:['Annie Collins-Nielsen']}]->(b);
MATCH (a:Person {name: 'Max von Sydow'}) MATCH (b:Movie {title: 'What Dreams May Come'}) MERGE (a)-[:ACTED_IN {roles:['The Tracker']}]->(b);
MATCH (a:Person {name: 'Werner Herzog'}) MATCH (b:Movie {title: 'What Dreams May Come'}) MERGE (a)-[:ACTED_IN {roles:['The Face']}]->(b);
MATCH (a:Person {name: 'Vincent Ward'}) MATCH (b:Movie {title: 'What Dreams May Come'}) MERGE (a)-[:DIRECTED]->(b);
// Snow Falling on Cedars relationships
MATCH (a:Person {name: 'Ethan Hawke'}) MATCH (b:Movie {title: 'Snow Falling on Cedars'}) MERGE (a)-[:ACTED_IN {roles:['Ishmael Chambers']}]->(b);
MATCH (a:Person {name: 'Rick Yune'}) MATCH (b:Movie {title: 'Snow Falling on Cedars'}) MERGE (a)-[:ACTED_IN {roles:['Kazuo Miyamoto']}]->(b);
MATCH (a:Person {name: 'Max von Sydow'}) MATCH (b:Movie {title: 'Snow Falling on Cedars'}) MERGE (a)-[:ACTED_IN {roles:['Nels Gudmundsson']}]->(b);
MATCH (a:Person {name: 'James Cromwell'}) MATCH (b:Movie {title: 'Snow Falling on Cedars'}) MERGE (a)-[:ACTED_IN {roles:['Judge Fielding']}]->(b);
MATCH (a:Person {name: 'Scott Hicks'}) MATCH (b:Movie {title: 'Snow Falling on Cedars'}) MERGE (a)-[:DIRECTED]->(b);
// Johnny Mnemonic relationships
MATCH (a:Person {name: 'Keanu Reeves'}) MATCH (b:Movie {title: 'Johnny Mnemonic'}) MERGE (a)-[:ACTED_IN {roles:['Johnny Mnemonic']}]->(b);
MATCH (a:Person {name: 'Takeshi Kitano'}) MATCH (b:Movie {title: 'Johnny Mnemonic'}) MERGE (a)-[:ACTED_IN {roles:['Takahashi']}]->(b);
MATCH (a:Person {name: 'Dina Meyer'}) MATCH (b:Movie {title: 'Johnny Mnemonic'}) MERGE (a)-[:ACTED_IN {roles:['Jane']}]->(b);
MATCH (a:Person {name: 'Ice-T'}) MATCH (b:Movie {title: 'Johnny Mnemonic'}) MERGE (a)-[:ACTED_IN {roles:['J-Bone']}]->(b);
MATCH (a:Person {name: 'Robert Longo'}) MATCH (b:Movie {title: 'Johnny Mnemonic'}) MERGE (a)-[:DIRECTED]->(b);
// The Replacements relationships
MATCH (a:Person {name: 'Keanu Reeves'}) MATCH (b:Movie {title: 'The Replacements'}) MERGE (a)-[:ACTED_IN {roles:['Shane Falco']}]->(b);
MATCH (a:Person {name: 'Brooke Langton'}) MATCH (b:Movie {title: 'The Replacements'}) MERGE (a)-[:ACTED_IN {roles:['Annabelle Farrell']}]->(b);
MATCH (a:Person {name: 'Gene Hackman'}) MATCH (b:Movie {title: 'The Replacements'}) MERGE (a)-[:ACTED_IN {roles:['Jimmy McGinty']}]->(b);
MATCH (a:Person {name: 'Orlando Jones'}) MATCH (b:Movie {title: 'The Replacements'}) MERGE (a)-[:ACTED_IN {roles:['Clifford Franklin']}]->(b);
MATCH (a:Person {name: 'Howard Deutch'}) MATCH (b:Movie {title: 'The Replacements'}) MERGE (a)-[:DIRECTED]->(b);
// Something's Gotta Give relationships
MATCH (a:Person {name: 'Jack Nicholson'}) MATCH (b:Movie {title: 'Something\'s Gotta Give'}) MERGE (a)-[:ACTED_IN {roles:['Harry Sanborn']}]->(b);
MATCH (a:Person {name: 'Diane Keaton'}) MATCH (b:Movie {title: 'Something\'s Gotta Give'}) MERGE (a)-[:ACTED_IN {roles:['Erica Barry']}]->(b);
MATCH (a:Person {name: 'Keanu Reeves'}) MATCH (b:Movie {title: 'Something\'s Gotta Give'}) MERGE (a)-[:ACTED_IN {roles:['Julian Mercer']}]->(b);
MATCH (a:Person {name: 'Nancy Meyers'}) MATCH (b:Movie {title: 'Something\'s Gotta Give'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Nancy Meyers'}) MATCH (b:Movie {title: 'Something\'s Gotta Give'}) MERGE (a)-[:PRODUCED]->(b);
MATCH (a:Person {name: 'Nancy Meyers'}) MATCH (b:Movie {title: 'Something\'s Gotta Give'}) MERGE (a)-[:WROTE]->(b);
// Cloud Atlas relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Cloud Atlas'}) MERGE (a)-[:ACTED_IN {roles:['Zachry', 'Dr. Henry Goose', 'Isaac Sachs', 'Dermot Hoggins']}]->(b);
MATCH (a:Person {name: 'Hugo Weaving'}) MATCH (b:Movie {title: 'Cloud Atlas'}) MERGE (a)-[:ACTED_IN {roles:['Bill Smoke', 'Haskell Moore', 'Tadeusz Kesselring', 'Nurse Noakes', 'Boardman Mephi', 'Old Georgie']}]->(b);
MATCH (a:Person {name: 'Halle Berry'}) MATCH (b:Movie {title: 'Cloud Atlas'}) MERGE (a)-[:ACTED_IN {roles:['Luisa Rey', 'Jocasta Ayrs', 'Ovid', 'Meronym']}]->(b);
MATCH (a:Person {name: 'Jim Broadbent'}) MATCH (b:Movie {title: 'Cloud Atlas'}) MERGE (a)-[:ACTED_IN {roles:['Vyvyan Ayrs', 'Captain Molyneux', 'Timothy Cavendish']}]->(b);
MATCH (a:Person {name: 'Tom Tykwer'}) MATCH (b:Movie {title: 'Cloud Atlas'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Lilly Wachowski'}) MATCH (b:Movie {title: 'Cloud Atlas'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Lana Wachowski'}) MATCH (b:Movie {title: 'Cloud Atlas'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'David Mitchell'}) MATCH (b:Movie {title: 'Cloud Atlas'}) MERGE (a)-[:WROTE]->(b);
MATCH (a:Person {name: 'Stefan Arndt'}) MATCH (b:Movie {title: 'Cloud Atlas'}) MERGE (a)-[:PRODUCED]->(b);
// The Da Vinci Code relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'The Da Vinci Code'}) MERGE (a)-[:ACTED_IN {roles:['Dr. Robert Langdon']}]->(b);
MATCH (a:Person {name: 'Ian McKellen'}) MATCH (b:Movie {title: 'The Da Vinci Code'}) MERGE (a)-[:ACTED_IN {roles:['Sir Leight Teabing']}]->(b);
MATCH (a:Person {name: 'Audrey Tautou'}) MATCH (b:Movie {title: 'The Da Vinci Code'}) MERGE (a)-[:ACTED_IN {roles:['Sophie Neveu']}]->(b);
MATCH (a:Person {name: 'Paul Bettany'}) MATCH (b:Movie {title: 'The Da Vinci Code'}) MERGE (a)-[:ACTED_IN {roles:['Silas']}]->(b);
MATCH (a:Person {name: 'Ron Howard'}) MATCH (b:Movie {title: 'The Da Vinci Code'}) MERGE (a)-[:DIRECTED]->(b);
// V for Vendetta relationships
MATCH (a:Person {name: 'Hugo Weaving'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:ACTED_IN {roles:['V']}]->(b);
MATCH (a:Person {name: 'Natalie Portman'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:ACTED_IN {roles:['Evey Hammond']}]->(b);
MATCH (a:Person {name: 'Stephen Rea'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:ACTED_IN {roles:['Eric Finch']}]->(b);
MATCH (a:Person {name: 'John Hurt'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:ACTED_IN {roles:['High Chancellor Adam Sutler']}]->(b);
MATCH (a:Person {name: 'Ben Miles'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:ACTED_IN {roles:['Dascomb']}]->(b);
MATCH (a:Person {name: 'James Marshall'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Lilly Wachowski'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:PRODUCED]->(b);
MATCH (a:Person {name: 'Lana Wachowski'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:PRODUCED]->(b);
MATCH (a:Person {name: 'Joel Silver'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:PRODUCED]->(b);
MATCH (a:Person {name: 'Lilly Wachowski'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:WROTE]->(b);
MATCH (a:Person {name: 'Lana Wachowski'}) MATCH (b:Movie {title: 'V for Vendetta'}) MERGE (a)-[:WROTE]->(b);
// Speed Racer relationships
MATCH (a:Person {name: 'Emile Hirsch'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:ACTED_IN {roles:['Speed Racer']}]->(b);
MATCH (a:Person {name: 'John Goodman'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:ACTED_IN {roles:['Pops']}]->(b);
MATCH (a:Person {name: 'Susan Sarandon'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:ACTED_IN {roles:['Mom']}]->(b);
MATCH (a:Person {name: 'Matthew Fox'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:ACTED_IN {roles:['Racer X']}]->(b);
MATCH (a:Person {name: 'Christina Ricci'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:ACTED_IN {roles:['Trixie']}]->(b);
MATCH (a:Person {name: 'Rain'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:ACTED_IN {roles:['Taejo Togokahn']}]->(b);
MATCH (a:Person {name: 'Ben Miles'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:ACTED_IN {roles:['Cass Jones']}]->(b);
MATCH (a:Person {name: 'Lilly Wachowski'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Lana Wachowski'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Lilly Wachowski'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:WROTE]->(b);
MATCH (a:Person {name: 'Lana Wachowski'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:WROTE]->(b);
MATCH (a:Person {name: 'Joel Silver'}) MATCH (b:Movie {title: 'Speed Racer'}) MERGE (a)-[:PRODUCED]->(b);
// Ninja Assassin relationships
MATCH (a:Person {name: 'Rain'}) MATCH (b:Movie {title: 'Ninja Assassin'}) MERGE (a)-[:ACTED_IN {roles:['Raizo']}]->(b);
MATCH (a:Person {name: 'Naomie Harris'}) MATCH (b:Movie {title: 'Ninja Assassin'}) MERGE (a)-[:ACTED_IN {roles:['Mika Coretti']}]->(b);
MATCH (a:Person {name: 'Rick Yune'}) MATCH (b:Movie {title: 'Ninja Assassin'}) MERGE (a)-[:ACTED_IN {roles:['Takeshi']}]->(b);
MATCH (a:Person {name: 'Ben Miles'}) MATCH (b:Movie {title: 'Ninja Assassin'}) MERGE (a)-[:ACTED_IN {roles:['Ryan Maslow']}]->(b);
MATCH (a:Person {name: 'James Marshall'}) MATCH (b:Movie {title: 'Ninja Assassin'}) MERGE (a)-[:DIRECTED]->(b);
MATCH (a:Person {name: 'Lilly Wachowski'}) MATCH (b:Movie {title: 'Ninja Assassin'}) MERGE (a)-[:PRODUCED]->(b);
MATCH (a:Person {name: 'Lana Wachowski'}) MATCH (b:Movie {title: 'Ninja Assassin'}) MERGE (a)-[:PRODUCED]->(b);
MATCH (a:Person {name: 'Joel Silver'}) MATCH (b:Movie {title: 'Ninja Assassin'}) MERGE (a)-[:PRODUCED]->(b);
// Toy Story relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Toy Story'}) MERGE (a)-[:ACTED_IN {roles:['Woody']}]->(b);
MATCH (a:Person {name: 'Tim Allen'}) MATCH (b:Movie {title: 'Toy Story'}) MERGE (a)-[:ACTED_IN {roles:['Buzz Lightyear']}]->(b);
MATCH (a:Person {name: 'Don Rickles'}) MATCH (b:Movie {title: 'Toy Story'}) MERGE (a)-[:ACTED_IN {roles:['Mr. Potato Head']}]->(b);
MATCH (a:Person {name: 'John Lasseter'}) MATCH (b:Movie {title: 'Toy Story'}) MERGE (a)-[:DIRECTED]->(b);
// Toy Story 2 relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Toy Story 2'}) MERGE (a)-[:ACTED_IN {roles:['Woody']}]->(b);
MATCH (a:Person {name: 'Tim Allen'}) MATCH (b:Movie {title: 'Toy Story 2'}) MERGE (a)-[:ACTED_IN {roles:['Buzz Lightyear']}]->(b);
MATCH (a:Person {name: 'John Lasseter'}) MATCH (b:Movie {title: 'Toy Story 2'}) MERGE (a)-[:DIRECTED]->(b);
// Splash relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Splash'}) MERGE (a)-[:ACTED_IN {roles:['Allen Bauer']}]->(b);
MATCH (a:Person {name: 'Daryl Hannah'}) MATCH (b:Movie {title: 'Splash'}) MERGE (a)-[:ACTED_IN {roles:['Madison']}]->(b);
MATCH (a:Person {name: 'John Candy'}) MATCH (b:Movie {title: 'Splash'}) MERGE (a)-[:ACTED_IN {roles:['Freddie Bauer']}]->(b);
MATCH (a:Person {name: 'Eugene Levy'}) MATCH (b:Movie {title: 'Splash'}) MERGE (a)-[:ACTED_IN {roles:['Dr. Walter Kornbluth']}]->(b);
MATCH (a:Person {name: 'Ron Howard'}) MATCH (b:Movie {title: 'Splash'}) MERGE (a)-[:DIRECTED]->(b);
// Joe Versus the Volcano relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Joe Versus the Volcano'}) MERGE (a)-[:ACTED_IN {roles:['Joe Banks']}]->(b);
MATCH (a:Person {name: 'Meg Ryan'}) MATCH (b:Movie {title: 'Joe Versus the Volcano'}) MERGE (a)-[:ACTED_IN {roles:['DeDe', 'Angelica Graynamore', 'Patricia Graynamore']}]->(b);
MATCH (a:Person {name: 'John Patrick Stanley'}) MATCH (b:Movie {title: 'Joe Versus the Volcano'}) MERGE (a)-[:DIRECTED]->(b);
// Big relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Big'}) MERGE (a)-[:ACTED_IN {roles:['Josh Baskin']}]->(b);
MATCH (a:Person {name: 'Elizabeth Perkins'}) MATCH (b:Movie {title: 'Big'}) MERGE (a)-[:ACTED_IN {roles:['Susan Lawrence']}]->(b);
MATCH (a:Person {name: 'Robert Loggia'}) MATCH (b:Movie {title: 'Big'}) MERGE (a)-[:ACTED_IN {roles:['MacMillan']}]->(b);
MATCH (a:Person {name: 'Penny Marshall'}) MATCH (b:Movie {title: 'Big'}) MERGE (a)-[:DIRECTED]->(b);
// Catch Me If You Can relationships
MATCH (a:Person {name: 'Leonardo DiCaprio'}) MATCH (b:Movie {title: 'Catch Me If You Can'}) MERGE (a)-[:ACTED_IN {roles:['Frank Abagnale Jr.']}]->(b);
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'Catch Me If You Can'}) MERGE (a)-[:ACTED_IN {roles:['Carl Hanratty']}]->(b);
MATCH (a:Person {name: 'Christopher Walken'}) MATCH (b:Movie {title: 'Catch Me If You Can'}) MERGE (a)-[:ACTED_IN {roles:['Frank Abagnale Senior']}]->(b);
MATCH (a:Person {name: 'Amy Adams'}) MATCH (b:Movie {title: 'Catch Me If You Can'}) MERGE (a)-[:ACTED_IN {roles:['Brenda Strong']}]->(b);
MATCH (a:Person {name: 'Steven Spielberg'}) MATCH (b:Movie {title: 'Catch Me If You Can'}) MERGE (a)-[:DIRECTED]->(b);
// The Terminal relationships
MATCH (a:Person {name: 'Tom Hanks'}) MATCH (b:Movie {title: 'The Terminal'}) MERGE (a)-[:ACTED_IN {roles:['Viktor Navorski']}]->(b);
MATCH (a:Person {name: 'Catherine Zeta-Jones'}) MATCH (b:Movie {title: 'The Terminal'}) MERGE (a)-[:ACTED_IN {roles:['Amelia Warren']}]->(b);
MATCH (a:Person {name: 'Stanley Tucci'}) MATCH (b:Movie {title: 'The Terminal'}) MERGE (a)-[:ACTED_IN {roles:['Frank Dixon']}]->(b);
MATCH (a:Person {name: 'Steven Spielberg'}) MATCH (b:Movie {title: 'The Terminal'}) MERGE (a)-[:DIRECTED]->(b);
// Dataset complete - all relationships use individual MERGE statements
// This pattern ensures proper node creation and cross-linking without gray nodes
#!/bin/bash
set -e
echo "=========================================="
echo "Starting Neo4j Movie Database"
echo "=========================================="
# Check if container already exists
if docker ps -a --format '{{.Names}}' | grep -q '^neo4j-movies$'; then
echo "Removing existing neo4j-movies container..."
docker rm -f neo4j-movies
fi
echo "Starting Neo4j container..."
docker run \
--name neo4j-movies \
-d \
-p 7474:7474 \
-p 7687:7687 \
-v "$(pwd)/movies.cypher:/import/movies.cypher" \
-e NEO4J_AUTH=neo4j/graphrag123 \
-e NEO4J_PLUGINS='["apoc"]' \
-e NEO4J_apoc_import_file_enabled=true \
-e NEO4J_dbms_security_procedures_unrestricted=apoc.* \
-e NEO4J_dbms_security_procedures_allowlist=apoc.* \
neo4j:5.15-community
echo "Waiting for Neo4j to start..."
sleep 5
# Check if Neo4j is responsive
echo "Checking Neo4j health..."
until docker exec neo4j-movies cypher-shell -u neo4j -p graphrag123 "RETURN 1" > /dev/null 2>&1; do
echo " Waiting for Neo4j to be ready..."
sleep 5
done
echo "Loading movie dataset..."
docker exec neo4j-movies \
cypher-shell -u neo4j -p graphrag123 \
-f /import/movies.cypher
echo ""
echo "=========================================="
echo "✓ Neo4j is running!"
echo "=========================================="
echo ""
echo "Neo4j Browser: http://localhost:7474"
echo " Username: neo4j"
echo " Password: graphrag123"
echo ""
echo "To stop Neo4j:"
echo " docker stop neo4j-movies"
echo ""
echo "To view logs:"
echo " docker logs -f neo4j-movies"
echo ""
echo "To remove completely:"
echo " docker rm -f neo4j-movies"
echo "=========================================="
#!/bin/bash
echo "Stopping Neo4j container..."
docker stop neo4j-movies
echo "Removing Neo4j container..."
docker rm neo4j-movies
echo "✓ Neo4j stopped and removed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment