Giter VIP home page Giter VIP logo

neo4j-worldcup's Introduction

World Cup 2014 with Neo4j

We've built a Neo4j World Cup Graph which you can read more about at worldcup.neo4j.org. Instructions on getting it up and running locally are below.

Starting Neo4j

The import of this data set uses LOAD CSV which was introduced in Neo4j 2.1.2 so you'll need to use that version.

You can download Neo4j 2.1.2 from the Neo4j website.

###Mac / Unix

cd /path/to/where/you/installed/neo4j
./bin/neo4j start

###Windows Launch Neo4j using the desktop application

## Importing the data set

Mac / Unix (with command line skillz)

Clone this repository

Set the $WC_DB environment variable to the path to where you've installed Neo4j:

export WC_DB="/path/to/where/you/installed/neo4j"

Run the doit.sh script to import all the data:

./doit.sh

Windows / Not familiar with the command line

Clear everything in the database and create indexes by running the following cypher statements in Neo4j browser

MATCH n OPTIONAL MATCH (n)-[r]-() DELETE n,r;
CREATE INDEX ON :Match(id);
```

```
CREATE INDEX ON :WorldCup(name);
CREATE INDEX ON :Stadium(stadium);
CREATE INDEX ON :Phase(phase);
CREATE INDEX ON :Country(name);
CREATE INDEX ON :Time(time);
CREATE INDEX ON :MatchNumber(value);
CREATE INDEX ON :Player(id);
CREATE INDEX ON :Player(name);

Copy the contents of the following files into your Neo4j browser window one after the other and run them:

Querying the data set

We're collating interesting queries you can write against the data set in queries.cyp. Try some of them out!

Getting the raw data

There are 3 steps to getting the data ready for Neo4j:

  • Find the pages we want to download e.g. all the matches
ruby scripts/find_matches.rb > data/matches.csv
  • Download those pages
# reads from data/matches.csv and downloads into data/matches/
ruby scripts/download_matches.rb
  • Create CSV files that we can use with Neo4j's LOAD CSV
# creates data/import/matches.csv
ruby scripts/to_csv

neo4j-worldcup's People

Contributors

mneedham avatar luanne avatar jexp avatar cjus avatar

Watchers

James Cloos avatar Ilian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.