Reputation: 22803
I'm having trouble figuring out if I've done things right with RDFa and the schema.org Blog type. My blog used to have a list of posts that looked like this:
<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>
In trying to augment it with RDFa information, specifically the Blog and BlogPosting types, I have come up with this:
<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>
...
As far as I can tell with Google Rich Snippets Testing Tool, this looks like it parses right, but I can't really tell. I have two other tries:
<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>
...
So I'm asking for several pieces of information:
<a>
tag parse so differently in the RDFa demo tool and the Google Rich Snippets Testing Tool?Upvotes: 4
Views: 825
Reputation: 940
Your first snippet is correct and I'd recommend to use it. The second one is incorrect, as the property="name" will target the href value, so don't use that one. The third one is also correct, and uses a more advanced feature of RDFa called chaining (via the rel attribute). It's perfectly valid to use that one if you prefer, Google understands it too.
Upvotes: 4