How to to use multiple Vocabularies with HTML5 Microdata (different vocab than schema.org)

StackOverflow https://stackoverflow.com/questions/21757705

Domanda

Say I have this valid microdata enhanced HTML snippet:

<div itemscope itemtype="http://schema.org/Corporation">
  <div itemprop="legalName">Example</div>
</div>

(I have tested this with google's Structured Data Testing Tool.)

And now I want to add a property which is not available in schema.org but in a different vocab (in this case the W3C registered Org Vocab [1]):

<div itemscope itemtype="http://schema.org/Corporation">
  <div itemprop="legalName">Example</div>
  <div itemprop="http://www.w3.org/ns/regorg#registration">XXX</div>
</div>

At least google claims:

Error: Page contains property "http://www.w3.org/ns/regorg#registration" which is not part of the schema.

I could remove the itemtype but I don't want this as it is a loss of fidelity [2] Is there no other way of doing this? With RDFa this would be no problem.

EDIT

I've found [3] which proposes to duplicate the content but that's obviously not a nice solution.

[1] http://www.w3.org/TR/vocab-regorg/#ref_rov_registration

[2] Using itemprop without itemtype

[3] http://www.w3.org/wiki/Mixing_HTML_Data_Formats#Mixing_Vocabularies_using_Repeated_Content

È stato utile?

Soluzione

Microdata (W3C Note) defines which values itemprop may have.

Using an absolute URI as itemprop value is always allowed.

Unless a vocabulary (like schema.org) specifies the use of the http://www.w3.org/ns/regorg#registration value in this context ("[…] allowed in this situation by a vocabulary specification"), it would be

[…] a proprietary item property name (i.e. one used by the author for private purposes, not defined in a public specification)

Google’s Structured Data Testing Tool is not a validator. Its primary concern is reporting warnings regarding Google’s private use of schema.org, that’s why you also might get warnings about missing "required" properties (but schema.org doesn’t define any required properties at all).

FWIW, Yandex’ Structured data validator doesn’t report a problem with using the absolute URI as value.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top