3

假设我有这个有效的微数据增强 HTML 片段:

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

(我已经用谷歌的结构化数据测试工具对此进行了测试。)

现在我想添加一个在 schema.org 中不可用但在不同词汇中可用的属性(在这种情况下,W3C 注册了 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>

至少谷歌声称:

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

我可以删除itemtype但我不想要这个,因为它会失去保真度 [2] 没有其他方法可以做到这一点吗?使用 RDFa 这将没有问题。

编辑

我发现 [3] 建议复制内容,但这显然不是一个好的解决方案。

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

[2]使用没有 itemtype 的 itemprop

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

4

1 回答 1

0

微数据(W3C 注释)定义了哪些值itemprop可能具有.

始终允许使用绝对 URI 作为itemprop值。

除非一个词汇表(如 schema.org)指定http://www.w3.org/ns/regorg#registration在此上下文中使用该值(“[…] 在这种情况下由词汇规范允许”),否则它将是

[…] 专有项目属性名称(即作者出于私人目的使用的名称,未在公共规范中定义)

Google 的结构化数据测试工具不是验证器。它的主要关注点是报告有关 Google 私有使用 schema.org 的警告,这就是为什么您也可能会收到有关缺少“必需”属性的警告(但schema.org 根本没有定义任何必需的属性)。

FWIW,Yandex 的结构化数据验证器没有报告使用绝对 URI 作为值的问题。

于 2014-02-13T16:40:12.897 回答