我正在试验微数据,特别是使用 schema.org 标签。我试图描述可能具有相同位置属性的多个体育赛事。
<!--Sports Events -->
<div itemscope itemtype="http://schema.org/SportsEvent">
<span itemprop="name" style="font-weight:bold;">Event One</span><br />
<meta itemprop="location" content="venue" itemscope itemtype="http://schema.org/Place" itemref="olympicpark" />
<meta itemprop="startDate" content="2011-08-04T10:00">
<meta itemprop="endDate" content="2011-08-04T13:45">
</div>
<div itemscope itemtype="http://schema.org/SportsEvent">
<span itemprop="name" style="font-weight:bold;">Event Two</span><br />
<meta itemprop="location" content="venue" itemscope itemtype="http://schema.org/Place" itemref="olympicpark" />
<meta itemprop="startDate" content="2011-08-04T10:00">
<meta itemprop="endDate" content="2011-08-04T13:45">
</div>
<!--End Events -->
<!--Places -->
<h3>Venues</h3>
<div id="olympicpark">
<a itemprop="url" href="http://www.london2012.com/olympic-park">Olympic Park</a>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">Olympic Park</span>
<span itemprop="addressLocality">Stratford</span>
<span itemprop="addressRegion">London</span>
<span itemprop="postalCode">E20 2ST</span>
</div>
<div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
<meta itemprop="latitude" content="51.54615" />
<meta itemprop="longitude" content="-0.01269" />
</div>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">4</span> stars - based on
<span itemprop="reviewCount">250</span> reviews
</div>
</div>
<!-- End Places -->
每个体育赛事的属性“位置”通过 itemref 属性链接到“奥林匹克公园”地点。这似乎是正确的,并且 google 丰富的片段工具报告没有错误。我唯一担心的是,丰富的片段数据显示 location 属性不是直接指向奥林匹克公园,而是指向另一个引用它的项目。
这可以在下面看到:
Item
Type: http://schema.org/sportsevent
name = Event Two
location = Item( 2 )
startdate = 2011-08-04T10:00
enddate = 2011-08-04T13:45
Item 2
Type: http://schema.org/place
Ref to item: Item( olympicpark )
我希望看到的是每个体育赛事项目的微数据报告“位置 = 项目(奥林匹克公园)”。如果我将位置更改为以下位置,我可以得到这个
<span itemprop="location" content="venue" itemscope itemtype="http://schema.org/Place" itemref="olympicpark">
但是,如果我这样做,则不使用开始日期和结束日期,我可以理解,因为 span 标签没有关闭。
我正在兜圈子试图解决这个问题,如果可能的话,我真的很感激一些帮助。抱歉,如果这看起来令人困惑,我发现很难描述这个问题。
麦克风