WebSchemas/MultipleTypesSDO

From W3C Wiki
Jump to: navigation, search

Multiple (additional)Types and Properties values in Schema.org

Intro

This is a trivial-example showing the wiki markup structure (look at the source within the wiki for details) for including pretty-printed HTML markup in a Wiki page:

  1.  <div itemscope="" itemtype="http://schema.org/SoftwareApplication http://schema.org/MobileApplication">
  2.     <p itemprop="operatingSystems">OSX 10.6</p>,
  3.     <p itemprop="operatingSystems">Windows 7</p>
  4.  ...
  5.  </div>

It also (to stay on topic) shows a Microdata syntax for mentioning multiple types. In this case it is quite a redundant example, since every MobileApplication is already known to be a SoftwareApplication too.

Other notes:

  • For types in another vocabulary, the http://schema.org/additionalType property can be used in Microdata. In RDFa, the @typeof attribute can use multiple schemas directly.
  • the schema.org design has built-in multiple types for everything below LocalBusiness, since every LocalBusiness is both an Organization and a Place
  • A common candidate for multiple-typing is Product, since many other type hierarchies are things that also serve as Products

Multiple type/property/numerations values & URI examples

Properties:

  • schema.org/Product and schema.org/Service are combined to form a new entity: [itemtype="http://schema.org/Product http://schema.org/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 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' and 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.

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

  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>, <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
  18. 					</span>
  19. 				</span><br />
  20. 				Service Type: 
  21. 				<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 as a business function in an area 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>, <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
  19. 				</span>
  20. 			</span><br />
  21. 			Service Type: 
  22. 			<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>, <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
  20. 			</span>
  21. 		</span><br />
  22. 		Service Type: 
  23. 		<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 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 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>, <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
  20. 					</span>
  21. 				</span><br />
  22. 				Service Type: 
  23. 				<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 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 property="serviceArea" typeof="AdministrativeArea">
  18. 					<span property="address" typeof="PostalAddress">
  19. 						<span property="addressLocality">Dallas</span> - <span property="addressLocality">Fort Worth</span>, <span property="addressRegion">Texas</span>, <span property="addressCountry">USA</span>
  20. 					</span>
  21. 				</span><br />
  22. 				Service Type: 
  23. 				<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 as a business function offered globally

In Microdata

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

In RDFA

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