W3C home > Mailing lists > Public > public-vocabs@w3.org > January 2014

Multi-typed Entities in schema.org; was: Re: makesOffer should accept Service

From: Martin Hepp <martin.hepp@ebusiness-unibw.org>
Date: Wed, 8 Jan 2014 08:01:13 +0100
Cc: Thad Guidry <thadguidry@gmail.com>, Karen Coyle <kcoyle@kcoyle.net>, Public Vocabs <public-vocabs@w3.org>
Message-Id: <F5516995-2DB0-49ED-9EAB-BB1DCBB25DD0@ebusiness-unibw.org>
To: Jarno van Driel <jarno@quantumspork.nl>
Dear Jarno, Karen, all:

I think I did not say this explicit: From a conceptual level, I strongly recommend to use a "multi-type" approach that combines two or more schema.org types for such cases. Unfortunately, the current support at the search engine level for multi-typed entities is not flawless.

What this means is that:

1. The given examples and direction are generally correct.
2. They may not work immediately in current client projects.
3. Google and the other sponsors of schema.org should make fixing support for multi-typed entities in Microdata, RDFa, and JSON-LD a priority, both in validators and operational systems.
4. We should rather wait for #3 instead of blowing up schema.org with conceptual elements for a tentative fix. After all, the cost of deprecating or changing elements in schema.org is high in terms of confusion.

Martin


On Jan 8, 2014, at 12:36 AM, Jarno van Driel wrote:

> 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">&euro;<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">&euro;<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
> Thad on LinkedIn
> 

--------------------------------------------------------
martin hepp
e-business & web science research group
universitaet der bundeswehr muenchen

e-mail:  hepp@ebusiness-unibw.org
phone:   +49-(0)89-6004-4217
fax:     +49-(0)89-6004-4620
www:     http://www.unibw.de/ebusiness/ (group)
         http://www.heppnetz.de/ (personal)
skype:   mfhepp 
twitter: mfhepp

Check out GoodRelations for E-Commerce on the Web of Linked Data!
=================================================================
* Project Main Page: http://purl.org/goodrelations/
Received on Wednesday, 8 January 2014 07:01:39 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:29:36 UTC