Today launches the seventh season of “Game of Thrones” with many exciting developments awaiting the audience. Even if we might never see the last two books Winds of Winter and A Dream of Spring published, the TV series producers march ahead and have created their version of events in Westeros.
So like everyone else, we encourage you to become part of the Game of Thrones activities in the next two months.
Publish Graph + Game of Thrones Content = Win Prizes
If you create or publish graphy Game of Thrones content that uses Neo4j, graph visualizations, graph algorithms, combines datasets or any other interesting variants, you’ll be eligible for our weekly GoT prize.
The prize is a Game of Thrones T-shirt of your choice plus EUR 50 worth of GoT paraphernalia (sorry, no swords), e.g., from Elbenwald or similar outlets.
For instance a bag that shows your allegiance to House Stark.
We’ll award seven of these prizes while the series runs, with the first going to Tomaz Bratanic for his already amazing, ongoing blog post series.
If you have any questions around this challenge, please join our Slack Group and ask in the #game-of-thrones channel.
Graph Visualizations of Westeros
As you might have already noticed, the complexity of relationships in the world of Westeros demands a graph visualization.
I am always impressed how applying network analytics on this dataset yields similar insights as reading and understanding the books would give us in terms of relevance of people and events.
First Game of Thrones GraphGists
The first, very basic graph of the Houses of Westeros was for the Neo4j Console which was then soon followed by an accompanying GraphGist.
Here is a much larger dataset, that was also published as a GraphGist.
Teaching Graphs with Game of Thrones
We also used Game Of Thrones to teach graph databases at Women Who Code workshops in London.
My colleague Mark Needham scraped the GoT Wikia data (and some more sources) to use as the dataset.
You can find the data and code here and run the Neo4j Browser guide with :play https://guides.neo4j.com/got_wwc
Analysing GoT Character Co-Occurences
Will Lyon published a Network Analysis of the Game of Thrones based on a dataset of character co-occurences in the third book, A Storm of Swords, published by Andrew Beveridge and Jie Shan.
Will imported the data into Neo4j and shows how to gain insight into the relevance and connections of people by just running a few queries and graph algorithms.
You can run the same data in your Neo4j Browser using :play http://guides.neo4j.com/got
I’m extremely excited that Andrew just tweeted yesterday that they now have all five of the Song of Ice and Fire books processed and the data published.
Winter is coming in 2 days. Check out my network analysis of all 5 books. https://t.co/tjR8543Ijv #GoT #asoiaf #math #NetworkOfThrones
— Andrew Beveridge (@mathbeveridge) July 14, 2017
I’m looking forward to this new data being imported and analysed. With both the graph algorithms in APOC and the new neo4j-graph-algorithms library, this should be easy.
Analysing Kaggle Data
As mentioned in the beginning, Tomaz Bratanic did a great job already in his Game of Thrones series to import the data from Kaggle into Neo4j. And now with his fourth post, he started to analyse it to draw the first insights around battles, deaths and allegiances.
…
Create a network of persons that fought on the same side in the year 299.
MATCH (p1:Person)-[r1]-(b:Battle {year:299})-[r2]-(p2:Person)
WHERE type(r1)=type(r2)
MERGE (p1)-[:FRIEND]-(p2)
Run the algorithms and write back the results as a property of the node community.
CALL algo.unionFind('Person', 'FRIEND', {write:true, partitionProperty:"community"});Show the results of the computation.
MATCH (p:Person) RETURN p.community as community, collect(p.name) AS members, count(*) AS count ORDER BY count DESC LIMIT 10
We observe that 10 different communities (partitions) exist. It is a good representation of the state of alliances that fought together in that specific year. We could do this analysis for a couple of different years and compare alliances over the years on how they change.
…
So have fun watching the new Game of Thrones season, and if you haven’t already, then don’t forget to read the books as well.
And instead of feverishly awaiting the next episode, publish some graph fun with Game of Thrones data and you could be one of our lucky winners.
Cheers,
Michael
Keywords: APOC Game of Thrones graph algorithms Graph Analytics graph database Kaggle neo4j Neo4j Browser Network Analysis network analytics
About the Author
Michael Hunger , Developer Relations
Michael Hunger has been passionate about software development for a very long time. For the last few years he has been working on the open source Neo4j graph database filling many roles.
As caretaker of the Neo4j community and ecosystem he especially loves to work with graph-related projects, users and contributors. As a developer, Michael enjoys many aspects of programming languages, learning new things every day, participating in exciting and ambitious open source projects and contributing and writing software related books and articles.
1 Comment
Leave a Reply
Upcoming Event
Have a Graph Question?
Reach out and connect with the Neo4j staff.
Stack OverflowCommunity Forums
Contact Us
Share your Graph Story?
Email us: content@neo4j.com


We have more datasets here (GraphQL): https://medium.com/@mesirii/a-game-of-data-and-graphql-97ee2ca297ce
From Tomaz Bratanic (Algorithms): https://tbgraph.wordpress.com/?s=Game+of+Thrones
From Chris Willemsen (NLP): https://graphaware.com/neo4j/2017/07/24/reverse-engineering-book-stories-nlp.html