-
-
Save jjaderberg/310d0fb0afb2934e50f1c9df790af6b4 to your computer and use it in GitHub Desktop.
Revisions
-
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,13 +9,13 @@ == 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. -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,16 @@ == Introduction The NFL Draft is an annual event, where young Football players leaving College are selected by the professional NFL teams. Every year, the NFL team with the worst record from the previous season gets to pick first. 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 round - 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. //// Provide an introduction to your domain and what you are trying to accomplish, link to http://a.source.com[sources] as needed. -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -76,11 +76,11 @@ CREATE (t)-[:SELECTION]->(r) [source,cypher] ---- MATCH (p:Player)-[:TO]->(t:Team) RETURN p,t ---- //graph_result //table == REPLACEME: SECOND USE-CASE TITLE @@ -91,8 +91,8 @@ LIMIT 5 [source,cypher] ---- MATCH (p:Player)-[:TO]->(t:Team) RETURN p,t ---- //graph_result -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -75,8 +75,10 @@ CREATE (t)-[:SELECTION]->(r) [source,cypher] ---- MATCH (p:Player)-[:TO]->(t:Team) RETURN a.name, count(*) as freq, collect(t:Team) as Teams ORDER BY freq DESC LIMIT 5 ---- //table -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 14 additions and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,14 +50,19 @@ CREATE [source,cypher] ---- 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) ---- //graph @@ -94,21 +99,14 @@ RETURN path, a, fof // You can also use both graph_result and then table if you return full nodes, relationships or paths //// // optional section == Conclusions // optional section == Resources // optional Footer --- Created by David Oliver - https://twitter.com/DaveOliver79[Twitter] | https://writingfortech.wordpress.com/[Blog] | https://www.linkedin.com/in/david-oliver-97184421/[LinkedIn] -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,7 +50,14 @@ CREATE [source,cypher] ---- 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 (:Round {id: line.Round}) MERGE (:DraftPosition {id: line.`Draft Position`}) MERGE (:Team {name: line.Team}) MERGE (:Player {name: line.Player}) MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) ---- //graph -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 1 addition and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,19 +50,7 @@ CREATE [source,cypher] ---- 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`) ---- //graph -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,8 +61,8 @@ CREATE (pl)-[:TO]->(tm) CREATE (pl)-[:FROM]->(cl) CREATE (pl)-[:PICKED_IN]->(rd) CREATE (pl)-[:PLAYED_IN]->(cn) CREATE (cl)-[:PLAYS_IN]->(cn) CREATE (tm)-[:SELECTION]->(rd) ---- //graph -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -62,7 +62,7 @@ CREATE (pl)-[:FROM]->(cl) CREATE (pl)-[:PICKED_IN]->(rd) CREATE (pl)-[:PLAYED_IN]->(cn) CREATE (College)-[:PLAYS_IN]->(cn) CREATE (Team)-[:SELECTION]->(rd) ---- //graph -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,13 +56,13 @@ MERGE (tm:Team {name: line.Team}) MERGE (ps:Position {name: line.Position}) MERGE (cl:College {name: line.College}) MERGE (cn:Conference {name: line.Conference}) CREATE (pl)-[:POSITION_IS]->(ps) CREATE (pl)-[:TO]->(tm) CREATE (pl)-[:FROM]->(cl) CREATE (pl)-[:PICKED_IN]->(rd) CREATE (pl)-[:PLAYED_IN]->(cn) CREATE (College)-[:PLAYS_IN]->(cn) CREATE (Team)-[:SELECTION]->(rd); ---- //graph -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,18 +51,18 @@ CREATE ---- LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/davidoliverSP2/716ed3b7155efbe78b5bd41d4c3c523a/raw/bcba24649549b58f44563766cba39bdb8ba2931b/draft_data.csv' AS line MERGE (pl:Player {name: line.Player, draftposition: toInt(line.`Draft Position`)}) MERGE (rd:Round {id: toInt(line.Round)}) MERGE (tm:Team {name: line.Team}) MERGE (ps:Position {name: line.Position}) MERGE (cl:College {name: line.College}) MERGE (cn:Conference {name: line.Conference}) CREATE (pl)-[:POSITION_IS]->(ps); CREATE (pl)-[:TO]->(tm) CREATE (pl)-[:FROM]->(cl) CREATE (pl)-[:PICKED_IN]->(rd) CREATE (pl)-[:PLAYED_IN]->(cn) CREATE (College)-[:PLAYS_IN]->(cn) CREATE (Team)-[:SELECTION]->(rd) ---- //graph -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 31 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,33 +23,46 @@ RETURN DISTINCT head(labels(a)) AS This, type(r) as To, head(labels(b)) AS That image::http://i.imgur.com/Rr4qZi3.png[width=600] This domain model diagram was created with the http://www.apcjones.com/arrows/#[Arrows tool] //// CREATE (`0` :Player {`{name`:'Jared Goff}',`{draftposition`:'1}'}) , (`1` :College {`{name`:'California}'}) , (`2` :Team {`{name`:'Los Angeles Rams}'}) , (`3` :Conference {`{name`:'Pac-12}'}) , (`4` :Position {`{name`:'QB}'}) , (`5` :Round {`{name`:'Round 1}'}) , (`0`)-[:`RELATED_TO`]->(`0`), (`0`)-[:`TO`]->(`2`), (`0`)-[:`FROM`]->(`1`), (`1`)-[:`PLAYS_IN`]->(`3`), (`0`)-[:`POSITION_IS`]->(`4`), (`0`)-[:`PICKED_IN`]->(`5`), (`0`)-[:`PLAYED_IN`]->(`3`), (`2`)-[:`SELECTION`]->(`5`) //// == Setup //setup //hide [source,cypher] ---- LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/davidoliverSP2/716ed3b7155efbe78b5bd41d4c3c523a/raw/bcba24649549b58f44563766cba39bdb8ba2931b/draft_data.csv' AS line MERGE (pl:Player {name: line.Player, draftposition: toInt(line.`Draft Position`)}) //MERGE (rd:Round {id: toInt(line.Round)}) //MERGE (tm:Team {name: line.Team}) MERGE (ps:Position {name: line.Position}) //MERGE (cl:College {name: line.College}) //MERGE (cn:Conference {name: line.Conference}) CREATE (pl)-[:POSITION_IS]->(ps); //CREATE (Player)-[:TO]->(Team) //CREATE (Player)-[:FROM]->(College) //CREATE (Player)-[:PICKED_IN]->(Round) //CREATE (Player)-[:PLAYED_IN]->(Conference) //CREATE (College)-[:PLAYS_IN]->(Conference) //CREATE (Team)-[:SELECTION]->(Round) ---- //graph -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ MERGE (:Team {name: line.Team}) MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) MERGE (Player)-[:POSITION_IS]->(Position) CREATE (Player)-[:TO]->(Team) CREATE (Player)-[:FROM]->(College) CREATE (Player)-[:PICKED_IN]->(Round) -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 6 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,18 +37,12 @@ In your setup query you can also use LOAD CSV loading CSV files from your GitHub [source,cypher] ---- LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/davidoliverSP2/716ed3b7155efbe78b5bd41d4c3c523a/raw/bcba24649549b58f44563766cba39bdb8ba2931b/draft_data.csv' AS line MERGE (:Player {name: line.Player, draftposition: toInt(line.`Draft Position`)}) MERGE (:Round {id: toInt(line.Round)}) MERGE (:Team {name: line.Team}) MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) CREATE (Player)-[:POSITION_IS]->(Position) CREATE (Player)-[:TO]->(Team) CREATE (Player)-[:FROM]->(College) -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 12 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,13 +44,18 @@ CREATE (:Player {name: line.Player}) CREATE (:Position {name: line.Position}) CREATE (:College {name: line.College}) CREATE (:Conference {name: line.Conference}) ---- //setup //hide [source,cypher] ---- CREATE (Player)-[:POSITION_IS]->(Position) CREATE (Player)-[:TO]->(Team) CREATE (Player)-[:FROM]->(College) CREATE (Player)-[:PICKED_IN]->(Round) CREATE (Player)-[:PLAYED_IN]->(Conference) CREATE (College)-[:PLAYS_IN]->(Conference) CREATE (Team)-[:SELECTION]->(Round) ---- //graph -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,12 +38,19 @@ In your setup query you can also use LOAD CSV loading CSV files from your GitHub ---- LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/davidoliverSP2/716ed3b7155efbe78b5bd41d4c3c523a/raw/bcba24649549b58f44563766cba39bdb8ba2931b/draft_data.csv' AS line CREATE (:Player {name: line.Player, draftposition: toInt(line.`Draft Position`)}) CREATE (:Round {id: toInt(line.Round)}) CREATE (:Team {name: line.Team}) CREATE (:Player {name: line.Player}) CREATE (:Position {name: line.Position}) CREATE (:College {name: line.College}) CREATE (:Conference {name: line.Conference}) //CREATE (Player)-[:POSITION_IS]->(Position) //CREATE (Player)-[:TO]->(Team) //CREATE (Player)-[:FROM]->(College) //CREATE (Player)-[:PICKED_IN]->(Round) //CREATE (Player)-[:PLAYED_IN]->(Conference) //CREATE (College)-[:PLAYS_IN]->(Conference) //CREATE (Team)-[:SELECTION]->(Round) ---- //graph -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 1 addition and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,20 +37,13 @@ In your setup query you can also use LOAD CSV loading CSV files from your GitHub [source,cypher] ---- LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/davidoliverSP2/716ed3b7155efbe78b5bd41d4c3c523a/raw/bcba24649549b58f44563766cba39bdb8ba2931b/draft_data.csv' AS line CREATE (:Player {name: line.Player, draftposition: toInt(line.`Draft Position`)}) CREATE (:Round {id: line.Round}) CREATE (:Team {name: line.Team}) CREATE (:Player {name: line.Player}) CREATE (:Position {name: line.Position}) CREATE (:College {name: line.College}) CREATE (:Conference {name: line.Conference}) ---- //graph -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,11 +44,11 @@ CREATE (:Player {name: line.Player}) CREATE (:Position {name: line.Position}) CREATE (:College {name: line.College}) CREATE (:Conference {name: line.Conference}) CREATE (Player)-[:POSITION_IS]->(Position) CREATE (Player)-[:TO]->(Team) CREATE (Player)-[:FROM]->(College) CREATE (Player)-[:PICKED_IN]->(Round) CREATE (Player)-[:PLAYED_IN]->(Conference) CREATE (College)-[:PLAYS_IN]->(Conference) CREATE (Team)-[:SELECTION]->(Round) ---- -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 7 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,14 +37,13 @@ In your setup query you can also use LOAD CSV loading CSV files from your GitHub [source,cypher] ---- LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/davidoliverSP2/716ed3b7155efbe78b5bd41d4c3c523a/raw/bcba24649549b58f44563766cba39bdb8ba2931b/draft_data.csv' AS line CREATE (:Player { name: line.Player, draftposition: toInt(line.`Draft Position`)}) CREATE (:Round {id: line.Round}) CREATE (:Team {name: line.Team}) CREATE (:Player {name: line.Player}) CREATE (:Position {name: line.Position}) CREATE (:College {name: line.College}) CREATE (:Conference {name: line.Conference}) CREATE (Person)-[:POSITION_IS]->(Position) CREATE (Person)-[:TO]->(Team) CREATE (Person)-[:FROM]->(College) -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,7 @@ MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) CREATE (:Person { name: line.Player, year: toInt(line.DraftPosition)}) CREATE (Person)-[:POSITION_IS]->(Position) CREATE (Person)-[:TO]->(Team) CREATE (Person)-[:FROM]->(College) CREATE (Person)-[:PICKED_IN]->(Round) -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,7 @@ MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) CREATE (:Person { name: line.Player, year: toInt(line.DraftPosition)}) CREATE (Person)-[:POSITION_IS]->(line.Position) CREATE (Person)-[:TO]->(Team) CREATE (Person)-[:FROM]->(College) CREATE (Person)-[:PICKED_IN]->(Round) -
David Oliver revised this gist
Apr 13, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ MATCH (a)-[r]->(b) WHERE labels(a) <> [] AND labels(b) <> [] RETURN DISTINCT head(labels(a)) AS This, type(r) as To, head(labels(b)) AS That LIMIT 10 //// image::http://i.imgur.com/Rr4qZi3.png[width=600] == Setup -
David Oliver revised this gist
Apr 12, 2017 . 1 changed file with 6 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,11 +44,12 @@ MERGE (:Player {name: line.Player}) MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) CREATE (:Person { name: line.Player, year: toInt(line.DraftPosition)}) CREATE (Person)-[:POSITION_IS]->(Position) CREATE (Person)-[:TO]->(Team) CREATE (Person)-[:FROM]->(College) CREATE (Person)-[:PICKED_IN]->(Round) CREATE (Person)-[:PLAYED_IN]->(Conference) CREATE (College)-[:PLAYS_IN]->(Conference) CREATE (Team)-[:SELECTION]->(Round) ---- -
David Oliver revised this gist
Apr 12, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,7 +44,7 @@ MERGE (:Player {name: line.Player}) MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) CREATE (Player)-[:POSITION_IS]->(Position) CREATE (Player)-[:TO]->(Team) CREATE (Player)-[:FROM]->(College) CREATE (Player)-[:PICKED_IN]->(Round) -
David Oliver revised this gist
Apr 12, 2017 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,13 +44,13 @@ MERGE (:Player {name: line.Player}) MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) CREATE (name.Player)-[:POSITION_IS]->(name.Position) CREATE (Player)-[:TO]->(Team) CREATE (Player)-[:FROM]->(College) CREATE (Player)-[:PICKED_IN]->(Round) CREATE (Player)-[:PLAYED_IN]->(Conference) CREATE (College)-[:PLAYS_IN]->(Conference) CREATE (Team)-[:SELECTION]->(Round) ---- //graph -
David Oliver revised this gist
Apr 12, 2017 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,13 +44,13 @@ MERGE (:Player {name: line.Player}) MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) CREATE (Player.name)-[:POSITION_IS]->(Position.name) CREATE (Player.name)-[:TO]->(Team.name) CREATE (Player.name)-[:FROM]->(College.name) CREATE (Player.name)-[:PICKED_IN]->(Round.name) CREATE (Player.name)-[:PLAYED_IN]->(Conference.name) CREATE (College.name)-[:PLAYS_IN]->(Conference.name) CREATE (Team.name)-[:SELECTION]->(Round.id) ---- //graph -
David Oliver revised this gist
Apr 12, 2017 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,6 +45,12 @@ MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) CREATE (Player)-[:POSITION_IS]->(Position) CREATE (Player)-[:TO]->(Team) CREATE (Player)-[:FROM]->(College) CREATE (Player)-[:PICKED_IN]->(Round) CREATE (Player)-[:PLAYED_IN]->(Conference) CREATE (College)-[:PLAYS_IN]->(Conference) CREATE (Team)-[:SELECTION]->(Round) ---- //graph -
David Oliver revised this gist
Apr 12, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,6 +44,7 @@ MERGE (:Player {name: line.Player}) MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) CREATE (Player)-[:POSITION_IS]->(Position) ---- //graph -
David Oliver revised this gist
Apr 12, 2017 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,7 +36,6 @@ In your setup query you can also use LOAD CSV loading CSV files from your GitHub //hide [source,cypher] ---- LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/davidoliverSP2/716ed3b7155efbe78b5bd41d4c3c523a/raw/bcba24649549b58f44563766cba39bdb8ba2931b/draft_data.csv' AS line MERGE (:Round {id: line.Round}) MERGE (:DraftPosition {id: line.`Draft Position`}) -
David Oliver renamed this gist
Apr 12, 2017 . 1 changed file with 12 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ = The 2016 NFL Draft :neo4j-version: 2.3.0 :author: David Oliver :twitter: @DaveOliver79 :style: red:Person(name) // Please use the style & syntax-help outlined here: https://github.com/neo4j-contrib/graphgist/blob/master/gists/syntax.adoc @@ -21,7 +21,7 @@ MATCH (a)-[r]->(b) WHERE labels(a) <> [] AND labels(b) <> [] RETURN DISTINCT head(labels(a)) AS This, type(r) as To, head(labels(b)) AS That LIMIT 10 //// image::http://i.imgur.com/LXOar25.png[width=600] == Setup @@ -37,15 +37,14 @@ In your setup query you can also use LOAD CSV loading CSV files from your GitHub [source,cypher] ---- CREATE LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/davidoliverSP2/716ed3b7155efbe78b5bd41d4c3c523a/raw/bcba24649549b58f44563766cba39bdb8ba2931b/draft_data.csv' AS line MERGE (:Round {id: line.Round}) MERGE (:DraftPosition {id: line.`Draft Position`}) MERGE (:Team {name: line.Team}) MERGE (:Player {name: line.Player}) MERGE (:Position {name: line.Position}) MERGE (:College {name: line.College}) MERGE (:Conference {name: line.Conference}) ---- //graph
NewerOlder