使用 Schema 定义国家和食谱之间的关系

Defining a relationship between a country and a recipe with Schema

我正在构建一个网页,列出每个国家/地区的典型菜肴。每道菜都放在自己的 article 中,一切顺利。不过不知有没有办法把link的Recipe发到国内。还用 http://schema.org/Country 指定国家/地区是否有意义?如果是这样,我如何 link 将其添加到菜肴中?

我想过将 main 定义为一个国家,然后使用 http://schema.org/additionalProperty 但这似乎没有意义,因为它需要 PropertyValue,而食谱不是。

<main>
  <h1>France</h1>
  <p>
    <span class="capital" title="Capital">Paris</span>
    <span class="member-since" title="Member of the EU since 1958">1958</span>
  </p>

  <article id="recipe-1" itemscope itemtype="http://schema.org/Recipe">
    <h1>Éclairs</h1>
    <!-- A lot of recipe-related stuff -->
  </article>

  <article id="recipe-2" itemscope itemtype="http://schema.org/Recipe">
    <h1>Macaron</h1>
    <!-- A lot of recipe-related stuff -->
  </article>

  <article id="recipe-3" itemscope itemtype="http://schema.org/Recipe">
    <h1>Tarte Tatin</h1>
    <!-- A lot of recipe-related stuff -->
  </article>
</main>

您可以提供Recipe with its recipeCuisine属性的美食:

The cuisine of the recipe (for example, French or Ethiopian).

它需要一个 Text 值。

还有 locationCreated 属性,它需要一个 Place 值(包括 Country),但在此使用它可能有点牵强语境。也不清楚它是指食谱最初来自的位置,还是指创建书面形式的位置。

Schema.org 似乎没有提供 属性 来直接连接 CountryRecipe。但您仍然可以通过 WebPage.
连接项目 因此,例如,如果您说 WebPage about CountryWebPage mainEntity ItemList,并且每个 Recipe 都作为 itemListElement,则至少存在一些联系(关于特定国家/地区的页面有一个列表作为主要内容的食谱 = 食谱可能与该国家/地区有关)。