“Soccer Scouting System” with Neo4j, part 4

To have an indication on what level the players are playing, it’s useful to know at what league level the team, they play for, is playing.

As an example, since I am currently working for a women team, I have used the league structure used for women soccer in the Netherlands, the first four levels.
This is the structure of leagues from top to the fourth level:competitieThe toplevel is named ‘Eredivisie’. I decided not to translate the names. The ‘Eredivisie’ is the highest level, but only consists of teams that are part of a professional soccer club, like Ajax or PSV. One level below the ‘Eredivisie’ is the highest amateur league named, ‘Topklasse’. Unlike with the men soccer, here there is only one ‘Topklasse’.
One step below the ‘Topklasse’, we have two leagues named ‘Hoofdklasse’, one for the teams playing on Saturday (‘zaterdag’) and one for the teams playing on Sunday (‘zondag’).
The fourth level is named ‘Eerste Klasse’, two leagues for Saturday (A and B) and two for Sunday (C and D).

You can extend this with the next level, but for the example I am using this is enough.

What do we know about these leagues?
Well, the formation of teams is different each season, so we need to add season dependency in our graph, we need a description of a team for each season.

CREATE (t:Timeline {name:'Timeline'}),
    (s1:Season {value:'2014-2015'}),
    (t)-[:SEASON]->(s1),
    (bl:League {id:'bl', name:'BeNe League', season:'2014-2015'}),
    (s1)-[:LEAGUE]->(bl),
    (tk1415:League {id:'tk', name:'Topklasse', season:'2014-2015'}),
    (s1)-[:LEAGUE]->(tk1415),
    (bl)-[:LOWER_LEVEL]->(tk1415),
    (hka1415:League {id:'hka', name:'Hoofdklasse A (zat)', season:'2014-2015'}),
    (s1)-[:LEAGUE]->(hka1415),
    (tk1415)-[:LOWER_LEVEL]->(hka1415),
    (hkb1415:League {id:'hkb', name:'Hoofdklasse B (zon)', season:'2014-2015'}),
    (s1)-[:LEAGUE]->(hkb1415),
    (tk1415)-[:LOWER_LEVEL]->(hkb1415),
    (eka1415:League {id:'eka', name:'Eerste klasse A (zat)', season:'2014-2015'}),
    (s1)-[:LEAGUE]->(eka1415),
    (hka1415)-[:LOWER_LEVEL]->(eka1415),
    (ekb1415:League {id:'ekb', name:'Eerste klasse B (zat)', season:'2014-2015'}),
    (s1)-[:LEAGUE]->(ekb1415),
    (hka1415)-[:LOWER_LEVEL]->(ekb1415),
    (ekc1415:League {id:'ekc', name:'Eerste klasse C (zon)', season:'2014-2015'}),
    (s1)-[:LEAGUE]->(ekc1415),
    (hkb1415)-[:LOWER_LEVEL]->(ekc1415),
    (ekd1415:League {id:'ekd', name:'Eerste klasse D (zon)', season:'2014-2015'}),
    (s1)-[:LEAGUE]->(ekd1415),
    (hkb1415)-[:LOWER_LEVEL]->(ekd1415),
//
    (s2:Season {value:'2015-2016'}),
    (t)-[:SEASON]->(s2),
    (ed1516:League {id:'ed', name:'Eredivisie', season:'2015-2016'}),
    (s2)-[:LEAGUE]->(ed),   
    (tk1516:League {id:'tk', name:'Topklasse', season:'2015-2016'}),
    (s1)-[:LEAGUE]->(tk1516),
    (ed1516)-[:LOWER_LEVEL]->(tk1516),
    (hka1516:League {id:'hka', name:'Hoofdklasse A (zat)', season:'2015-2016'}),
    (s1)-[:LEAGUE]->(hka1516),
    (tk1516)-[:LOWER_LEVEL]->(hka1516),
    (hkb1516:League {id:'hkb', name:'Hoofdklasse B (zon)', season:'2015-2016'}),
    (s1)-[:LEAGUE]->(hkb1516),
    (tk1516)-[:LOWER_LEVEL]->(hkb1516),
    (eka1516:League {id:'eka', name:'Eerste klasse A (zat)', season:'2015-2016'}),
    (s1)-[:LEAGUE]->(eka1516),
    (hka1516)-[:LOWER_LEVEL]->(eka1516),
    (ekb1516:League {id:'ekb', name:'Eerste klasse B (zat)', season:'2015-2016'}),
    (s1)-[:LEAGUE]->(ekb1516),
    (hka1516)-[:LOWER_LEVEL]->(ekb1516),
    (ekc1516:League {id:'ekc', name:'Eerste klasse C (zon)', season:'2015-2016'}),
    (s1)-[:LEAGUE]->(ekc1516),
    (hkb1516)-[:LOWER_LEVEL]->(ekc1516),
    (ekd1516:League {id:'ekd', name:'Eerste klasse D (zon)', season:'2015-2016'}),
    (s1)-[:LEAGUE]->(ekd1516),
    (hkb1516)-[:LOWER_LEVEL]->(ekd1516)

Running this Cypher code in Neo4j, it results in following:
intLeague

One option, I haven’t implement yet is that you can connect, each league within a season, to determine the level, by adding for example, a “NEXT_LEVEL” connector.
Next step, adding teams to leagues and players to teams.