说我有这个有效的微增强HTML片段:如何使用多个词汇与HTML5微(不同的词汇比schema.org)
<div itemscope itemtype="http://schema.org/Corporation">
<div itemprop="legalName">Example</div>
</div>
(我已经与谷歌的结构化数据测试工具来测试这一点)
现在我想添加一个属性是不可用schema.org但在不同的翻译(在这种情况下注册的W3C组织翻译[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] Using itemprop without itemtype
[3] http://www.w3.org/wiki/Mixing_HTML_Data_Formats#Mixing_Vocabularies_using_Repeated_Content
那么谷歌的“测试工具”并没有声称属性丢失了,它抱怨该属性在模式[.org中不是未知]。你知道一个词汇如何禁止使用项目属性名称吗?我不确定这是正式还是散文。除此之外,我认为你是对的,关于规范,我的第二个例子应该是有效的。 – vanthome
@vanthome:关于所需的属性:这只是一个例子来解释Google的测试工具报告了许多与schema.org的正确使用无关的事情。 - 我不认为有一种方法可以让词汇不允许*类似的东西(词汇表可以证明某些东西没有意义。,但这通常不是一个规范性要求,而是像信息指南那样)。 – unor