WebSchemas/MultipleTypesSDO

From W3C Wiki
Jump to: navigation, search

Multi-Type Entities (MTEs) and their properties via schema.org

Case

Types & properties as defined in this document

  • schema.org/Product and schema.org/Service have been combined to form one entity so to provide access to the properties of both types.
  • External enumerations, global & fragment identifiers and an extra ontology (productontology.org) have been added to provide more specific data about certain entities.

Issues

  • Markup validators by schema.org's sponsors Yandex & Google do not seem to support Multi Type Entities as their reports show markup errors.
  • Support for Global Identifiers is inconsistent.
  • Google's Webmaster Tools seems to pick up MTEs but reports about each type used separately, meaning an MTE consisting out of 2 types will generate 2 'data type' entries, which should be in fact a single 'MTE'.


Examples

A business making an offer for Repair Services in an area, as a business function

  1. <div itemscope itemtype="http://schema.org/LocalBusiness">
  2.     <h1>
  3.         <a itemprop="url" href="http://example.com/johns-quick-repair">
  4.             <span itemprop="name">John's Quik Repair</span>
  5.         </a>
  6.     </h1>
  7.     <img itemprop="logo" src="http://example.com/johns-quik-repair-logo.jpg" alt="John's Quik Repair logo" title width="60" height="60" />
  8.     <div itemprop="makesOffer" itemscope itemtype="http://schema.org/Offer">
  9.         <div itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
  10.             <link itemprop="url" href="http://purl.org/goodrelations/v1#Repair" />
  11.         </div>
  12.         <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Product http://schema.org/Service">
  13.             <p>
  14.                 <img itemprop="image" src="http://example.com/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
  15.                 <span itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
  16.                     <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
  17.                         <span itemprop="addressLocality">Dallas</span> - <span itemprop="addressLocality">Fort Worth</span>, 
  18.                         <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
  19.                     </span>
  20.                 </span><br />
  21.                 Service Type: <span itemprop="name serviceType">Drywall Repair</span>
  22.             </p>
  23.             <p itemprop="description">
  24.                 Placerat magnis vut tempor? Nisi auctor sit massa, etiam nunc sed augue aenean in, 
  25.                 eu diam, elit est, dis placerat, arcu augue nascetur, facilisis, sit in.
  26.             </p>
  27.         </div> 
  28.     </div>
  29. </div>


An offer for Repair Services in an area, as a business function, including a seller

  1. <div itemscope itemtype="http://schema.org/Offer">
  2.     <div itemprop="seller" itemscope itemtype="http://schema.org/LocalBusiness">
  3.         <h1>
  4.             <a itemprop="url" href="http://example.com/johns-quick-repair">
  5.                 <span itemprop="name">John's Quik Repair</span>
  6.             </a>
  7.         </h1>
  8.         <img itemprop="logo" src="http://example.com/johns-quik-repair-logo.jpg" alt="John's Quik Repair logo" title width="60" height="60" />
  9.     </div>
  10.     <div itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
  11.         <link itemprop="url" href="http://purl.org/goodrelations/v1#Repair" />
  12.     </div>
  13.     <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Product http://schema.org/Service">
  14.         <p>
  15.             <img itemprop="image" src="http://example.com/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
  16.             <span itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
  17.             <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
  18.                 <span itemprop="addressLocality">Dallas</span> - <span itemprop="addressLocality">Fort Worth</span>, 
  19.                 <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
  20.             </span>
  21.             </span><br />
  22.             Service Type: <span itemprop="name serviceType">Drywall Repair</span>
  23.         </p>
  24.         <p itemprop="description">
  25.             Placerat magnis vut tempor? Nisi auctor sit massa, etiam nunc sed augue aenean in, 
  26.             eu diam, elit est, dis placerat, arcu augue nascetur, facilisis, sit in.
  27.         </p>
  28.     </div>
  29. </div>


Repair Services as a business function in an area, including a provider, being offered

  1. <div itemscope itemtype="http://schema.org/Product http://schema.org/Service">
  2.     <div itemprop="provider" itemscope itemtype="http://schema.org/LocalBusiness">		
  3.         <h1>
  4.             <a itemprop="url" href="http://example.org/johns-quick-repair">
  5.                 <span itemprop="name">John's Quik Repair</span>
  6.             </a>
  7.         </h1>
  8.         <img itemprop="logo" src="http://example.org/johns-quik-repair-logo.jpg" alt="John's Quik Repair logo" title width="60" height="60" />
  9.     </div>
  10.     <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  11.         <span itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
  12.             <link itemprop="url" href="http://purl.org/goodrelations/v1#Repair" />
  13.         </span>
  14.     </div>
  15.     <p>
  16.         <img itemprop="image" src="http://example.org/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
  17.         <span itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
  18.             <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
  19.                 <span itemprop="addressLocality">Dallas</span> - <span itemprop="addressLocality">Fort Worth</span>, 
  20.                 <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
  21.             </span>
  22.         </span><br />
  23.         Service Type: <span itemprop="name serviceType">Drywall Repair</span>
  24.     </p>
  25.     <p itemprop="description">
  26.         Placerat magnis vut tempor? Nisi auctor sit massa, etiam nunc sed augue aenean in, 
  27.         eu diam, elit est, dis placerat, arcu augue nascetur, facilisis, sit in.
  28.     </p>
  29. </div>


All in one Linked Data solution

In microdata (by using @itemid)

  1. <div itemid="#LocalBusiness" itemscope itemtype="http://schema.org/LocalBusiness">
  2.     <h1>
  3.         <a itemprop="url" href="http://example.org/johns-quick-repair">
  4.             <span itemprop="name">John's Quik Repair</span>
  5.         </a>
  6.     </h1>
  7.     <img itemprop="logo" src="http://example.com/johns-quik-repair-logo.jpg" alt="John's Quik Repair logo" title width="60" height="60" />
  8.     <div itemid="#Offer" itemprop="makesOffer" itemscope itemtype="http://schema.org/Offer">
  9.         <link itemprop="seller" href="#LocalBusiness" />
  10.         <div itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
  11.             <link itemprop="url" href="http://purl.org/goodrelations/v1#Repair" />
  12.         </div>
  13.         <div itemid="#ProductService" itemprop="itemOffered" itemscope itemtype="http://schema.org/Product http://schema.org/Service">
  14.             <link itemprop="provider" href="#LocalBusiness" />
  15.             <p>
  16.                 <img itemprop="image" src="http://example.com/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
  17.                 <span itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
  18.                     <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
  19.                         <span itemprop="addressLocality">Dallas</span> - <span itemprop="addressLocality">Fort Worth</span>, 
  20.                         <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
  21.                     </span>
  22.                 </span><br />
  23.                 Service Type: <span itemprop="name serviceType">Drywall Repair</span>
  24.             </p>
  25.             <p itemprop="description">
  26.                 Placerat magnis vut tempor? Nisi auctor sit massa, etiam nunc sed augue aenean in, 
  27.                 eu diam, elit est, dis placerat, arcu augue nascetur, facilisis, sit in.
  28.             </p>
  29.         </div> 
  30.     </div>
  31. </div>


In RDFa (by using @resource)

  1. <div vocab="http://schema.org/" resource="#LocalBusiness" typeof="LocalBusiness">
  2.     <h1>
  3.         <a property="url" href="http://example.com/johns-quick-repair">
  4.             <span property="name">John's Quik Repair</span>
  5.         </a>
  6.     </h1>
  7.     <img property="logo" src="http://example.com/johns-quik-repair-logo.jpg" alt="John's Quik Repair logo" title width="60" height="60" />
  8.     <div resource="#Offer" property="makesOffer" typeof="Offer">
  9.         <link property="seller" href="#LocalBusiness" />
  10.         <div property="businessFunction" typeof="BusinessFunction">
  11.             <link property="url" href="http://purl.org/goodrelations/v1#Repair" />
  12.         </div>
  13.         <div resource="#ProductService" property="itemOffered" typeof="Product Service">
  14.             <link property="provider" href="#LocalBusiness" />
  15.             <p>
  16.                 <img property="image" src="http://example.com/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
  17.                 <span property="serviceArea" typeof="AdministrativeArea">
  18.                     <span property="address" typeof="PostalAddress">
  19.                         <span property="addressLocality">Dallas</span> - <span property="addressLocality">Fort Worth</span>, 
  20.                         <span property="addressRegion">Texas</span>, <span property="addressCountry">USA</span>
  21.                     </span>
  22.                 </span><br />
  23.                 Service Type: <span property="name serviceType">Drywall Repair</span>
  24.             </p>
  25.             <p property="description">
  26.                 Placerat magnis vut tempor? Nisi auctor sit massa, etiam nunc sed augue aenean in, 
  27.                 eu diam, elit est, dis placerat, arcu augue nascetur, facilisis, sit in.
  28.             </p>
  29.         </div> 
  30.     </div>
  31. </div>


Structured Data Testing Tools Offered as Free Global Services

Google's Structured Data Testing Tool (in microdata)

  1. <div itemid="https://developers.google.com/structured-data/testing-tool/" itemscope itemtype="http://schema.org/Product http://schema.org/Service">
  2.     <link itemprop="additionalType" href="http://www.productontology.org/id/Validator">
  3.     <link itemprop="additionalType" href="http://www.productontology.org/id/Semantic_publishing">
  4.     <a itemprop="url" href="https://developers.google.com/structured-data/testing-tool/">
  5.         <span itemid="http://www.google.com" itemprop="brand manufacturer provider" itemscope itemtype="http://schema.org/Corporation">
  6.             <span itemprop="name">Google</span>
  7.             <link itemprop="makesOffer" href="#Offer">
  8.         </span> 
  9.         <span itemprop="name">Structured Data Testing Tool</span>
  10.     </a>
  11.     <span itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
  12.         <span itemid="http://en.wikipedia.org/wiki/Earth" itemprop="geo" itemscope itemtype="http://schema.org/GeoShape">
  13.             <meta itemprop="name" content="Earth">
  14.             <link itemprop="sameAs" href="http://dbpedia.org/page/Earth">
  15.             <link itemprop="sameAs" href="http://www.freebase.com/m/02j71">
  16.             <link itemprop="sameAs" href="http://www.wikidata.org/wiki/Q2">
  17.         </span>
  18.     </span>
  19.     <span itemid="#Offer" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  20.         <link itemprop="itemOffered" href="https://developers.google.com/structured-data/testing-tool/">
  21.         <link itemprop="seller" href="http://www.google.com">
  22.         <span itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
  23.             <link itemprop="url" href="http://purl.org/goodrelations/v1#ProvideService">
  24.         </span>
  25.         <link itemprop="eligibleRegion" href="http://en.wikipedia.org/wiki/Earth">
  26.         <meta itemprop="priceCurrency" content="USD">
  27.         <meta itemprop="price" content="0">
  28.     </span>
  29. </div>


Yandex's Structured Data Validator (in RDFa)

  1. <div vocab="http://schema.org/" prefix="pto: http://www.productontology.org/id/" resource="https://webmaster.yandex.com/microtest.xml" 
  2. typeof="Product Service pto:Validator pto:Semantic_publishing">
  3.      <a property="url" href="https://webmaster.yandex.com/microtest.xml">
  4.         <span resource="https://www.yandex.com/" property="brand manufacturer provider" typeof="Corporation">
  5.             <span property="name">Yandex</span>
  6.             <link property="makesOffer" href="#Offer">
  7.         </span>
  8.         <span property="name">Structured Data Validator</span>
  9.     </a>
  10.     <span property="serviceArea" typeof="AdministrativeArea">
  11.         <span resource="http://en.wikipedia.org/wiki/Earth" property="geo" typeof="GeoShape">
  12.             <meta property="name" content="Earth">
  13.             <link property="sameAs" href="http://dbpedia.org/page/Earth">
  14.             <link property="sameAs" href="http://www.freebase.com/m/02j71">
  15.             <link property="sameAs" href="http://www.wikidata.org/wiki/Q2">
  16.         </span>
  17.     </span>
  18.     <span resource="#Offer" property="offers" typeof="Offer">
  19.         <link property="itemOffered" href="https://webmaster.yandex.com/microtest.xml">
  20.         <link property="seller" href="https://www.yandex.com/">
  21.         <span property="businessFunction" typeof="BusinessFunction">
  22.             <link property="url" href="http://purl.org/goodrelations/v1#ProvideService">
  23.         </span>
  24.         <link property="eligibleRegion" href="http://en.wikipedia.org/wiki/Earth">
  25.         <meta property="priceCurrency" content="USD">
  26.         <meta property="price" content="0">
  27.     </span>
  28. </div>


Structured Data Initiative's Structured Data Linter (in JSON-LD)

  1. <script type="application/ld+json">
  2. {
  3.     "@context":"http://schema.org",
  4.     "@id":"http://linter.structured-data.org/",
  5.     "@type":["Product","Service","http://www.productontology.org/id/Validator","http://www.productontology.org/id/Semantic_publishing"],
  6.     "url":"http://linter.structured-data.org/",
  7.     "brand":{
  8.         "@id":"http://structured-data.org/",
  9.         "@type":"Organization",
  10.         "name":"Structured Data Initiative",
  11.         "makesOffer":"http://example.com/#Offer"
  12.     },
  13.     "manufacturer":"http://structured-data.org/",
  14.     "provider":"http://structured-data.org/",
  15.     "name":"Structured Data Linter",
  16.     "serviceArea":{
  17.         "@type":"AdministrativeArea",
  18.         "geo":{
  19.             "@id":"http://en.wikipedia.org/wiki/Earth",
  20.             "@type":"GeoShape",
  21.             "name":"Earth",
  22.             "sameAs":["http://dbpedia.org/page/Earth","http://www.freebase.com/m/02j71","http://www.wikidata.org/wiki/Q2"]
  23.         }
  24.     },
  25.     "offers":{
  26.         "@id":"http://example.com/#Offer",
  27.         "@type":"Offer",
  28.         "itemOffered":"http://linter.structured-data.org/",
  29.         "seller":"http://structured-data.org/",
  30.         "businessFunction":{
  31.             "@type":"BusinessFunction",
  32.             "url":"http://purl.org/goodrelations/v1#ProvideService"
  33.         },
  34.         "eligibleRegion":"http://en.wikipedia.org/wiki/Earth",
  35.         "priceCurrency":"USD",
  36.         "price":"0"
  37.     }
  38. }
  39. </script>