Is there any way I can combine the <meta /> and <time /> together? Are they both necessary?
<div itemscope itemtype="http://schema.org/Event">
<a itemprop="url" href="nba-miami-philidelphia-game3.html" itemprop="name">
Miami Heat at Philadelphia 76ers
</a>
<meta itemprop="startDate" content="2016-04-21T20:00">
<time datetime="2016-04-21T20:00"></time>
Thu, 04/21/16
8:00 p.m.
</div>
Why wouldn't you do:
<time itemprop="startDate" datetime="2016-04-21T20:00">
Thu, 04/21/16
8:00 p.m.</time>
Have a look at the date examples in the basic syntax section of the spec.
If you wanted to meet both HTML5 and Schema.org/RDFA Lite, you can do this:
<time itemprop="startDate" datetime="2016-04-21T20:00" content="2016-04-21T20:00">Thu, 04/21/16 8:00 p.m.</time>
Parsing of ISO Dates is way easier than dealing with the text representation
Related
I'm working with products that have pricing structures based on bulk-buy offers. For example, the pricing for a product may be as follows:
Buy 10-19 and the value of 1 is $3
Buy 20-29 and the value of 1 is $2
Buy 30-39 and the value of 1 is $1
Buy 40 or more and the value of 1 is $0.50
Minimum quantity available to purchase is 10.
How can I mark this up properly in structured data (Microdata format)?
Currently I have:
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="priceCurrency" content="USD"/>
<meta itemprop="price" content="3" />
<span itemprop="eligibleQuantity" itemscope itemtype="http://schema.org/QuantitativeValue">
<meta itemprop="minValue" content="10" />
<meta itemprop="maxValue" content="19" />
<meta itemprop="value" content="Number" />
</span>
</span>
For each variant. Then I have:
<span itemprop="priceSpecification">
<span itemprop="eligibleQuantity" itemscope itemtype="http://schema.org/QuantitativeValue">
<meta itemprop="minValue" content="10" />
</span>
</span>
On the product block itself, to indicate the minimum quantity of 10.
I'm really not at all confident this is the right structure and tags to use. Could anybody lend some insight?
You are missing the actual PriceSpecification items (as values for the priceSpecification property). UnitPriceSpecification seems to be the appropriate sub-type in your case.
So the structure could look like this:
<div itemscope itemtype="http://schema.org/Offer">
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification"></div>
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification"></div>
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification"></div>
</div>
Personally I would provide a UnitPriceSpecification for the first level (10-19), too, instead of providing its properties directly under Offer:
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification">
<p itemprop="eligibleQuantity" itemscope itemtype="http://schema.org/QuantitativeValue">
<span itemprop="minValue">10</span>-<span itemprop="maxValue">19</span>
</p>
<p>$<span itemprop="price">3</span> <meta itemprop="priceCurrency" content="USD"/></p>
</div>
But I don’t know if there aren’t some consumers out there that might expect it directly under Offer.
Is it possible to set an opening time which goes, for example, from 22:00 to 03:00?
It’s not defined in the description of Schema.org’s openingHours. If it’s not working with openingHours, does it work with the properties opens/closes from OpeningHoursSpecification?
For example like this:
<div itemprop="openingHoursSpecification" itemscope
itemtype="http://schema.org/OpeningHoursSpecification">Mo,
<link itemprop="dayOfWeek"
href="http://purl.org/goodrelations/v1#Monday" />
<meta itemprop="opens" content="22:00:00">22:00 -
<meta itemprop="closes" content="03:00:00">03:00
</div>
I don’t have any experience with this, but I would have assumed that using opens and closes like that should be fine, as their descriptions say
The opening hour of the place or service on the given day(s) of the week.
The closing hour of the place or service on the given day(s) of the week.
and on "the given day(s) of the week", the opening hour is 22:00, and the closing hour is 03:00, no matter if that’s the closing hour of the previous opening or not.
However, Martin Hepp explained in an email how OpeningHoursSpecification from his GoodRelations vocabulary should be used, and as Schema.org’s class is derived from this, it might be relevant:
I.e., opening hours that cross midnight must be broken into two chunks, one opening hour specification for the first day, then closing at 23:59:59, and one for the next day of the week, opening ant 00:00:00.
So according to this, you would have to use something (ugly) like this:
<div itemprop="openingHoursSpecification" itemscope itemtype="http://schema.org/OpeningHoursSpecification">
<link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Monday" />
<meta itemprop="opens" content="22:00:00">
<meta itemprop="closes" content="23:59:59">
</div>
<div itemprop="openingHoursSpecification" itemscope itemtype="http://schema.org/OpeningHoursSpecification">
<link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Tuesday" />
<meta itemprop="opens" content="00:00:00">
<meta itemprop="closes" content="03:00:00">
</div>
<div itemprop="openingHoursSpecification" itemscope itemtype="http://schema.org/OpeningHoursSpecification">
<link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Tuesday" />
<meta itemprop="opens" content="22:00:00">
<meta itemprop="closes" content="23:59:59">
</div>
(Instead of repeating it for each day, you could specify it in two OpeningHoursSpecification with multiple dayOfWeek, unless the times are different, of course.)
This event is a local farm market where the client will be making weekly appearances at a venue which shifts bi-annually. Because the recurrence of the event is irregular (some weeks the start time may be different and the number of days between events varies between 7 and 5), there is plenty of justification to list them individually. However, a human reader will not like the aesthetics of 20+ listings all having the same description.
You don’t have to duplicate the description, you can use the itemref attribute:
<p itemprop="description" id="farm-market">…<!-- description for all events --></p>
<div itemscope itemtype="http://schema.org/Event" itemref="farm-market">
<time itemprop="startDate">2015-01-20</time>
</div>
<div itemscope itemtype="http://schema.org/Event" itemref="farm-market">
<time itemprop="startDate">2015-02-04</time>
</div>
If you don’t want to show any content from the single events (i.e., not even the date), then yes, you should use meta elements in Microdata:
<p itemprop="description" id="farm-market">…<!-- description for all events --></p>
<div itemscope itemtype="http://schema.org/Event" itemref="farm-market">
<meta itemprop="startDate" content="2015-01-20">
</div>
<div itemscope itemtype="http://schema.org/Event" itemref="farm-market">
<meta itemprop="startDate" content="2015-02-04">
</div>
There’s nothing wrong about using meta.
It’s what gets used in some examples from the Microdata (W3C Working Group Note) specification, and for this purpose Microdata defines that it’s valid to use meta elements in the body.
Tried to Google out but came empty handed. I'm looking for a snippet containing example markup.
How should I mark all-day events?
How should I mark concerts having multiple performances with varying locations (for same data multiple start and end dates) aka. subEvents? This is what I tried:
<section itemscope itemtype="http://data-vocabulary.org/Event"><!-- section per event -->
<a href="/test#event_17" id="event_17" itemprop="url">
<h3><!-- visual title when and where -->
<div itemprop="summary"><!-- summary what the event is for -->
Summary text
</div>
</h3>
</a>
<span itemprop="location" class="location">
Location name
</span>
<span itemprop="subEvent" itemscope itemtype="http://data-vocabulary.org/Event">
<a href="/test#event_17_1" id="event_17_1" itemprop="url">
<time itemprop="startDate" datetime="2014-09-15T15:00:00+03:00">00:00</time>
—
<time itemprop="endDate" datetime="2014-09-15T17:00:00+03:00">00:00</time>
</a>
</span>
<span itemprop="subEvent" itemscope itemtype="http://data-vocabulary.org/Event">
<a href="/test#event_17_2" id="event_17_2" itemprop="url">
<time itemprop="startDate" datetime="2014-10-10T20:00:00+03:00">00:00</time>
—
<time itemprop="endDate" datetime="2014-10-10T22:00:00+03:00">00:00</time>
</a>
</span>
<div itemprop="description"><!-- details of the event -->
Description
</div>
</section>
Based solely on http://www.google.com/webmasters/tools/richsnippets
How should I mark all-day events?
For all day events it seems that the appropriate way is to give only datetime value. End date is not required.
2015/02/17
How should I mark concerts having multiple performances with varying locations (for same data multiple start and end dates) aka. subEvents?
Notice itemref to concert name.
<h1 itemscope=""><span id="concertName" itemprop="name">Foo</h1>
<p>
<span itemscope="" itemtype="http://schema.org/MusicEvent" itemref="concertName">
<strong>Wed 3.12.2014</strong> 10:05
<span itemprop="location" itemscope="" itemtype="http://schema.org/Place">
<span itemprop="name">Concert Hall</span>
</span>
<meta itemprop="startDate" content="2014-12-03T10:05:00+02:00" />
<meta itemprop="url" content="http://www.example.com/concert/8" />
</span>
<span itemscope="" itemtype="http://schema.org/MusicEvent" itemref="concertName">
<strong>Fri 26.12.2014</strong> 10:05
<span itemprop="location" itemscope="" itemtype="http://schema.org/Place">
<span itemprop="name">Concert Hall</span>
</span>
<meta itemprop="startDate" content="2014-12-26T10:05:00+02:00" />
<meta itemprop="url" content="http://www.example.com/concert/8" />
</span>
</p>
I'm struggling to correctly add microdata to events on my page. The Google Structured Data Testing tool can read the data but it isn't displaying it correctly. I'm getting confused.
I am trying to tag it for a sports league that has a single event on one night that consists of three games all taking place at the same location.
<div itemscope itemtype="http://schema.org/SportsEvent"><!--microdata week 1 event-->
<meta itemprop="name" content="Week 1 Lacrosse Games">
<meta itemprop="location" content="Street, Town, NY">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3"> <!--column-->
<h3>Week 1<br><span itemprop="startDate" content="2014-06-27T18:00">Friday, June 27</span></h3>
<br>
<div itemprop="subEvent" itemscope itemtype="http://schema.org/subEvent">
<h4><span itemprop="name">Game 1</span> - 6:00 PM</h4>
<p><span itemprop="performer">Team 1 vs.Team 2</span></p>
</div>
<div itemprop="subEvent" itemscope itemtype="http://schema.org/subEvent">
<h4><span itemprop="name">Game 2</span> - 7:00 PM</h4>
<p><span itemprop="performer">Team 3 vs. Team 4</span></p>
</div>
<div itemprop="subEvent" itemscope itemtype="http://schema.org/subEvent">
<h4><span itemprop="name">Game 3</span> - 8:00 PM</h4>
<p><span itemprop="performer">Team 5 vs. Team 6</span></p>
</div>
</div><!--end column-->
</div><!--microdata week 1 event-->
I'm not sure what sort of problems you're having with the rich snippets displaying, but I did notice a couple of things that I'd recommend you change. Since all of these events are sporting events, I would probably recommend that you use the SportsEvent type for them all. You also need to specify all of the start times in ISO 8601 format. Additionally, the expected value of the "performer" property is either an Organization or Person, and SportsTeam is an extension of the Organizaton type. So I would recommend using that property twice within each event so that you could specify the two different teams that are playing, along with the SportsTeam type, like this:
<div itemprop="subEvent" itemscope itemtype="http://schema.org/SportsEvent">
<h4><span itemprop="name">Game 1</span> - <meta itemprop="startDate" content="2014-06-27T18:00" />6:00 PM</h4>
<p><span itemprop="performer" itemscope itemtype="http://schema.org/SportsTeam">
<span itemprop="name">Team 1</span></span> vs</p>
<p><span itemprop="performer" itemscope itemtype="http://schema.org/SportsTeam">
<span itemprop="name">Team 2</span></span></p>
</div>
I hope that helps.
Because I was using subevents, Google required that I have the microdata URL called out for each event. They have a rule that says if you have multiple events on the same page, you need to have a URL for each one.
Since I used the same page for all of them, I gave each subevent a unique ID and I linked that ID in the address.