我很难弄清楚我是否对RDFa和schema.org博客类型做了正确的事情。我的博客曾经有这样的帖子列表:
<h2><a href="essays/why-orm-divides-us.html">Why ORM Divides Us</a></h2>
<h2><a href="essays/heretic-calculus.html">A Heretical Calculus</a></h2>在尝试使用RDFa信息(特别是博客和BlogPosting类型)对其进行扩展时,我想出了以下内容:
<div vocab="http://schema.org/" typeof="Blog">
<h2 property="blogPosting" typeof="BlogPosting" resource="essays/why-orm-divides-us.html">
<a property="url" href="essays/why-orm-divides-us.html">
<span property="name">Why ORM Divides Us</span>
</a>
</h2>
<h2 property="blogPosting" typeof="BlogPosting" resource="essays/heretic-calculus.html">
<a property="url" href="essays/heretic-calculus.html">
<span property="name">A Heretical Calculus</span>
</a>
</h2>
...据我所知,用谷歌富片段测试工具,这看起来是正确的分析,但我真的不能说。我还有两次尝试:
<div vocab="http://schema.org/" typeof="Blog">
<h2 property="blogPosting" typeof="BlogPosting" resource="essays/why-orm-divides-us.html">
<a href="essays/why-orm-divides-us.html" property="name">Why ORM Divides Us</a>
</h2>
<h2 property="blogPosting" typeof="BlogPosting" resource="essays/heretic-calculus.html">
<a href="essays/heretic-calculus.html" property="name">A Heretical Calculus</a>
</h2>
...
<div vocab="http://schema.org/" typeof="Blog" rel="blogPosting">
<h2 typeof="BlogPosting" resource="essays/why-orm-divides-us.html">
<a property="url" href="essays/why-orm-divides-us.html">
<span property="name">Why ORM Divides Us</span>
</a>
</h2>
<h2 typeof="BlogPosting" resource="essays/heretic-calculus.html">
<a property="url" href="essays/heretic-calculus.html">
<span property="name">A Heretical Calculus</span>
</a>
</h2>
...所以我想要几条信息:
<a>标记在RDFa演示工具和Google测试工具中的解析方式如此不同?发布于 2012-09-08 15:51:55
您的第一个片段是正确的,我建议您使用它。第二个是不正确的,因为property="name“将以href值为目标,所以不要使用该值。第三种方法也是正确的,它使用了RDFa的一个更高级的特性,称为链接(通过rel属性)。如果你愿意的话,使用它是完全有效的,谷歌也理解它。
https://stackoverflow.com/questions/12328312
复制相似问题