Suppose that a place does not offer the all-day-opening. Hence, we have two opening in one day.
How one should define the Microdata with schema.org/OpeningHoursSpecification?
I suppose that one should create two separated instances of schema.org/OpeningHoursSpecification as follows:
Opening hours:
<div itemprop="openingHoursSpecification" itemscope
itemtype="http://schema.org/OpeningHoursSpecification">Mo,
<link itemprop="dayOfWeek"
href="http://purl.org/goodrelations/v1#Monday" />
<meta itemprop="opens" content="08:00:00">8:00 a.m. -
<meta itemprop="closes" content="12:00:00">12:00 a.m.
</div>
<div itemprop="openingHoursSpecification" itemscope
itemtype="http://schema.org/OpeningHoursSpecification">Mo,
<link itemprop="dayOfWeek"
href="http://purl.org/goodrelations/v1#Monday" />
<meta itemprop="opens" content="16:00:00">4:00 a.m. -
<meta itemprop="closes" content="20:00:00">8:00 p.m.
</div>
Am I right?
Yes, you are exactly right!
If you want to understand the pattern, you can also play with the (kind of outdated) GoodRelations Annotator tool at
http://www.ebusiness-unibw.org/tools/goodrelations-annotator/en/
It will generate respective RDFa markup for form-based input.
Note that in schema.org, the naming of elements may differ slightly from the naming in the original namespace, as documented here:
http://wiki.goodrelations-vocabulary.org/Cookbook/Schema.org#Naming_Differences
Best wishes
Martin Hepp
Related
We use schema.org to markup a number of different data types. I have typically relied on the Google testing tool to confirm that my schema is correct, but I've found that I get mixed results when testing with Bing, Yandex, Linter and MOZ.
Currently my 'aggregaterating' schema appears valid in Google's tester, but I get no results on Bing (can't find the markup) and Yandex/Linter both show errors. This makes me wonder if my schema is actually correct.
This was my original version which was OK on Google but got no results (no data found) on any of the other testers.
<div itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
<meta itemprop="itemReviewed" content="https://schema.org/LocalBusiness">
<meta itemprop="ratingValue" content="4.6">
<meta itemprop="reviewCount" content="3,950">
</div>
This is my updated version that now, at least partially, is seen by Linter and Yandex. I still get nothing from MOZ and Bing.
<div itemscope="" itemtype="https://schema.org/Organization">
<meta itemprop="name" content="Company">
<div itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
<meta itemprop="itemReviewed" content="https://schema.org/LocalBusiness">
<meta itemprop="ratingValue" content="4.6">
<meta itemprop="reviewCount" content="3,950">
</div></div>
Any feedback on the format? Something I am missing? Also, has anyone else had the mixed validation issue with other testers? I find that really odd.
I am trying to get something to pass the W3C Validation (this is my first HTML web design class). I keep getting the same error (Text not allowed in element ul in this context.). There are five of these errors, they are all in the same location but on different lines.
If anyone could please look at this and tell me what I have done wrong. Thank You.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Fish Creek Animal Hospital Services</title>
<meta charset="utf-8">
</head>
<body>
<h1>Fish Creek Animal Hospital</h1>
<div><b>Home
Services
Ask the Vet
Contact </b></div>
<ul>
<li><strong>Medical Services</strong></li>
We offer state of the art equipment and technology.
<li><strong>Surgical Services</strong></li>
Full range of surgical procedures including orthopedics and emergency surgeries.
<li><strong>Dental Care</strong></li>
A dental exam can determine whether your pet needs preventative dental care such as scaling and polishing.
<li><strong>House Calls</strong></li>
The elderly, physically challenged, and multiple pet households often find our in-home veterinary service helpful and convenient.
<li><strong>Emergencies</strong></li>
At least one of our doctors is on call every day and night.
</ul>
<div>
<small><i>Copyright © 2013 Fish Creek Animal Hospital
csigman1#gmail.com
</i></small>
</div>
</body>
</html>
Any section that has text, which has not been wrapped in a HTML tag will cause you this error. Here, it's the list. Each item (block of text) within the list requires a <li> tag wrapping the whole content.
<ul>
<li>text content</li> <!-- correct -->
<li></li>text content <!-- incorrect -->
</ul>
So in your script, change all items from this:
<li>
<strong>Surgical Services</strong></li>
Full range of surgical procedures including orthopedics
and emergency surgeries.
To this:
<li>
<strong>Surgical Services</strong>
Full range of surgical procedures including orthopedics
and emergency surgeries.
</li>
Nesting an Offer that has a priceSpecification inside a Product throws up an Incomplete microdata warning in Google Rich Snippets testing tool.
This
<div itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">1984 Vintage Selection Cabernet Sauvignon</h1>
<p itemprop="description">Cabernet Sauvignon.</p>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<p itemprop="priceSpecification" itemscope itemtype="http://schema.org/priceSpecification">Prices start at
<meta itemprop="priceCurrency" content="GBP" />£<span itemprop="price">0.71</span> (per bottle)</p>
<meta itemprop="validThrough" content="2013-09-01" />
</div>
</div>
throws the following warning in google rich snippets testing tool:
Warning: Incomplete microdata with schema.org.
If I move Offer outside Product:
<div itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">1984 Vintage Selection Cabernet Sauvignon</h1>
<p itemprop="description">Cabernet Sauvignon.</p>
</div>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<p itemprop="priceSpecification" itemscope itemtype="http://schema.org/priceSpecification">Prices start at
<meta itemprop="priceCurrency" content="GBP" />£<span itemprop="price">0.71</span> (per bottle)</p>
<meta itemprop="validThrough" content="2013-09-01" />
</div>
then the warning is no longer thrown up, but this doesn't appear to make sense, as the Offer is not linked to the Product it's applicable to.
All the examples at schema.org nest Offer within Product, however, none of them use priceSpecification. I could only find one blog post where Offer is not nested within Product: http://seolobster.de/richsnippets-schema-org-products-update. This does not fill me with confidence to use in a live environment.
Which is correct? Especially if you throw in more than one Offer?
I have the same problem and I just figured it out though painstaking trial-and-error: The problem is that, even though price is part of the priceSpecification schema, it still needs to be defined outside the priceSpecification metatag in the regular offer, too!
I needed priceSpecification because we show prices including and excluding VAT, and now I have no frickin' idea on how to implement this! If I HAVE to define the price in offer, how do I tell it it's with or without VAT? valueAddedTaxIncluded is not part of the offer schema! An empty div just including valueAddedTaxIncluded=true? Okay, so how do I implement the other price without the VAT then? That would define the price twice in the offer, and that's not possible!
Also, why is schema.org and getschema.org so damn effing useless when it comes to samplecode and how to properly implement any given schema? If you want people to adopt some fancy new technology - TELL THEM HOW TO DO IT!!
Based on your example I don't think you need to use a separate priceSpecification property. Instead you can directly add the price and priceCurrency property to the Offer like the example below.
<div itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">1984 Vintage Selection Cabernet Sauvignon</h1>
<p itemprop="description">Cabernet Sauvignon.</p>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
Prices start at <meta itemprop="priceCurrency" content="GBP" />£
<span itemprop="price">0.71</span> (per bottle)
</div>
</div>
As stated before, the offer also needs the price-tag. One solution that the tag-tester allows is adding the data as a meta-tag like this:
<meta itemprop="price" content="79" />
I'm not sure if google will parse and show this however.
I am using html5reset as a reset and template for a website. However I am getting all kinds of validation errors on some meta tags:
<meta name="title" >
<meta name="google-site-verification" >
<meta name="copyright" >
<meta name="DC.title" >
<meta name="DC.subject" >
<meta name="DC.creator" >
I could simply remove those meta tags, but I'd rather know why first. Here is the link to validate my website (which is online at a temporary url): http://validator.w3.org/check?uri=http%3A%2F%2Ftanchelmus.be%2Fsten%2Fnl%2Fnews&charset=%28detect+automatically%29&doctype=Inline&group=0
If you use "property" instead of "name" you will pass HTML5 validator.
<meta property="DC.title" >
<meta property="DC.subject" >
<meta property="DC.creator" >
I'm not entirely sure if the syntax is correct, but I did see this in RDFa documentation here: http://en.wikipedia.org/wiki/RDFa
Another thing to note is that the HTML5 standard is a work in progress. And thus the W3C HTML5 validator is also a work in progress.
This blog post has some interesting background regarding Microformats (eg Dublin Core) & HTML5.
It may not always be pragmatic to develop just to please the Validator, especially one that is a work in progress.
What it looks like you're being told is that the values you're using in the name attribute are not part of the valid set of values you can use.
Ths WhatWG Website identifies many of the standard and other meta name values.
Hello to validate the Dublin Core tags, you must change dc. to dcterms.
Here you can see an example:
<meta name="dcterms.contributor" content="Your name" />
<meta name="dcterms.keywords" content="Your keywords here" />
Regards!
I've got a site coded in XHTML 1.0 Strict. I want to use the new Microdata to add breadcrumbs to my site (so Google will understand them).
My old non-microdata marked-up breadcrumbs look like this:
<ul>
<li>Level 1</li>
<li>Level 2</li>
<li>Level 3</li>
</ul>
According to Google, to markup breadcrumbs using Microdata, you extend the above code like this:
<ul>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="..." itemprop="url">
<span itemprop="title">Level 1</span>
</a>
</li>
...
</ul>
But this is not valid XHTML 1.0 Strict.
What should I do?
Should I ignore the validation conflicts?
Should I write itemscope="itemscope" instead of just itemscope (this would be valid XML, but still not valid XHTML)?
Should I change the Doctype to be HTML5 instead of XHTML 1.0 Strict?
I want this to work all the way back to IE6!
Please advice :)
Yes, if you wanted to use itemscope in XHTML, you would need to write itemscope="itemscope" and use XHTML5 (same DOCTYPE as HTML5, but XML syntax).
itemscope is not included in W3 HTML5, but present in WHATWG's version, so validation may continue to be a difficulty. There seems to be quite some political argument on this issue, which I haven't been following as it looks fairly tedious.
For the moment, if you want to use breadcrumb annotations in a finalised, validatable document format, you could use RDFa instead: the alternative (but older) proposal, which the argument is all about, and use the existing doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
Since the major search engines have decided on schema.org last June (2011) as the way to do rich snippets, this question has become much more important seeing XHTML5 does not yet have a working DTD (BTW, http://www.html5dtd.org/ is working on a XHTML5 DTD and may well be ready when you read this, if so disregard what I'm about to say). And what I am about to say summarises a page I placed at http://www.nedprod.com/programs/portable/XHTMLwithHTML5microdata/ a few weeks ago, and there has more detail including a rich snippets demo if you want it.
I had need of extending XHTML 1.x Strict with schema.org/HTML5 microdata and getting it all to validate properly for updating nedprod, and Microsoft Expression Web has the occasional tendency to eat bits of HTML it edits, so validation is handy for catching when it borks. Hence I have created these DTDs which extend the standard XHTML 1.0 ones:
http://www.nedprod.com/xhtml1-strict-with-html5-microdata.dtd
http://www.nedprod.com/xhtml1-transitional-with-html5-microdata.dtd
To use, take a copy of your desired DTD (don't use the original from nedprod, I can't afford the bandwidth) and use as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict with HTML5 microdata//EN" "xhtml1-strict-with-html5-microdata.dtd">
or ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional with HTML5 microdata//EN" "xhtml1-transitional-with-html5-microdata.dtd">
... or more likely, override the DTD used for validation by your particular XML validating setup.
BTW, here's something interesting, and I only include this as it's useful to know when answering the question. I honest to God thought that using the above doctypes would invoke quirks mode when rendering. Turns out, much to my great surprise, that IE8, Chrome 14, Firefox 5 and Opera 11.50 all render such a doctype in Standards mode. Who would have thought! So you could, if you wanted to, upload your XHTML pages onto the public internet with the custom doctype and the newer browsers at least would do the right thing.
Hope this helps someone,
Niall
Valid HTML 5 example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example page</title>
</head>
<body>
<div itemscope="" itemtype="http://schema.org/MediaObject">
<div itemprop="video" itemscope="" itemtype="http://schema.org/VideoObject">
<meta itemprop="name" content="Breast Augmentation Video Diary">
<meta itemprop="duration" content="PT12M54S">
<meta itemprop="thumbnailUrl" content="http://www.plastic-surgery-estonia.com/new-assets/images/thumbnails/breast-augmentation.jpg">
<meta itemprop="contentURL" content="http://www.youtube.com/watch?v=BwPN6eCpxTk">
<meta itemprop="embedURL" content="http://www.youtube.com/watch?feature=player_embedded&v=BwPN6eCpxTk">
<meta itemprop="uploadDate" content="2010-11-09">
<iframe src="http://www.youtube.com/embed/BwPN6eCpxTk?rel=0&autohide=1&modestbranding=1&showinfo=0"></iframe>
<span itemprop="description">Video Diary</span>
</div>
</div>
</body>
</html>
Found these links helpful:
- http://support.google.com/webmasters/bin/answer.py?hl=en&answer=2413309&topic=1088474&ctx=topic
- http://www.reelseo.com/embedded-youtube-indexed-google/
Use the application/ld+json MIME type and a microdata generator to transform the markup into data:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>microdata.xhtml</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
</head>
<body>
<div>
<script type="application/ld+json">
{"items": [{
"type": ["https://schema.org/breadcrumb"],
"properties":{
"url": ["..."],
"title": ["Level 1"]
}
}]
}
</script>
</div>
</body>
</html>
or a data:uri in an object tag:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>microdata.xhtml</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
</head>
<body>
<div>
<object data="data:text/html;charset=utf-8;base64,PHVsPiA8bGkgaXRlbXNjb3BlIGl0ZW10eXBlPSJodHRwOi8vZGF0YS12b2NhYnVsYXJ5Lm9yZy9CcmVhZGNydW1iIj4gICAgICAgICA8YSBocmVmPSIuLi4iIGl0ZW1wcm9wPSJ1cmwiPiAgICAgICAgICAgPHNwYW4gaXRlbXByb3A9InRpdGxlIj5MZXZlbCAxPC9zcGFuPiAgICAgICAgIDwvYT4gICAgICAgICA8L2xpPiAgICAgICA8L3VsPg==">
<?microdata
<ul>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="..." itemprop="url">
<span itemprop="title">Level 1</span>
</a>
</li>
</ul>
?>
</object>
<!--[if lt IE 8]>
<object data="mhtml://#foo">
<?microdata
<ul>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="..." itemprop="url">
<span itemprop="title">Level 1</span>
</a>
</li>
</ul>
?>
<div id="foo">
PHVsPiA8bGkgaXRlbXNjb3BlIGl0ZW10eXBlPSJodHRwOi8vZGF0YS12b2NhYnVsYXJ5Lm9yZy9CcmVhZGNydW1iIj4gICAgICAgICA8YSBocmVmPSIuLi4iIGl0ZW1wcm9wPSJ1cmwiPiAgICAgICAgICAgPHNwYW4gaXRlbXByb3A9InRpdGxlIj5MZXZlbCAxPC9zcGFuPiAgICAgICAgIDwvYT4gICAgICAgICA8L2xpPiAgICAgICA8L3VsPg==
</div>
</object>
<![endif]-->
</div>
</body>
</html>
I want this to work all the way back to IE6!
Use the application/xhtml+xml XSLT shim to support IE6 and extend it to get a copy of the markup.
References
MDN: Base64 Encoding and Decoding
Images in a Web Page
MIME E-mail Encapsulation of Aggregate Documents, such as HTML (MHTML)
Mapping Microdata to RDF
data:URI Tests
Examining, implementing and testing of RFC2557 (MHTML)
MHTML URIs
HTML5: Differences from HTML4
try and validate some of google's pages...they don't validate.
validation is a tool, an awesome one, but nothing more, although i do applaud your determination. if you're that worried about validation i would switch to HTML5 .