Link to home
Get AccessLog in
Avatar of Neil Thompson
Neil ThompsonFlag for United Kingdom of Great Britain and Northern Ireland

asked on

issues getting schema.org right for multiple sportsevents

hi

I'm fairly new to the schema.org side of things and wanted to add some data for our rugby club for the next matches to be shown on the google search results.

When validating only the first event comes up and I'm getting an exclamation mark next to my use of "SportsEvent" at the top. I'm wondering If this should be RugbyClub with the events created under them?

Would anyone be able to steer me in the right direction by correcting this piece of code, or pointing me to some working examples I can learn more from.

Thanks, Neil


<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "SportsEvent",
  "name": "Lordswood First XV",  
  "awayTeam": "Lordswood",
  "homeTeam": "Sheppey",
  "startDate" : "2016-02-13T14:00",
  "endDate" : "2016-02-13T16:00",
  "url" : "http://www.lordswoodrfc.co.uk/teams/lordswood-1st-xv/fixtures/",
  "location" : {
    "@type" : "Place",
    "sameAs" : "http://www.pitchero.com/clubs/sheppeyrfc",
    "name" : "Sheppey Rugby Football Club",
    "address" : "Lower Rd, Sheerness ME12 3ST"
  }
},
{
  "@context": "http://schema.org",
  "@type": "SportsEvent",
  "name": "Lordswood First XV",  
  "awayTeam": "Beccehamian",
  "homeTeam": "Lordswood",
  "startDate" : "2016-02-20T14:00",
  "endDate" : "2016-02-20T16:00",
  "url" : "http://www.lordswoodrfc.co.uk/teams/lordswood-1st-xv/fixtures/",
  "location" : {
    "@type" : "Place",
    "sameAs" : "http://www.lordswoodrfc.co.uk",
    "name" : "Lordswood Rugby Football Club",
    "address" : "The Clubhouse, North Dane Way, Chatham ME5 8YE"
  }
}
</script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
Jumping in the deep end here so hopefully this is useful

Having read the SportsEvent page on schema.org( https://schema.org/SportsEvent) it seems to suggest that you should create your games as sub-events. Their example creates the World Series as an event with games as sub-events which seems to be similar to what you are doing.

I have no way of testing but I would try that
Avatar of Neil Thompson

ASKER

Thanks guys, I've altered the time to the correct zone now using the Z

I've also tried the sub-event but this appears to require all the events to take place in 1 location as the root "sportsEvent" needs a location.

This is what I have so far which seems to validate ok, just waiting for Google to re-index to see what it turns out like

<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "SportsEvent",
        "name": "Lordswood 1st XV",
        "awayTeam": {
            "@type": "SportsTeam",
            "name": "Lordswood",
            "sameAs": "http://www.lordswoodrfc.co.uk"
        },
        "homeTeam": {
            "@type": "SportsTeam",
            "name": "Sheppey",
            "sameAs": "http://www.pitchero.com/clubs/sheppeyrfc"
        },
        "startDate": "2016-02-13T14:00",
        "endDate": "2016-02-13T15:30",
        "url": "http://www.lordswoodrfc.co.uk/teams/lordswood-1st-xv/fixtures/",
        "location": {
            "@type": "Place",
            "sameAs": "http://www.pitchero.com/clubs/sheppeyrfc",
            "name": "Sheppey Rugby Football Club",
            "address": "Lower Rd, Sheerness ME12 3ST"
        },
        "offers": {
            "price": "0",
            "url": "http://www.pitchero.com/clubs/sheppeyrfc"
        }
    }
</script>
<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "SportsEvent",
        "name": "Lordswood 1st XV",
        "awayTeam": {
            "@type": "SportsTeam",
            "name": "Beccehamian",
            "sameAs": "http://www.pitchero.com/clubs/beccehamianrfc"
        },
        "homeTeam": {
            "@type": "SportsTeam",
            "name": "Lordswood",
            "sameAs": "http://www.lordswoodrfc.co.uk"
        },
        "startDate": "2016-02-20T14:00",
        "endDate": "2016-02-20T15:30",
        "url": "http://www.lordswoodrfc.co.uk/teams/lordswood-1st-xv/fixtures/",
        "location": {
            "@type": "Place",
            "sameAs": "http://www.lordswoodrfc.co.uk",
            "name": "Lordswood Rugby Football Club",
            "address": "The Clubhouse, North Dane Way, Chatham ME5 8YE"
        },
        "offers": {
            "price": "0",
            "url": "http://www.lordswoodrfc.co.uk"
        }
    }
</script>

Open in new window

SOLUTION
Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
Hi Julian

You are right but my requirements are slightly different. This is for a rugby team that play matches weekly either at home or away so there will not be a fixed initial location such as an "arena" which is then divided into smaller "zones" as such to host the subEvents.

I was looking at your example to try to make a 2016 Matches "event" with every actual first/second team home/away match as sub events but it doesn't like that.

Thanks for all your help though guys, you've both given me helpful info and examples that I can go on to use elsewhere :)