我正在尝试将架构设置为我的 HTML 页面。验证器 ( https://developers.google.com/structured-data/testing-tool ) 在此页面失败:
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div itemscope itemtype="http://schema.org/SportsEvent">
<h1 itemprop="name">Event name</h1>
<p itemprop="description">Some text description ...</p>
<time itemprop="startDate" datetime="2016-03-16T16:00:00+01:00">16.3.</time> - <time itemprop="endDate" datetime="2016-03-20T16:00:00+01:00">20.3.2016</time>
<span itemprop="location">29-31 Craven Rd,London W2 3BX</span>
</div>
</body>
</html>
如您所见,它告诉我位置地址不能为空。
我也尝试使用 utils: http: //schema-creator.org/event.php 但即使我填写了所有输入,结果也是一样的:“错误无效位置。”
<div itemscope itemtype="http://schema.org/SportsEvent">
<a itemprop="url" href="https://www.myevent.com">
<div itemprop="name"><strong>Me super event</strong>
</div>
</a>
<div itemprop="description">super event
</div>
<div>
<meta itemprop="startDate" content="2016-03-06T12:00">Starts: 03/06/2016 12:00PM
</div>
<meta itemprop="endDate" content="2016-03-12:00.000">Ends: 2016-03-12:00.000
</div>
<div itemprop="location" itemscope itemtype="http://schema.org/PostalAddress">
<div itemprop="streetAddress">29-31 Craven Rd,London W2 3BX
</div>
<div>
<span itemprop="addressLocality">London
</span>,
<span itemprop="addressRegion">United kingdom
</span>
</div>
</div>
有人可以解释我如何指定位置吗?
编辑:正如@unor 告诉我的,位置必须是 PostalAddress 的实例,所以我修改了它:
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div itemscope itemtype="http://schema.org/SportsEvent">
<h1 itemprop="name">Event name</h1>
<p itemprop="description">Some text description ...</p>
<time itemprop="startDate" datetime="2016-03-16T16:00:00+01:00">16.3.</time> - <time itemprop="endDate" datetime="2016-03-20T16:00:00+01:00">20.3.2016</time>
<span itemprop="location" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">29-31 Craven Rd</span>
<span itemprop="address">29-31 Craven Rd,London W2 3BX</span>
<span itemprop="name">Test</span>
</span>
</div>
</body>
</html>
但它仍然无效,看起来 PostalAddress 中的地址必须是 Place,但 Place 中必须有 PostalAddress :-(