Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct way to use multiple itemtypes in Microdata

See http://microdatagenerator.org/ for example.

What is the standardized way of, for example, declaring that my page is about a LocalBusiness which is also an AutomotiveBusiness? And where is the standards document that specifies this definitively?

like image 754
themirror Avatar asked Dec 31 '25 17:12

themirror


1 Answers

The W3C Microdata specification (currently a Working Draft) says about the itemtype attribute:

The itemtype attribute, if specified, must have a value that is an unordered set of unique space-separated tokens that are case-sensitive, each of which is a valid absolute URL, and all of which are in the same vocabulary. The attribute's value must have at least one token.

Multiple types from the same vocabulary

So you can specify multiple item types in an itemtype attribute if they are all from the same vocabulary (e.g. Schema.org):

<article itemscope itemtype="http://schema.org/HotelRoom http://schema.org/Offer">
 <!-- an MTE (multi-typed entity) 
      with the types 'HotelRoom' and 'Offer' -->
</article>

In your case it would typically not be necessary to provide both types, as AutomotiveBusiness inherits from LocalBusiness (i.e., every AutomotiveBusiness is also a LocalBusiness).

Multiple types from different vocabularies

If you want to provide types from multiple vocabularies, you can use Schema.org’s additionalType property:

<article itemscope itemtype="http://schema.org/AutomotiveBusiness">
  <link itemprop="additionalType" href="http://www.productontology.org/id/Automobile_repair_shop" />
 <!-- an MTE (multi-typed entity) 
      with the Schema.org type 'AutomotiveBusiness' 
      an an additional PTO type 'Automobile_repair_shop' -->
</article>

Multiple items with the same itemid value

You can also provide separate items (each with its own itemscope) and give them the same itemid value, thereby conveying that they are about the same thing:

<div itemscope itemtype="http://schema.org/HotelRoom" itemid="/rooms/42#this">
</div>

<div itemscope itemtype="http://schema.org/Offer" itemid="/rooms/42#this">
</div>
like image 197
unor Avatar answered Jan 05 '26 14:01

unor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!