6

I'm using some Microdata to describe a blog post, and I'm surprised by the value return for Schema.org’s BlogPosting by the Google Developers Testing Tool.

I would have expected it to be the itemprop url, not a merge of the website URL and the item id.
Am I doing something wrong, or is it only a Google display issue?

<div itemscope="itemscope"
     itemprop="blogPost"
     itemtype="http://schema.org/BlogPosting"
     id="foobar">
  <a itemprop="url" href="/realone">real</a>
</div>

Value returned by https://developers.google.com/structured-data/testing-tool/:

  BlogPosting:    http://www.example.com/foobar
  url:            http://www.example.com/realone
unor
  • 82,883
  • 20
  • 183
  • 315
user3074069
  • 133
  • 8

1 Answers1

2

This is strange.

It’s definitely not conforming to the Microdata Note. Apart from Microdata’s itemref attribute, HTML5’s id attribute has no special meaning in Microdata.

If Google wants to use the id value anyway, they should at least generate the URL with a fragment identifier, i.e., http://www.example.com/#foobar.

My guess is that they are (probably unintentionally) handling HTML5’s id attribute the same way as Microdata’s itemid attribute. If using itemid instead of id in your example, Google’s Testing Tool output is the same, but this time correct.

unor
  • 82,883
  • 20
  • 183
  • 315
  • Thanks. I made a too short example. Now that the id problem is "fixed". Do you know if it is possible to use something else than the url of the file being served to create the blogposting value. I don't want the `http://www.example.com/` as the base url, well at least I need another path (for example `/log/` instead of `/`) – user3074069 Apr 07 '15 at 15:10
  • @user3074069: Not sure I understand exactly what you want to achieve. Maybe you want to create a separate question for this (and link it here), where you can give more details? – unor Apr 07 '15 at 20:58