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.)
Related
On Google Search Console, I'm getting the error missing best and worst rating. But when I tested the link on testing tool, I am getting:
Failed to normalize the rating value.
Your rating value was out of the default range, you must provide best and worst values.
The code is given below:
<h3>Reviews</h3>
<div class="average-rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<p class="rating-title">Average Rating</p>
<div class="rating-box">
<div class="average-value" itemprop="ratingValue">0/5</div>
<div class="review-amount" itemprop="ratingCount">0 rating</div>
</div>
When I change in rating value to
<div class="average-value" itemprop="ratingValue">0/5</div>
or to this
<div class="average-value" itemprop="ratingValue">0/-454545</div>
it gives a warning:
0 rating (The value provided for ratingCount must be an integer.)
How can I solve this?
The min/max attributes are plain HTML attributes, they don’t affect the Microdata (and they can, by the way, not be used on div elements).
In Schema.org, the worst/best rating can be specified with worstRating and bestRating. If you don’t provide these properties, "0" and "5" are assumed.
If you fix the other errors (ratingCount would have to be "0", not "0 rating"; and it might be better to use "0" instead of "0/5" as ratingValue), you could omit worstRating/bestRating. But it’s typically better to be explicit, so you could add:
<meta itemprop="worstRating" content="0" />
<meta itemprop="bestRating" content="5" />
or:
<meta itemprop="worstRating" content="0" />
<span itemprop="ratingValue">0</span>/<span itemprop="bestRating">5</span>
Example is from http://schema.org/ImageObject
<div itemprop="exifData" itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="Exposure Time">
<meta itemprop="value" content="1/659 sec.">
</div>
<div itemprop="exifData" itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="FNumber">
<meta itemprop="value" content="f/4.0">
</div>
<div itemprop="exifData" itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="MaxApertureValue">
<meta itemprop="value" content="2.00">
</div>
<div itemprop="exifData" itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="Metering Mode">
<meta itemprop="value" content="Pattern">
</div>
<div itemprop="exifData" itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="Flash">
<meta itemprop="value" content="Flash did not fire.">
</div>
These itemprop names and values are completely custom, right? My question is, is there a naming convention? Because MaxApertureValue in example is written as one word and in CamelCase, while Metering Mode is normal. Wouldn't it be better if I just put Aperture?
Yes, it’s up to the author which names (i.e., values for the name property) to use. Of course it makes sense to use standard names, should they exist.
In this example, the author marks up the Exif data exactly like it’s specified in the file:
<!-- We assume the following EXIF meta-data is available, but currently not shown:
Exposure Time: 1/659 sec.
FNumber: f/4.0
MaxApertureValue: 2.00
Metering Mode: Pattern
Flash: Flash did not fire.
-->
I don’t know Exif, but according to its Wikipedia article, the names seem to be written like that (i.e., MaxApertureValue, Metering Mode etc.).
So this is what consumers would likely expect for the exifData property.
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.
Does anyone know what I would set as the value for the "content" attribute if I'm utilizing the Diagnostic and Statistical Manual of Mental Disorders (DSM)?
<span itemprop="code" itemscope itemtype="http://schema.org/MedicalCode">
<meta itemprop="code" content="305.90"/>
<meta itemprop="codingSystem" content="_______"/>
</span>
Might the codingSystem content value be "DSM-IV", "DSM-4", "DSM4" or "DSM-4"?
Schema.org doesn’t restrict how the value for the codingSystem property should be specified (apart from the recommendation that the value should be Text).
You should use the name/abbreviation that is most widely known. Wikipedia lists it as "DSM-IV", so unless you know better, go with this.
I don’t know anything about this domain, but I think codeValue (which expects Text) is more appropriate than code (which expects another MedicalCode item):
<span itemprop="code" itemscope itemtype="http://schema.org/MedicalCode">
<meta itemprop="codeValue" content="305.90" />
<meta itemprop="codingSystem" content="DSM-4" />
</span>
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.