GraphGists

Introduction

The example graph consists of characters in IMDB Top 100 Bollywood Movies till 2016 - the Indian Hollywood. Key nodes - Movie and Person Person comprise of Actors and Movie Directors. We will try to find out some key chacterstics and see some intersting pattern emerging out.

Setup

Data Model

Lets look at the overall Graph Model

match (m:Movie)<-[r]-(p) return m,r,p ORDER BY m.Rating desc limit 200

Top 10 Actor with most movies in top 100:

MATCH (n:Person)-[:ACTOR_OF]->(m:Movie) RETURN n.name, COUNT(m) AS score ORDER BY score DESC limit 10

Top 10 Director with most movies in top 100:

MATCH (n:Person)-[:DIRECTOR_OF]->(m:Movie) RETURN n.name, COUNT(m) AS score ORDER BY score DESC limit 10

With how many Actors Shah_Rukh_Khan connected to:

match(n:Person{name:'Shah_Rukh_Khan'})-[:ACTOR_OF]->(m:Movie) <-[:ACTOR_OF]-(k:Person) return count(k.name)

Year with counts of movie in desc order

match(m:Movie) return m.ReleaseDate,count(*) order by count(*) desc

No of Comedy Movies:

MATCH (m:Movie) where toLower(m.Genres) contains 'comedy' return count(m)

All Directors that are Actors as well and their movies:

match (n:Movie)<-[r:DIRECTOR_OF]-(p:Person)-[q:ACTOR_OF]->(m:Movie) return n,r,p,q,m

Display all the movies where person directed and acted both:

match (n:Movie)<-[r:DIRECTOR_OF]-(p:Person)-[q:ACTOR_OF]->(n:Movie) return n,r,p,q

Conclusion

Shahrukh Khan and Amitabh Bachchan being the top actors having almost 10% of top 100 Movies which is a phenomenal number. Anurag_Kashyap is the top directors.

Resources

IMDB