openactive / modelling-opportunity-data

OpenActive Modelling Opportunity Data specification
https://www.openactive.io/modelling-opportunity-data/
Other
6 stars 6 forks source link

Discussion: Leagues and Ringers #144

Open nickevansuk opened 6 years ago

nickevansuk commented 6 years ago

Placeholder for League discussion (split from https://github.com/openactive/modelling-opportunity-data/issues/63)

matdavies commented 4 years ago

For commercial operators, there are a few concepts that will be applicable here, so would need to be modelled:

1) The concept of spaces for teams for a specific season of a league which has a start date (and the start date is currently in the future)

2) As above, but we are part way through a season of a league, and (for example) a team has dropped out, or there are an odd number of teams meaning there is currently a bye for one team per week. In this case, it is preferable to fill that space with another team, but they might not get a full season.

3) The concept of spaces for individuals for a specific season of a league, which has a start date (and the start date is currently in the future). Spaces may be restricted by gender (ie, open for women, but closed for men).

4) As in 3, but where we are part way through a season (so the individual might not get a full season)

5) The concept of individual fixtures where a team captain may be short of players, so are looking for ringers to fill in for them on the day. The fact that they're looking for players may only become apparent a few hours before the fixture in question.

The first 4 items above don't really fit in with the event or event series types I don't think, as, until the registrations have been finalised, and the pitches booked, there aren't yet any fixtures, so no "events" to speak of. Until then, the league is a concept in and of itself with a proposed start date, and a proposed number of fixtures that are likely (but not yet guaranteed) to take place.

Filling these leagues (or individual spaces within leagues) is the primary route to growth for many leagues, so it's this concept that would be most important when it comes to exposing data for consumption by 3rd party apps I believe.

nickevansuk commented 4 years ago

Great points @matdavies, also noting the following classes from schema.org that might be relevant here, in case they're the basis for this model?

matdavies commented 4 years ago

https://schema.org/SportsEvent is a good model for a fixture (though only recently, one of our customers has come up with a NEW format for indoor cricket, which involves THREE teams per fixture, so having a hard coded homeTeam and awayTeam won't work in that scenario, but it remains to be seen if that format has legs).

I guess you MIGHT be able to model a league as an "Event"? https://schema.org/Event There is a startDate and endDate on there, and some capacity concepts, but I think a more specific instance of event would be needed, in order to model the precise registration capabilities of the league (which are going to be the important concepts for commercial operators in their drive to grow their leagues).

And https://schema.org/SportsTeam is a good model for team (though there may be many roles that can be performed on a team, not just "coach" and "athlete" - we have "organiser", "regular", "stand-in" and the next feature we're going to add to the system is the ability for those roles to be made configurable, as even they are too rigid for many customers). So perhaps SportsOrganization would be better (as then the members can have whatever roles they need I think?)

Teams themselves may be looking for players too (take the case where a long running team has paid for a season, but a couple of people have moved back to Australia, so they're looking to fill those places, but on their own, not via the commercial operator). That's slightly different from the "ringer" concept, in that the team is looking for a longer term member of the team, instead of just a player for one night only. That might be useful data for 3rd party applications to have access to, as then there could be some aggregators that could find people available places in teams near them.

nickevansuk commented 4 years ago

All makes sense to me! So taking League as a subclass of Event as you've suggested... here's quick stab at what that might look like?

As an aside: In terms of sample data to use for this, GO Mammoth built their own API to publish their data openly (though this was before any OpenActive modelling specification existed so it's not being used as widely as standards-compliant feeds). Based on this, here's a further reference that might be of interest from the archives: https://github.com/gomammoth/opendata/issues/4

Using GO Mammoth and TTR as a basis, below is a very rough initial proposal.

Does this cover all the key properties? Is there anything else we'd want to include with a league?

After this it would be interesting to model a fixture (following your commendation, using https://schema.org/SportsEvent perhaps with beta:thirdTeam too as a beta property)?!)

League proposal

This proposal includes the following new classes and properties that are not currently defined in the OpenActive model, which have been prefixed with the superfluous "oa:" in the example below to highlight them:

{
  "@context": "https://openactive.io/",
  "identifier": 40,
  "type": "oa:League",
  "superEvent": {
    "type": "EventSeries",
    "identifier": 102,
    "name": "Summer Season 2017",
    "startDate": "2017-06-27",
    "endDate": "2017-08-29"
  },
  "eventSchedule": {
    "type": "Schedule",
    "startDate": "2017-06-27",
    "endDate": "2017-08-29",
    "repeatFrequency": "P1W",
    "byDay": [
      "https://schema.org/Tuesday"
    ],
    "startTime": "19:00",
    "endTime": "21:00",
    "timeZone": "Europe/London"
  },
  "name": "Netball - Ladies (Battersea Park - Tues - Rec)",
  "offers": [
    {
      "type": "Offer",
      "name": "Individual registration",
      "url": "https://www.gomammoth.co.uk/individual-checkout/?leagueid=40",
      "description": "Sign up and we're place you in a team.",
      "price": "65",
      "priceCurrency": "GBP",
      "oa:deposit": {
        "type": "MonetaryAmount",
        "amount": "0",
        "currency": "GBP"
      }
    },
    {
      "type": "Offer",
      "name": "Team registration",
      "url": "https://www.gomammoth.co.uk/teams-checkout/?leagueid=40",
      "description": "Full team registration.",
      "price": "450",
      "priceCurrency": "GBP",
      "oa:deposit": {
        "type": "MonetaryAmount",
        "amount": "0",
        "currency": "GBP"
      }
    }
  ],
  "oa:maximumTeamCapacity": 14,
  "oa:remainingTeamCapacity": 6,
  "oa:numberOfGames": 8,
  "oa:playersPerSide": 6,
  "description": "Tuesday - Ladies - Recreational",
  "genderRestriction": "https://openactive.io/FemaleOnly",
  "level": ["Beginner", "Intermediate", "A-Grade"],
  "facilityType": [
    {
      "type": "Concept",
      "id": "https://openactive.io/facility-types#a5ac16fe-06ac-4bc1-93f7-69ff3bfcf3b9",
      "prefLabel": "3G Artificial Grass",
      "inScheme": "https://openactive.io/facility-types"
    }
  ],
  "location": {
    "type": "Place",
    "identifier": 18,
    "name": "Battersea Park",
    "description": "A more detailed description of the location.",
    "hasMap": "https://www.google.co.uk/maps/place/Millennium+Arena/@51.4810847,-0.1515177,21z/data=!4m2!3m1!1s0x4876050595ea62f3:0x30b0ae2a271b6275",
    "address": {
      "type": "PostalAddress",
      "streetAddress": "Battersea Park Millenium Arena, Albert Bridge Rd ",
      "addressRegion": "London",
      "postalCode": "SW114NJ",
      "descrition": "Exit Battersea Park or Queens Road...",
      "image": "https://www.gomammoth.co.uk/wp-content/uploads/venue-images/netball/battersea-park/gomammoth-netball-battersea-park.jpg",
    },
    "geo": {
      "type": "GeoCoordinates",
      "identifier": 4326,
      "latitude": 51.4810847,
      "longitude": -0.1515177
    },
    "image": [
      {
        "type": "ImageObject",
        "url": "https://s3-eu-west-2.amazonaws.com/prod-everyoneactive-wp/wp-content/uploads/2018/04/13112215/Acton_HeaderBanner.png"
      }
    ]
  },
  "activity": {
    "type": "Concept",
    "id": "https://openactive.io/activity-list#fbdc35a8-3dd0-40ee-a7ca-6ff40b3e5f90",
    "prefLabel": "Netball",
    "inScheme": "https://openactive.io/activity-list"
  }
}