“Soccer Scouting System” with Neo4j, part 5 - Sun, Feb 18, 2018
So far we have the following:
A connected League structure
A connected Player, Team and Club structure:
We need to connect these together, with the “TAKING_PART” connection.
Added the following code to the one from earlier:
// Init teams
CREATE (myc:Club {id:'myc', name:'My Club'})
CREATE (teamA:Team {id:'mycTeamA', name:'Team A', season:'2015-2016'})
CREATE
(teamA)-[:REPRESENTS {season:'2015-2016'}]->(myc),
(teamA)-[:TAKING_PART]->(tk1516)
CREATE (teamB:Team {id:'mycTeamB', name:'Team B', season:'2015-2016'})
CREATE
(teamB)-[:REPRESENTS {season:'2015-2016'}]->(myc),
(teamB)-[:TAKING_PART]->(eka1516)
// CREATE Players
CREATE (goalie1:Player {name:'Goalie One', birthday:20000101, position:'Goalie', handedness:'right'})
CREATE (player1:Player {name:'Left Defender', birthday:20010101, position:'Left defender', handedness:'left'})
CREATE
(goalie1)-[:SELECTED_FOR]->(teamA),
(player1)-[:SELECTED_FOR]->(teamB)
Results in following graph: