Could anyone tell me what if the EducationEvent has not got startDate and endDate, because it is not known yet? If I set an empty value for it ($startIso is an empty string):
<meta itemprop="startDate" content="{{ $startIso }}" />
I get:
Error: Missing required field "dtstart".` error message in validator.
Here’s the code:
<div itemscope itemtype="http://schema.org/EducationEvent">
<h1 class="columns">
<span itemprop="name">{{ $courseTypesDescription->course_type_name }}</span>
</h1>
<div class="dates columns">
<div class="row">
<div class="large-5 medium-6 columns">
#if ($start != "")
<meta itemprop="startDate" content="{{ $startIso }}" />
#endif
<i class="fa fa-calendar"></i>
<span class="text">Start: </span>
<span class="data"> #if ($start != "") {{ $start }} #else N/A #endif</span>
</div>
<div class="large-5 medium-6 columns end">
#if ($exam != "")
<meta itemprop="endDate" content="{{ $examIso }}" />
#endif
<i class="fa fa-pencil-square-o"></i>
<span class="text">Exam: </span>
<span class="data"> #if ($exam != "") {{ $exam }} #else N/A #endif </span>
</div>
</div>
</div>
<article class="description columns" itemprop="description">
{{ $courseTypesDescription->course_type_desc }}
</article>
</div>
I agree with unor's answer but I would recommend you to use http://schema.org/Event rather than using http://schema.org/EducationEvent because Google is currently showing rich snippets on organic search for only those categories which are their in the Help Center document-
https://support.google.com/webmasters/answer/99170?hl=en
What you are implementing is a sub category of Event schema. You are correct in your way as you must be trying to specify the kind of events you have on your website. But as per my experience Google is not showing snippets for all available sub categories present on schema.org like schema.org/EducationEvent
Schema.org is format(syntax) of rich snippet markup implementation and apart from that schema.org has long list of Structured Data categories and Sub Categories. For all of those categories(http://schema.org/docs/full.html) Google doesn't show snippets. Only those appear with rich snippets on Google which are present in their official help center document as mentioned above.
This will increase the possibility to earn rich snippets for your website.
Your usage of Microdata with the Schema.org vocabulary is correct (if you make sure to remove the properties with empty values). Schema.org doesn’t define any required properties.
It’s just that Google Search, according to their documentation, seems to require the startDate property for displaying the Events Rich Snippet (and also location if it’s a single event, and url if your page lists several events).
If you don’t provide it, and if Google’s docs are correct, you won’t get (the chance for displaying) a Rich Snippet for your event. They probably require a future start date because they don’t like to display Rich Snippets for past events.
That doesn’t mean that you should omit the markup. It can be useful for other consumers (even possibly from Google, unrelated to their Rich Snippets), and Google’s Rich Snippets guidelines might change in the future, allowing for other types of Event snippets.
Related
Based on the Microdata example in http://schema.org/HowTo and extrapolating syntax from the Microdata vs RDFa example in http://schema.org/hasOfferCatalog (there seem to be so few actual examples of RDFa to find?), I put together something like so:
<main vocab="http://schema.org/" typeof="HowTo">
<h1><span property="name">How to do the Hokey Pokey</span></h1>
<ol property="steps">
<li property="itemListElement" typeof="HowToStep">
<img alt="step 1" src="step1.jpg" align="left">
<p property="itemListElement" typeof="HowToDirection">
put your left hand in</p></li>
<li property="itemListElement" typeof="HowToStep">
<img alt="step 2" src="step2.jpg" align="left">
<p property="itemListElement" typeof="HowToDirection">
put your left hand out</p></li>
But, when put into Google's Structured Data Testing Tool, I get:
The property itemListElement is not recognized by Google for an object of type HowTo.
Yandex's validator also says:
WARNING: http://schema.org/itemListElement field not specified in http://schema.org/HowTo
What am I doing wrong?
You missed to specify the HowToSection (or HowToStep) type as value for the steps property.
The Microdata example uses:
<div id="steps" itemprop="steps" itemscope itemtype="http://schema.org/HowToSection">
The equivalent RDFa would be:
<div id="steps" property="steps" typeof="HowToSection">
If you aren’t providing an ItemList/CreativeWork value for the steps property, you are providing a Text value (this is what you are doing in your example markup). But you can’t add properties (like itemListElement) to a Text value.
For on my test i need to verify highlighted text (Lexington, KY) using my protractor test.
<li id="address" class="list">
<div class="content">
<small class="mb-1">
<span>
Suite # 278
<br>
</span>
**Lexington, KY**
</small>
</li>
How to verify highlighted text using css OR cssContainingText locator?
Actually Protractor creators have put great documentation in place , and pls read it thoroughly to gain good knowledge on usage of css & cssContainingText. I will answer your question in short here - Use element(by.cssContainingText('.content','Lexington'))
UPDATE 1:
In case you want to add an assertion .. do this - expect(element(by.cssContainingText('.content','Lexington'))).toContain('Lexington, KY')
For one I am confused because it seems like you are never closing the content div...is it closed after the li is closed?
Anyway...I would simply change the HTML so that you don't need some crazy convoluted mess of a selector. I would do it like this:
<li id="address" class="list">
<div class="content">
<small class="mb-1">
<span>
Suite # 278
<br>
</span>
<cityState>Lexington, KY</cityState>
</small>
</li>
function checkCityState(){
return element(by.tagName('cityState')).getText();
}
expect(checkCityState()).toBe('Lexington, KY');
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.
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.
I'm working on a website about watches. Goal is to display brands, brand's collections, watches, news, reviews, videos, an so on.
I'm asking myself on which kind of schema to use on collections / watches... Watch is a product, but we don't sell watches. We only display informations about watches, their brands, the official descriptions, some reviews, etc...
Is a collection a "DataCatalog" and each watch a dataset ? It is a good idea to want to add itemtype on a collection ? Or only use "Product" type on final watches from collection ?
I think it's difficult to understand the good way to implement schema.org due to the types limitation. And you, What do you think about this kind of problem ?
Thanks in advance for any suggestion
If you want to describe watch as a product using schema.org/Product is a perfect catch. I'll explain.
As you may see from schema.org/Product class structure it doesn't contain any properties for describing selling or buying. It has review, brand and other product specific properties. For describing offer/offers it has special item - well, offers of type schema.org/Offer. This type instead is exactly about selling/buying smth with properties price, acceptedPaymentMethod, etc.
Consider example from schema.org/Product page:
<div itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Kenmore White 17" Microwave</span>
<img src="kenmore-microwave-17in.jpg" alt='Kenmore 17" Microwave' />
<div itemprop="aggregateRating"
itemscope itemtype="http://schema.org/AggregateRating">
Rated <span itemprop="ratingValue">3.5</span>/5
based on <span itemprop="reviewCount">11</span> customer reviews
</div>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span itemprop="price">$55.00</span>
<link itemprop="availability" href="http://schema.org/InStock" />In stock
</div>
Product description:
<span itemprop="description">0.7 cubic feet countertop microwave.
Has six preset cooking categories and convenience features like
Add-A-Minute and Child Lock.</span>
Customer reviews:
<div itemprop="review" itemscope itemtype="http://schema.org/Review">
<span itemprop="name">Not a happy camper</span> -
by <span itemprop="author">Ellie</span>,
<meta itemprop="datePublished" content="2011-04-01">April 1, 2011
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
<meta itemprop="worstRating" content = "1">
<span itemprop="ratingValue">1</span>/
<span itemprop="bestRating">5</span>stars
</div>
<span itemprop="description">The lamp burned out and now I have to replace
it. </span>
</div>
<div itemprop="review" itemscope itemtype="http://schema.org/Review">
<span itemprop="name">Value purchase</span> -
by <span itemprop="author">Lucas</span>,
<meta itemprop="datePublished" content="2011-03-25">March 25, 2011
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
<meta itemprop="worstRating" content = "1"/>
<span itemprop="ratingValue">4</span>/
<span itemprop="bestRating">5</span>stars
</div>
<span itemprop="description">Great microwave for the price. It is small and
fits in my apartment.</span>
</div>
...
</div>
As you can see all product specific properties inserted in Product entity.
For broader research you may check Google markup for products which of course influenced on schema.org way of handling things.
Relating Dataset and DataCatalog types - they are not intended for such use. Instead they provide way for describing, well, some datasets (e.g., dataset of New York weather). For further details about this types you may check:
W3C page about this proposal with examples
Post in schema.org blog which reveals more details about it