Skip to content

Instantly share code, notes, and snippets.

Created August 22, 2017 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/7cc292cf1aed24a7a80f3555085cf85b to your computer and use it in GitHub Desktop.
Save anonymous/7cc292cf1aed24a7a80f3555085cf85b to your computer and use it in GitHub Desktop.
MATCH(vote:HallOfFame{inducted: 'Y'})
WITH vote
MATCH(player:People{playerID: vote.playerID})
RETURN player, vote
MATCH p=()-[r:WAS_INDUCTED_TO_HALL_OF_FAME]->() RETURN p LIMIT 25;
MATCH(vote:HallOfFame{inducted: 'Y'})
WITH vote
MATCH(person:People{playerID: vote.playerID})
MERGE(person)-[:WAS_INDUCTED_TO_HALL_OF_FAME]->(vote);
// People to Batting
MATCH (player:People)
WITH player
MATCH (playerStats:Batting{playerID:player.playerID})
MERGE (player)-[:HAS_BATTING_STATISTICS]->(playerStats);
// People to Fielding
MATCH (player:People)
WITH player
MATCH (playerStats:Fielding{playerID:player.playerID})
MERGE (player)-[:HAS_FIELDING_STATISTICS]->(playerStats);
// People to Pitching
MATCH (player:People)
WITH player
MATCH (playerStats:Pitching{playerID:player.playerID})
MERGE (player)-[:HAS_PITCHING_STATISTICS]->(playerStats);
// Team to Player Batting Stats
MATCH (team:Teams)
WITH team
MATCH (playerStats:Batting{teamID:team.teamID, yearID: team.yearID})
MERGE (playerStats)-[:BATTED_FOR]->(team);
// Team to Player Pitching Stats
MATCH (team:Teams)
WITH team
MATCH (playerStats:Pitching{teamID:team.teamID, yearID: team.yearID})
MERGE (playerStats)-[:PITCHED_FOR]->(team);
// Team to Player Fielding Stats
MATCH (team:Teams)
WITH team
MATCH (playerStats:Fielding{teamID:team.teamID, yearID: team.yearID})
MERGE (playerStats)-[:FIELDED_FOR]->(team);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment