2016-10-10 38 views
1

在關於視頻網站的項目中,我必須準備關於有資格查看視頻資料的國家/地區的信息。schema.org的「eligibleRegion = All Countries」的最小標記

提供此信息的標記是這樣的:

<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> 

然而這似乎並不是很整潔的解決方案。

回答

1

由於eligibleRegion酒店還預計Text的價值,你可以使用這樣的:如果你有多個區域的地方比沒有資格

​​

,你可能想使用ineligibleRegion屬性。

如果您想表達內容在任何地方都符合條件,您當然可以簡單地省略任何eligibleRegion/ineligibleRegion屬性。這並沒有明確表明情況是這樣,但它可能是隱含的。

使用GeoShape/GeoCircle覆蓋整個地球的值將是一種明確的方法。


順便說一句,如果有可能讓你使用JSON-LD,而不是微觀數據,可以使用這樣的事情,這當然是更緊湊:

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

謝謝** @ unor **:但問題是我們要明確指出區域_ [因爲大部分視頻僅在某些國家/地區提供] _。因此,必須明確界定這些國家 - 在某些情況下,這些國家是全球的_allCountries_。 – user319730

+1

@ user319730:我認爲除了列出所有相關的ISO 3166代碼或使用包含GeoShape/GeoCircle的全部值以外,沒有其他(機器可理解的)選項。 - 如果你不需要這樣做,你可以使用'ineligibleRegion'並且只提供一個不再存在的國家的一個ISO 3166代碼。 – unor

相關問題