- From: Jarno van Driel <jarno@quantumspork.nl>
- Date: Wed, 8 Jan 2014 00:36:54 +0100
- To: Thad Guidry <thadguidry@gmail.com>
- Cc: Karen Coyle <kcoyle@kcoyle.net>, Martin Hepp <martin.hepp@ebusiness-unibw.org>, Public Vocabs <public-vocabs@w3.org>
- Message-ID: <CAFQgrbYWV2eMUzOshtoUECnt6ACkLJ=G5-7wmRPVZz4nujq5zA@mail.gmail.com>
I'll try not to make a habit of posting lengthy code examples, I promise, but in this case I think it's best to illustrate what I'd like to accomplish with a multi-type item by means of the code I wrote a few days ago. For testing purposes I have marked up the same HTML twice, once with Microdata and once with RDFa Lite. In Google's SDTT both examples return a single-type item where it should be a multi-type. Yet in Yandex's SDTT the RDFA Lite version is flawless yet the Microdata version returns an unknown-type error. Demonstrating Martin's point that multi-type items aren't all that well supported yet. What I find even stranger is that if you write a JSON-LD script with exactly the same data/linkage, most tools out there produce a flawless outcome. And this is the reason why I find it all so confusing and why I'm weary to implement it in sites. I simply don't which output to trust even though I think I've got the mark up right. Anyways, here are the 2 code examples, I hope it adds something to the discussion: <!DOCTYPE html> <html> <head> <title>Multiple types test in Microdata</title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta name="description" content="This HTML-code test the possibility of multiple types combined into one in microdata"> </head> <body> <article itemscope itemtype="http://schema.org/Residence http://schema.org/Product"> <h1 itemprop="offer" itemscope itemtype="http://schema.org/Offer "> <span itemprop="name">For sale</span> for <meta itemprop="priceCurrency" content="EUR">€<span itemprop="price">150.000,-</span> </h1> <h2 itemprop="name"> House with 3 bedrooms, <span itemprop="address" itemscope itemtype=" http://schema.org/PostalAddress"> <span itemprop="streetAddress">StreetName 123</span> <span itemprop="addressLocality">CityName</span> </span> <span itemprop="geo" itemscope itemtype=" http://schema.org/GeoCoordinates"> <meta itemprop="latitude" content="-37.8085041"> <meta itemprop="longitude" content="174.861126"> </span> </h2> <img itemprop="image" src="http://example.org/house-for-sale.jpg" alt="House with 3 bedrooms for sale" width="800" height="600"> <p itemprop="description"> Solid and honest describes this house. <a itemprop="url" href="http://example.org/house-for-sale">Inspect this 3 bedroom home</a> complete with large downstairs rumpus room, workshop and double garage. </p> </article> </body> </html> -- <!DOCTYPE html> <html> <head> <title>Multiple types test in RDFa Lite</title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta name="description" content="This HTML-code test the theory of multiple types combined into one in RDFa Lite"> </head> <body> <article vocab="http://schema.org/" typeof="Residence Product"> <h1 property="offer" typeof="Offer"> <span property="name">For sale</span> for <meta property="priceCurrency" content="EUR">€<span property="price">150.000,-</span> </h1> <h2 property="name"> House with 3 bedrooms, <span property="address" typeof="PostalAddress"> <span property="streetAddress">StreetName 123</span> <span property="addressLocality">CityName</span> </span> <span property="geo" typeof="GeoCoordinates"> <meta property="latitude" content="-37.8085041"> <meta property="longitude" content="174.861126"> </span> </h2> <img property="image" src="http://example.org/house-for-sale.jpg" alt="House with 3 bedrooms for sale" width="800" height="600"> <p property="description"> Solid and honest describes this house. <a property="url" href="http://example.org/house-for-sale">Inspect this 3 bedroom home</a> complete with large downstairs rumpus room, workshop and double garage. </p> </article> </body> </html> On Tue, Jan 7, 2014 at 11:44 PM, Thad Guidry <thadguidry@gmail.com> wrote: > Unfortunately, the Google Structured Data Testing Tool will report an > error to you unless you add additional SPAN or DIV to alleviate the > ambiguity of the itemscope or perhaps the properties themselves. That > might be a bug, but then again, I myself might have a hard time > interpreting which itemscope is actually IN SCOPE within a single <div>. > But, after adding an extra <span> around the "address", I was able to get > nicely extracted data. > > <div itemscope itemtype="http://schema.org/Product" > > > <div > > <span itemprop="name">WHITE HOUSE</span> > <span itemscope itemtype="http://schema.org/Residence"><span > itemprop="address">1600 Pennsylvania Ave NW, Washington</span> > </span> > </div> > > <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> > <span itemprop="price">$110,000,000.00</span> > <link itemprop="availability" href="http://schema.org/InStock" />In > stock > </div> > > </div> > > -- > -Thad > +ThadGuidry <https://www.google.com/+ThadGuidry> > Thad on LinkedIn <http://www.linkedin.com/in/thadguidry/> >
Received on Tuesday, 7 January 2014 23:37:22 UTC