Soccer Scouting System, part 4 and 5
Decided to rewrite the Leagues CREATE statement. Now you can see the relation between each league per season.
CREATE (t:Timeline {name:'Timeline'})
CREATE (s1:Season {value:'2014-2015'})
CREATE (bl:League {id:'bl', name:'BeNe League', season:'2014-2015'})
CREATE (tk1415:League {id:'tk', name:'Topklasse', season:'2014-2015'})
CREATE (hka1415:League {id:'hka', name:'Hoofdklasse A (zat)', season:'2014-2015'})
CREATE (hkb1415:League {id:'hkb', name:'Hoofdklasse B (zon)', season:'2014-2015'})
CREATE (eka1415:League {id:'eka', name:'Eerste klasse A (zat)', season:'2014-2015'})
CREATE (ekb1415:League {id:'ekb', name:'Eerste klasse B (zat)', season:'2014-2015'})
CREATE (ekc1415:League {id:'ekc', name:'Eerste klasse C (zon)', season:'2014-2015'})
CREATE (ekd1415:League {id:'ekd', name:'Eerste klasse D (zon)', season:'2014-2015'})
CREATE
(t)-[:SEASON]->(s1),
(s1)-[:LEAGUES]->(bl),
(bl)-[:LOWER_LEVEL]->(tk1415),
(tk1415)-[:LOWER_LEVEL]->(hka1415),
(tk1415)-[:LOWER_LEVEL]->(hkb1415),
(hka1415)-[:LOWER_LEVEL]->(eka1415),
(hka1415)-[:LOWER_LEVEL]->(ekb1415),
(hkb1415)-[:LOWER_LEVEL]->(ekc1415),
(hkb1415)-[:LOWER_LEVEL]->(ekd1415)
CREATE (s2:Season {value:'2015-2016'})
CREATE (ed1516:League {id:'ed', name:'Eredivisie', season:'2015-2016'})
CREATE (tk1516:League {id:'tk', name:'Topklasse', season:'2015-2016'})
CREATE (hka1516:League {id:'hka', name:'Hoofdklasse A (zat)', season:'2015-2016'})
CREATE (hkb1516:League {id:'hkb', name:'Hoofdklasse B (zon)', season:'2015-2016'})
CREATE (eka1516:League {id:'eka', name:'Eerste klasse A (zat)', season:'2015-2016'})
CREATE (ekb1516:League {id:'ekb', name:'Eerste klasse B (zat)', season:'2015-2016'})
CREATE (ekc1516:League {id:'ekc', name:'Eerste klasse C (zon)', season:'2015-2016'})
CREATE (ekd1516:League {id:'ekd', name:'Eerste klasse D (zon)', season:'2015-2016'})
CREATE
(t)-[:SEASON]->(s2),
(s2)-[:LEAGUES]->(ed1516),
(ed1516)-[:LOWER_LEVEL]->(tk1516),
(tk1516)-[:LOWER_LEVEL]->(hka1516),
(tk1516)-[:LOWER_LEVEL]->(hkb1516),
(hka1516)-[:LOWER_LEVEL]->(eka1516),
(hka1516)-[:LOWER_LEVEL]->(ekb1516),
(hkb1516)-[:LOWER_LEVEL]->(ekc1516),
(hkb1516)-[:LOWER_LEVEL]->(ekd1516)
This results in following picture:
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: