Schema.org - 多次引用单个定义

时间:2016-02-08 08:55:25

标签: schema.org microdata json-ld

我有一个包含多篇文章的页面,我希望每个文章都将发布者描述为一个组织,但我想避免的是为每篇文章重新定义该组织。这可能吗?

itemref属性似乎只是在相反的方向上工作,指定父>孩子的关系,而不是相反。

在这个例子中,我采用了Schema.org的组织示例,我希望能够说明问题 - 每次都不能重复这个标记,它会使页面膨胀。

<div itemscope itemtype="http://schema.org/Organization">
  <span itemprop="name">Google.org (GOOG)</span>
  Contact Details:
    <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
      Main address:
        <span itemprop="streetAddress">38 avenue de l'Opera</span>
        <span itemprop="postalCode">F-75002</span>
        <span itemprop="addressLocality">Paris, France</span>
      ,
    </div>
      Tel:<span itemprop="telephone">( 33 1) 42 68 53 00 </span>,
      Fax:<span itemprop="faxNumber">( 33 1) 42 68 53 01 </span>,
      E-mail: <span itemprop="email">secretariat(at)google.org</span>
  Members:
  - National Scientific Members in 100 countries and territories: Country1, Country2, ...
  - Scientific Union Members, 30 organizations listed in this Yearbook:
  List of Alumni:
  <span itemprop="alumni" itemscope itemtype="http://schema.org/Person">
    <span itemprop="name">Jack Dan</span>
  </span>,
  <span itemprop="alumni" itemscope itemtype="http://schema.org/Person">
    <span itemprop="name">John Smith</span>
  </span>
</div>

<div itemscope itemtype="http://schema.org/NewsArticle">
  <meta itemprop="url" content="{{canonical_url}}" />
  <link itemprop="mainEntityOfPage" href="{{canonical_url}}">
  <meta itemprop="genre" content="{{genre}}" />
  <meta itemprop="publisher" temtype="http://schema.org/Organization" content="{{???}}" />
  <meta itemprop="dateModified" content="{{updated_at}}" />
  <div class="item-content">
    <div class="item-header" itemprop="name headline">
      {{Headline}}
    </div>
    <div class="item-body">

      <p itemprop="articleBody">
        {{content goes here}}
      </p>

    </div>

    <div class="item-footer">
      <span itemprop="datePublished dateCreated">{{date}}</span> - <span itemprop="creator author copyrightHolder">{{byline}}</span>
    </div>
  </div>
</div>

我目前正在使用微数据,但如果我正在尝试使用JSON,那么我会考虑切换。

1 个答案:

答案 0 :(得分:1)

如果您在同一页面上有Organization项和多个Article项,则可以使用Microdata的itemref属性为Organization项提供publisher项的值{1}}属性:

<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization" id="publisher-1">
</div>

<article itemscope itemtype="http://schema.org/Article" itemref="publisher-1">
</article>

<article itemscope itemtype="http://schema.org/Article" itemref="publisher-1">
</article>

<article itemscope itemtype="http://schema.org/Article" itemref="publisher-1">
</article>

如果使用此功能,则必须确保div(对于Organization项)不是具有itemscope的其他元素的子元素(否则将添加到publisher此项目另外为Search_code