GraphGists

Penn State 2014 Football Schedule

In honor of the new Penn State football coach James Franklin, this GraphGist combines NCAA football and Cypher queries. 2014 will be an important year. Not only will it be James Franklin’s first season as head coach, but there will be new Big 10 division assignments. These preserve rivalries and create divisions based on their location of East/West geography.

Initialize Graph

Basic information about the graph

	MATCH n-[r]-()
	WITH count(DISTINCT n) AS numNodes, count(DISTINCT r) AS numRelationships
	RETURN numNodes, numRelationships

Show nodes Penn State will play in the 2014 season.

	MATCH (n { name: "Penn State University" })-[r:plays]->(c)
	RETURN r

Show number of teams Penn State will play in the 2014 season and their names.

	MATCH (team:school)
	WHERE team.name<> "Penn State University"
	RETURN  count(*) AS count, collect(team.name) AS teams

Show number of teams Penn State will play in the 2014 per conference.

	MATCH (team:school)--(conf:conference)
	WHERE team.name <> "Penn State University"
	RETURN count(*) AS count, conf.name AS Conference

Show all teams Penn State will play in the 2014 season that belong to the ACC (American Athletic Conference).

	MATCH (school { name:"Penn State University" })--(team)--(conference)
	WHERE conference.name = "American Athletic Conference"
	RETURN team.name

Show all nodes of teams Penn State will play in the 2014 season that are division rivals in the Big Ten Eastern division.

	MATCH (psu { name:'Penn State University' })--(team)--(conferance)--(division)
	WHERE conferance.name = "Big Ten" AND division.name = "Eastern" AND filter(x IN division.teams
																			   WHERE x = team.name)
	RETURN team

Show the average age of the schools Penn State will play in the 2014 season (most of the teams were established before Penn State).

	MATCH (s:school)
	WHERE s.name <> "Penn State University"
	RETURN avg(2014 - s.established) as AverageYearsOld