HTML5 微数据 - 多个 itemscope 的 itemref

HTML5 Microdata - itemref to multiple itemscope's

是否可以将 itemref 用于 link 超过 1 个项目范围。场景如下:

我在一个页面上有几个博客 post,每个博客 post 都有相同的人和组织元信息。与其在每个博客 post 中包含个人和组织的所有元信息,不如引用该信息?我可以用一个参考来做到这一点,例如人:

<div id="person" itemscope itemprop="author" itemtype="http://schema.org/Person">
  <span itemprop="name">Joe Blogs</span>
</div>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>

  <div itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
    <span itemprop="name">Organization</span>
    <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
      <meta itemprop="url" content="http://example.com/image.jpg">
      <meta itemprop="width" content="600">
      <meta itemprop="height" content="60">
    </div>
  </div>
</article>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>

  <div itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
    <span itemprop="name">Organization</span>
    <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
      <meta itemprop="url" content="http://example.com/image.jpg">
      <meta itemprop="width" content="600">
      <meta itemprop="height" content="60">
    </div>
  </div>
</article>

但无法通过 2 个参考文献完成:

<div id="person" itemscope itemprop="author" itemtype="http://schema.org/Person">
  <span itemprop="name">Joe Blogs</span>
</div>

<div id="organization" itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
  <span itemprop="name">Organization</span>
  <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="600">
    <meta itemprop="height" content="60">
  </div>
</div>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person" itemref="organization">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>
</article>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person" itemref="organization">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>
</article>

或:

<div id="person" itemscope itemprop="author" itemtype="http://schema.org/Person">
  <span itemprop="name">Joe Blogs</span>
</div>

<div id="organization" itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
  <span itemprop="name">Organization</span>
  <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="600">
    <meta itemprop="height" content="60">
  </div>
</div>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>

  <meta itemref="organization" itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
</article>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>

  <meta itemref="organization" itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
</article>

运行 这两个通过 https://developers.google.com/structured-data/testing-tool/ 给出错误。虽然至少第三个例子表明正在制作组织参考。

itemref 属性可以有多个值,由 space 分隔。

所以

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person" itemref="organization">

使用

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person organization">

¹ 参考。 WHATWG spec: itemref / W3C Note: itemref