Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

JSON Schema for game stats #50

Open
ahstein3521 opened this issue Aug 3, 2017 · 13 comments
Open

JSON Schema for game stats #50

ahstein3521 opened this issue Aug 3, 2017 · 13 comments

Comments

@ahstein3521
Copy link
Contributor

We're going to introduce stat tracking on a sport-by-sport basis. We'll need a JSON schema for each sport. Please leave a comment with a proposed schema including any attributes you think we'd need to store that are important to stat-keeping for that sport.

The sports we're currently offering are:

  • Soccer

  • Football

  • Basketball

  • Baseball

  • Hockey

I'd be happy to answer any questions. Thanks in advance.

@ajGingrich
Copy link
Contributor

This is my first time contributing and I would like to work on this. I will shortly post a proposed schema once I get the project working on my local machine to understand if this is team oriented or individual stats.

@ahstein3521
Copy link
Contributor Author

ahstein3521 commented Aug 9, 2017 via email

@ahstein3521
Copy link
Contributor Author

ahstein3521 commented Aug 9, 2017 via email

@ajGingrich
Copy link
Contributor

ajGingrich commented Aug 10, 2017

I was able to run the developement originally but and I tried to log-in with Google but had an error from my app consol.e. I fixed the error and now I have an error connected to mongoDB. The app will start after npm run dev but I hangs on the login.

Error connecting to MongoDB: { MongoError: connection 0 to ds031617.mlab.com:31617 timed out

I also am getting a large amount of webpack compilation errors such as these: error Casing of react does not match the underlying filesystem import/no-unresolved But I don't think they are crucial.

@ajGingrich
Copy link
Contributor

ajGingrich commented Aug 10, 2017

I wrote a basic schema for the sports. Obviously there are alot of stats for each sports so I didn't include everything. Let me know what you think.

{
"soccer": {
	"gameResult": "string",
	"offensive": {
		"goals": "integer",
		"assists": "integer",
		"shots": "integer",
		"shotsOnTarget": "integer",
	}
	"defensive": {
		"goalsAgainst": "integer",
		"shotsAllowed": "integer",
		"shotsOnTargetAllowed": "integer"
	}
	"goalkeeping": {
		"saves" "integer",
		"cleanSheet": "boolean"
	},
	"possesion": "integer",
	"yellowCards": "integer",
	"redCards": "integer"
	
},
"football": {
	"gameResult": "string",
	"offensive": {
		"points": "integer",
		"yardsPerGame": "integer",
		"rushingTouchdowns": "integer",
		"passingTouchdowns": "integer"
	},
	"defensive": {
		"pointsAgainst": "integer",
		"yardsPerGameAllowed": "integer",
		"rushingTouchdowonsAgainst" "integer",
		"passingTouchdowonsAgainst" "integer",
		"sacks": integer
	},
	"specialTeams": {
		"fieldGoalsAttempted": "integer",
		"fieldGoalsMade": "integer",
		"puntReturnsForTouchdown"
	}
},
"basketball": {
	"gameResult": "string",
	"offensive": {
		"points": "integer",
		"assists": "integer",
		"turnovers": "integer",
		"rebounds": "integer",
		"fieldGoalPercentage": {
			overall: "integer"
			freeThrow: "integer",
			twoPoint: "integer",
			threePoint: "integer"
		},
	},
	"defensive": {
		"pointsAgainst": "integer",
		"steals": "integer",
		"bloacks": "integer",
		"rebounds": "integer",
		"fieldGoalPercentage": {
			overall: "integer"
			freeThrow: "integer",
			twoPoint: "integer",
			threePoint: "integer"
		}
	},
	"personalFouls": "integer"
},
"baseball": {
	"gameResult": "string",	
	"batting": {
		"runsScored": "integer",
		"battingAverage": "integer",
		"homeruns": integer
	},
	"pitching": {
		"earnedRunsAgainst": "integer",
		"battingAverageAgainst": "integer",
		"homerunsAgainst": "integer",
	},
	"steals": "integer",
	"errors": "integer"
},
"hockey": {
	"gameResult": "string",
	"overtime": "boolean",
         "penaltyTime: "integer",
	"offensive": {
		"goals": 'integer,
		"assists": integer,
		"powerPlayPecentage": "integer"
		"shots": "integer",
		"shotsOnTarget": "integer"
	},
	"defensive": {
		"goalsAllowed": "integer",
		"assistsAllowed": integer,
		"powerPlayPecentageAllowed": "integer"
		"shotsAllowed": "integer",
		"shotsOnTargetAllowed": "integer"
	}
  }
}

@paulywill
Copy link
Member

For hockey there should be a stat on "Penalty Time" as well.

@ajGingrich
Copy link
Contributor

For hockey there should be a stat on "Penalty Time" as well.

thanks for suggestion. I updated the hockey schema to include Penalty Time

@Knochenmark
Copy link

You might want to split up the stats into general game stats, stats for home and guest team. Otherwise I dont understand how you would use the "possesion" stat from soccer for example. Which would then be always 100%? Splitting the stats up would also allow for a "goal" property on each team object from which you can construct the end result instead of storing it as a string.

@ajGingrich
Copy link
Contributor

I believe each team would have JSON data for each game so it would already be split up.

@Knochenmark
Copy link

Just did some digging and the first API i found also splits the home/away team. My main point stands, that saving the result as a string is a bad idea. It is way easier to construct the result from 2 properties and this allows for easier filtering of the match objects.
https://docs.crowdscores.com/#page:matches,header:matches-match-details

I've also seen they have further information like if a game went into extra time, if there was a penalty shot out etc.

@thejayhaykid
Copy link

I'm focusing on football specifically cause I really want to make a football stats app cause I haven't found one. I looked at the team stats from maxpreps.com and looking at box scores from ESPN. This would be duplicated for home and away teams.

"football": {
	"gameResult": "string",
	"offensive": {
		"points": "integer",
		"passingYards": "integer",
                "rushingYards": "integer",
                "totalYards": "integer",
                "passingPlays": "integer",
                "rushingPlays": "integer",
                "totalPlays": "integer",
                "yardsPerPlay": "float",
                "fumbles": "integer",
                "interceptions": "integer",
                "turnovers": "integer",
		"rushingTouchdowns": "integer",
		"passingTouchdowns": "integer",
                "redZoneAttempts": "integer",
                "redZoneScores": "integer",
                "penalties": "integer",
                "penaltyYards": "integer",
                "timeOfPossession": "integer"
	},
	"defensive": {
		"pointsAgainst": "integer",
		"rushingYards": "integer",
                "passingYards": "integer",
                "tackles": "integer",
                "tacklesForLoss": "integer",
                "sacks": "integer",
                "forcedFumbles": "integer",
                "recoveredFumbles": "integer",
                "passesDefended": "integer",
                "interceptions": "integer",
                "safeties": "integer",
		"rushingTouchdownsAgainst": "integer",
		"passingTouchdownsAgainst": "integer",
                "rushingPlays": "integer",
                "passingPlays": "integer",
                "totalPlays": "integer"
	},
	"specialTeams": {
		"fieldGoalsAttempted": "integer",
		"fieldGoalsMade": "integer",
                "punts": "integer",
                "puntBlocks": "integer",
		"puntReturnsForTouchdown": "integer",
                "kickReturnsForTouchdowns": "integer",
                "puntReturnYards": "integer",
                "kickReturnYards": "integer"
	}
}

@jstephenperry
Copy link

What is the status on implementing this feature? I'd like to help implement a detailed soccer JSON structure as a current competitive soccer referee.

@makkoli
Copy link
Contributor

makkoli commented Apr 20, 2018

@jstephenperry I don't think anyone is currently actively working on this. This isn't high priority, but does need to be done.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants