5

我正在使用 Schema.org 微数据标记一个房产列表网站。我的网站的层次结构是这样排列的:

-City
--Region
---Postcode
----Area

每一个都是带有相互链接的单独页面,都用Placeitemtype 标记。我想使用该containedIn属性来描述这些不同页面之间的关系,但找不到任何关于如何最好地做到这一点的示例。

例如,在“区域”页面上,我有以下链接回“城市”,但不确定这是否足够或正确:

<meta itemprop="containedIn" content="New York">

当然,将搜索引擎指向纽约的实际城市页面 URL 比仅仅提供名称更有用吗?有人对此有任何提示或参考吗?

4

1 回答 1

5

这是您如何选择标记的一个示例。schema.org 标记非常灵活,因此不只有一种方法可以做到这一点。

<div itemscope itemtype="http://schema.org/Residence">
<span itemprop="name">Property Listing 1</span><br />
<a href="http://www.mypropertylisting.com/property1" itemprop="url">Property One</a><br />
    <span itemprop="telephone">555-555-5555</span><br />
    <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
        <span itemprop="streetAddress">555 N. Anywhere Street</span><br />
        <span itemprop="addressLocality">Somewhere</span>,
        <span itemprop="addressRegion">LA</span> <span itemprop="postalCode">55555</span>
        <span itemprop="addressCountry">USA</span>
    </div>
<div itemprop="containedIn" itemscope itemtype="http://schema.org/Place">
<span itemprop="name">Metropolitan Area</span>
<a href="http://www.mypropertylisting.com/metropolitan1" itemprop="url">LA Metropolitan Area</a>
<div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
<meta itemprop="latitude" content="34.065174" />
<meta itemprop="longitude" content="-118.240585" />
</div>
</div>
</div>

您可以使用 Google 的结构化数据测试工具 -> http://www.google.com/webmasters/tools/richsnippets验证这是否按预期工作

除了使用“geo”itemprop 之外,可能还有更好的方法来指定位置,但使用地理坐标可以确定您定位的是正确的位置。查看 schema.org 站点以查找您可以使用的其他属性,然后使用 google 结构化数据测试工具来测试您创建的标记。

祝你好运!

于 2013-01-25T17:19:23.187 回答