Reputation: 153
I am experimenting with microdata in particular the use of schema.org tags. I am trying to describe multiple sports events that may have the same location property.
<!--Sports Events -->
<div itemscope itemtype="http://schema.org/SportsEvent">
<span itemprop="name" style="font-weight:bold;">Event One</span><br />
<meta itemprop="location" content="venue" itemscope itemtype="http://schema.org/Place" itemref="olympicpark" />
<meta itemprop="startDate" content="2011-08-04T10:00">
<meta itemprop="endDate" content="2011-08-04T13:45">
</div>
<div itemscope itemtype="http://schema.org/SportsEvent">
<span itemprop="name" style="font-weight:bold;">Event Two</span><br />
<meta itemprop="location" content="venue" itemscope itemtype="http://schema.org/Place" itemref="olympicpark" />
<meta itemprop="startDate" content="2011-08-04T10:00">
<meta itemprop="endDate" content="2011-08-04T13:45">
</div>
<!--End Events -->
<!--Places -->
<h3>Venues</h3>
<div id="olympicpark">
<a itemprop="url" href="http://www.london2012.com/olympic-park">Olympic Park</a>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">Olympic Park</span>
<span itemprop="addressLocality">Stratford</span>
<span itemprop="addressRegion">London</span>
<span itemprop="postalCode">E20 2ST</span>
</div>
<div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
<meta itemprop="latitude" content="51.54615" />
<meta itemprop="longitude" content="-0.01269" />
</div>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">4</span> stars - based on
<span itemprop="reviewCount">250</span> reviews
</div>
</div>
<!-- End Places -->
The property "location" of each sport event is linked to the "olympic park" place via the itemref property. This seems to be correct, and the google rich snippets tool reports no errors. My only concern is that the rich snippet data shows the location property not pointing directly to the olympicpark but to another item which references it.
This can be seen below:
Item
Type: http://schema.org/sportsevent
name = Event Two
location = Item( 2 )
startdate = 2011-08-04T10:00
enddate = 2011-08-04T13:45
Item 2
Type: http://schema.org/place
Ref to item: Item( olympicpark )
What I would like to see is the microdata reporting "location = Item ( olympicpark )" for each sports event item. I can get this if i change the location to the following
<span itemprop="location" content="venue" itemscope itemtype="http://schema.org/Place" itemref="olympicpark">
If I do this however, then the start date and end date are not used, which I can understand because the span tag does not get closed.
I am going round in circles trying to resolve this, would really appreciate some help if possible. Apologies if this seems confusing, im finding it hard to describe the problem.
Mike
Upvotes: 2
Views: 3804
Reputation: 2605
My only concern is that the rich snippet data shows the location property not pointing directly to the olympicpark but to another item which references it.
Its fully correct, you must not be confused about it: you create with itemprop="location" itemscope itemtype="http://schema.org/Place"
an embedded/nested item with own properties, which are correctly shown as properties of item2
Upvotes: 0
Reputation: 1368
You should probably specify the itemscope and itemtype in your olympicpark div, and use itemid instead of id. Check this: How do I relate items in schema.org?
Upvotes: 1
Reputation: 8154
I don't see anything wrong with your original implementation. From what I've read and experienced on my own sites, doing it the way you are is correct to avoid explicitly creating multiple locations nested within each event.
The reason the google rich snippet tool is showing you that is because it needs to convey what type the location is. If it just did location = Item ( olympicpark )
like you desire, you'd be left wondering what type did it recognize Item ( olympicpark)
as.
Upvotes: 1