Skip to content

Instantly share code, notes, and snippets.

@davidoliverSP2
Forked from jexp/graph_gist_template.adoc
Last active May 11, 2017 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save davidoliverSP2/e073b2c1be5dd9136ccb9edda646ed67 to your computer and use it in GitHub Desktop.
Save davidoliverSP2/e073b2c1be5dd9136ccb9edda646ed67 to your computer and use it in GitHub Desktop.
The 2016 NFL Draft

The 2016 NFL Draft

Introduction

The NFL Draft is an annual event, where young football players at the end of their College careers are selected by the professional NFL teams. Every year, the first overall pick is allocated to the NFL team with the worst record from the previous season. At the end of the 1st round, the reigning champions finally get to make their selection.

There are 32 professional teams in the NFL, so each round in the draft consists of 32 selections. To add an extra twist, the NFL teams can use their picks as currency, trading up and down the draft board. In any given draft, you can find NFL teams with 2 or 3 picks in the first couple of rounds - they will have traded places with other teams; sometimes for better selections, sometimes to move down the draft and gain more picks, or sometimes by trading away existing players for extra picks.

This GraphGist uses the data from the 2016 NFL Draft, with all the players taken in the 7 rounds of selections. Using this data, we can map which teams selected the most players, who the fewest, and find patterns in the positions of players selected.

Rr4qZi3

This domain model diagram was created with the Arrows tool

Setup

LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/davidoliverSP2/716ed3b7155efbe78b5bd41d4c3c523a/raw/bcba24649549b58f44563766cba39bdb8ba2931b/draft_data.csv' AS line
MERGE (p:Player {name: line.Player}) ON CREATE SET p.DraftPosition = toInt(line.`Draft Position`)
MERGE (r:Round {id: line.Round})
MERGE (t:Team {name: line.Team})
MERGE (s:Position {name: line.Position})
MERGE (l:College {name: line.College})
MERGE (n:Conference {name: line.Conference})
CREATE (p)-[:POSITION_IS]->(s)
CREATE (p)-[:TO]->(t)
CREATE (p)-[:FROM]->(l)
CREATE (p)-[:PICKED_IN]->(r)
CREATE (p)-[:PLAYED_IN]->(n)
CREATE (l)-[:PLAYS_IN]->(n)
CREATE (t)-[:SELECTION]->(r)

REPLACEME: FIRST USECASE TITLE

MATCH (p:Player)-[:TO]->(t:Team)
RETURN p,t

REPLACEME: SECOND USE-CASE TITLE

MATCH (p:Player)-[:TO]->(t:Team)
RETURN p,t

Conclusions

Resources


Created by David Oliver - Twitter | Blog | LinkedIn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment