GraphGists

Background

For past 50 years, 007 become a pop culture. In every 007 movies, people focused on the Bond girls and his cars. If you try to organize all data into a chart, it will be a complex graph. I try to import them and ask some questions about the movie.

Import movie profile, actor, director and vehicle data.

Create information graph

Connecting the data nodes with relationships.

Please tell me the top 3 box office of James Bond movie?

MATCH (a:Film) WITH a ORDER BY a.Box DESC RETURN a.Name AS Name, a.Year AS Year, a.Box AS BoxOffice LIMIT 3

How many movie of each James Bond actor?

MATCH (p:People)-[:AS_BOND_IN]->(m:Film)
RETURN p.Name AS Actor, count(p.Name) AS BondMovies

I want to know "Michelle Yeoh" is which year’s Bond Girl, the movie title and her role name.

MATCH (p:People)-[:IS_BOND_GIRL_IN]->(m:Film) WHERE p.Name="Michelle Yeoh"
RETURN m.Year as Year, m.Name as Title, p.Role as Role

List all vehicle brands in Bond movie and its appeared model amouts

MATCH (m:Film)-[:HAS_VEHICLE]->(v:Vehicle)
RETURN DISTINCT v.Brand AS Brand, count(v.Model) AS Models, collect(DISTINCT m.Name) AS Movies
ORDER BY count(v.Model) DESC

Same director may direct many 007 movie, this situation happend many times?

MATCH (d:People)-[r:DIRECTOR_OF]->(f:Film)
RETURN d.Name AS Director, count(r) AS Times
ORDER BY count(r) DESC