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:
- How do you tell if you’ve achieved conformance with one of these schemas?
- Which one of my alternatives is right, and why?
- Why do I seem to need to specify the resource directly when I’m on a link?
- Why does the
<a>tag parse so differently in the RDFa demo tool and the Google Rich Snippets Testing Tool?
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.