Neo4j Online Meetup: Desktop Graph Analytics: For The Throne

Almost two years ago we released the Neo4j Graph Algorithms library, which made it easy for developers to run algorithms like PageRank, Louvain Modularity, and weighted shortest path, amongst others on their graph data.

In January Irfan and I were chatting, and we thought it'd be cool if we could open up the power of graph algorithms to users that don't want to spend their days writing Cypher code. In this meetup we'll show you a Graph App that we've built called Neuler which aims to solve this problem.

So we've got the App, but what data should we use to show it off...

In April Game of Thrones is back for its 8th and final season, and Professor Andrew Beveridge has made character interaction data available for the 7 seasons that we've had so far.

In this meetup we'll use Neuler to analyse Game of Thrones, and while we might not be able to predict who'll end the show on the throne, we'll show how graph algorithms can help us understand the show without even watching it.

There probably will be spoilers.

#ForTheThrone

1 Like

Thanks for submitting!

I’ve added a tag that allows your blog to be displayed on the community home page!

#ForTheThrone

Hi! To find out what I can do, say @greta display help.

If you'd like to follow along with today's meetup, the following script will import our dataset:

CREATE CONSTRAINT ON (c:Character)
ASSERT c.id IS UNIQUE;

UNWIND range(1,7) AS season
LOAD CSV WITH HEADERS FROM "https://github.com/mneedham/gameofthrones/raw/master/data/got-s" + season + "-nodes.csv" AS row
MERGE (c:Character {id: row.Id})
ON CREATE SET c.name = row.Label;

UNWIND range(1,7) AS season
LOAD CSV WITH HEADERS FROM "https://github.com/mneedham/gameofthrones/raw/master/data/got-s" + season + "-edges.csv" AS row
MATCH (source:Character {id: row.Source})
MATCH (target:Character {id: row.Target})
CALL apoc.merge.relationship(source, "INTERACTS_SEASON" + season, {}, {}, target) YIELD rel
SET rel.weight = toInteger(row.Weight);

This was an awesome meetup, I can recommend to everyone to check this out!!

Thanks for excellent session.

Can you post the installation URL here? Also can we install this on an evaluation copy of Neo4j?

http://bit.ly/install-neuler

Thanks. I could not find a separate thread for questions on Neuler. So pardon me for asking here itself

  1. How do I give a Cypher projection as input? Currently I am able to select Node and relations only. However I would like the algorithms to be executed on sub-graph.

  2. The visualization and code options are very good. Is there any flexibility in terms of choosing the colors dynamically based on Node label or property values?

  3. Is this intended as standalone application? If we are developing an application how do we imbed this? (or we will have to directly write the queries within application?)

  • How do I give a Cypher projection as input? Currently I am able to select Node and relations only. However I would like the algorithms to be executed on sub-graph.

-> not yet, it's planned

  • The visualization and code options are very good. Is there any flexibility in terms of choosing the colors dynamically based on Node label or property values?

-> that's also planned what were you thinking about?

  • Is this intended as standalone application? If we are developing an application how do we imbed this? (or we will have to directly write the queries within application?)

-> currently yes as standalone applciation.
what were you imagining for embeddding? react components?

/cc @mark.needham

In visualization, can I color code based value returned ( say centrality score). If I choose blue as base color, based on centrality score - visualization should give different color shades of blue (from dark to light). The relation links could have varying thickness

I am also trying to implement above in neo4jd3.js. but not successful. Any pointers, welcome

Also one more request for feature.

How to debug algorithms? Say for eg. I am using Centrality. The inputs given are Node label and relation. But I get back as only zero. What should I do in such scenarion

Just share your exact details but please start a new topic!! in #neo4j-graph-platform:graph-algorithms

Hi, Excellent Demo, My Question is, after running some Graph Algorithm is it possible to export the results as a file say .csv or excel, having all the list of nodes and properties and corresponding graph algo results like degree, pageranks, betweenness………….
Thanks

You can use call algo.pageRank.stream(...) yield nodeId, score and export the results as csv in neo4j browser. Or with Neo4j shell with --format:plain

1 Like