html - schema.org 中 "eligibleRegion = All Countries"的最小标记

标签 html schema.org microdata

在一个关于视频网站的项目中,我必须准备有关有资格观看视频资料的国家的信息。

提供此信息的标记如下:

<span itemprop="eligibleRegion" itemscope itemtype="http://schema.org/Country">
    <meta itemprop="name" content="DE" />
</span>

<span itemprop="eligibleRegion" itemscope itemtype="http://schema.org/Country">
    <meta itemprop="name" content="FR" />
</span>

但是,有大量视频产品符合所有国家/地区的条件。因此,显而易见的做法是将上述标记重复大约 200 次,这似乎不是最佳解决方案。

是否有可能实现相同的结果 [产品在所有国家/地区的可用性] 但数据量要小得多?

类似于:

<span itemprop="eligibleRegion" itemscope itemtype="http://schema.org/Country">
    <meta itemprop="name" content="[allCountries] or [allRegions]" />
</span>

一个可能的解决方案

我想到一个可能的解决方案是使用来自 https://schema.org/geoRadius 的 geoRadius并为其指定一个非常大的半径(?!)

<div itemprop="geo" itemscope itemtype="http://schema.org/GeoCircle">
    <div itemprop="geoMidpoint" itemscope itemtype="http://schema.org/GeoCoordinates">
        <meta itemprop="latitude" content="42.362757" />
        <meta itemprop="longitude" content="-71.087109" />
    </div>
    <meta itemprop="geoRadius" content="[100000....]" />
</div>

然而,这似乎不是一个很好的解决方案。

最佳答案

作为eligibleRegion属性还需要 Text 作为值,您可以使用类似的东西:

<meta itemprop="eligibleRegion" content="DE" />
<meta itemprop="eligibleRegion" content="FR" />

如果您有更多符合条件的区域,您可能需要使用 ineligibleRegion属性(property)代替。

如果您想传达内容在任何地方都是合格的,您当然可以简单地省略任何 eligibleRegion/ineligibleRegion 属性。这并没有明确说明情况确实如此,但可能暗示了这一点。

使用 GeoShape/GeoCircle覆盖整个地球的值(value)观将是明确这一点的一种方式。


顺便说一下,如果你可以使用 JSON-LD 而不是 Microdata,你可以使用类似这样的东西,这当然更紧凑:

"eligibleRegion": ["DE", "FR"],

关于html - schema.org 中 "eligibleRegion = All Countries"的最小标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39962500/

相关文章:

html - body 延伸以适应屏幕仅在 chrome

html - CSS 使用 :target selector 更改整个表格行的背景颜色

metadata - 通过架构优化的博客文章

schema.org - 如何为 ItemList 中的产品编写标记?

html - 产品尺寸 : width, 高度和深度

javascript - jQuery 滚动函数粘性标题应该滚动

javascript - 谷歌地图 initMap 函数添加参数

schema.org - schema.org 中的多个作者或贡献者

php - Laravel 如何在多个页面上包含 Schema.org 结构化数据

html - 在 Schema.org 中显示折扣