WebSchemas/MultipleTypesSDO

From W3C Wiki
Jump to: navigation, search

Multiple-(additional)Type Entities and their property values in Schema.org

Case

Multi-type Entity

  • schema.org/Product and schema.org/Service are combined to form a new entity: [Product Service"].
  • Multiple textual values have been added to a single property so to declare the 'name' and 'serviceType' properties of the new entity using the same data: [itemprop="name serviceType"].
  • Multiple external references and vocabularies (additionalType) have been added to provide more specific data about certain entities.


Issues

  • All official markup validators (Yandex & Google Structured data testing tool, W3 markup validator) do not support the declaration of multiple types separated by a 'space'. They either return a '%20' error or a pre-programmed error-response.
  • Both understanding of and support for the use of external references and vocabularies (by the sponsors of schema.org) is limited.
  • It's often unclear how to markup the order of graphs like the ones shown in this document, eg, which named entity should be the top-level-entity?


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.org/johns-quick-repair" title>
  4.             <span itemprop="name">John's Quik Repair</span>
  5.         </a>
  6.     </h1>
  7.     <img itemprop="logo" src="http://example.org/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.org/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.org/johns-quick-repair" title>
  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="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.org/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" title>
  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" title>
  4.             <span itemprop="name">John's Quik Repair</span>
  5.         </a>
  6.     </h1>
  7.     <img itemprop="logo" src="http://example.org/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 itemid="#BusinessFunction" 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.org/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
  17.                 <span itemid="#AdministrativeArea" itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
  18.                     <span itemid="#PostalAddress" 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.org/johns-quick-repair" title>
  4.             <span property="name">John's Quik Repair</span>
  5.         </a>
  6.     </h1>
  7.     <img property="logo" src="http://example.org/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 resource="#BusinessFunction" 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 http://schema.org/Service">
  14.             <link property="provider" href="#LocalBusiness" />
  15.             <p>
  16.                 <img property="image" src="http://example.org/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
  17.                 <span resource="#AdministrativeArea" 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 services offered globally as a business function

In Microdata

  1. <div itemid="#ProductService" 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.     <span>
  5.         <a itemprop="url" href="http://www.google.com/webmasters/tools/richsnippets" title>
  6.             <span itemid="#Organization" itemprop="brand manufacturer provider" itemscope itemtype="http://schema.org/Corporation">
  7.                 <span itemprop="name">Google</span>
  8.                 <link itemprop="url" href="http://www.google.com">
  9.                 <link itemprop="makesOffer" href="#Offer">
  10.             </span> 
  11.             <span itemprop="name">Structured Data Testing Tool</span>
  12.         </a>
  13.     </span>
  14.     <span itemid="#AdministrativeArea" itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
  15.         <meta itemprop="name" content="Earth">
  16.         <link itemprop="url" href="http://www.wikidata.org/wiki/Q2">
  17.         <link itemprop="sameAs" href="http://en.wikipedia.org/wiki/Earth">
  18.         <link itemprop="sameAs" href="http://dbpedia.org/page/Earth">
  19.         <link itemprop="sameAs" href="http://www.freebase.com/m/02j71">
  20.     </span>
  21.     <span itemid="#Offer" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  22.         <link itemprop="itemOffered" href="#ProductService">
  23.         <link itemprop="seller" href="#Organization">
  24.         <span itemid="#BusinessFunction" itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
  25.             <link itemprop="url" href="http://purl.org/goodrelations/v1#ProvideService">
  26.         </span>
  27.         <meta itemprop="priceCurrency" content="USD">
  28.         <meta itemprop="price" content="0">
  29.     </span>
  30. </div>


In RDFA

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