Schema.org 常见问题页面

Schema.org for the FAQ page

我有一个常见问题解答页面,我想用更好的 html-schema 来完成它。

<main role="main" itemscope itemtype="http://schema.org/WebPage">
  <article itemprop="mainContentOfPage">
    <header>
      <h1>Frequently Asked Questions</h1>
    </header>
    <section itemscope itemtype="http://schema.org/Question">
      <h2 itemprop="name">Some question #1</h2>
      <p itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
        <span itemprop="text">This is an answer #1</span>
      </p>
    </section>
    <section itemscope itemtype="http://schema.org/Question">
      <h2 itemprop="name">Some question #2</h2>
      <p itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
        <span itemprop="text">This is an answer #2</span>
      </p>
    </section>
    <section itemscope itemtype="http://schema.org/Question">
      <h2 itemprop="name">Some question #3</h2>
      <p itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
        <span itemprop="text">This is an answer #3</span>
      </p>
    </section>
  </article>
</main>

我认为页面的更好类型是 FAQPage 而不是 WebPage,但是 FAQPage 处于待定状态并且在 Google 结构化数据测试中未验证工具.

你觉得这个方案怎么样?正确吗?

FAQPage will be the best type for the page. If you don’t want to use it until it’s released, WebPage is the best alternative. You could also consider using both types for now, and remove WebPage as soon as FAQPage is part of the core vocabulary (or remove FAQPage if it goes to the attic):

<main itemscope itemtype="http://schema.org/WebPage http://schema.org/FAQPage">

我不会使用 mainContentOfPage 属性。它需要一个 WebPageElement,这通常是没有用的。

在您的情况下,Question 项目未连接到 WebPage 项目。为此,您可以使用 hasPart property.

<main itemscope itemtype="http://schema.org/WebPage http://schema.org/FAQPage">

  <section>

    <h2 itemprop="name">Frequently Asked Questions</h2>

    <article itemprop="hasPart" itemscope itemtype="http://schema.org/Question"></article>
    <article itemprop="hasPart" itemscope itemtype="http://schema.org/Question"></article>
    <article itemprop="hasPart" itemscope itemtype="http://schema.org/Question"></article>

  </section>

</main>

(我切换了 articlesection 元素,因为我认为这样在语义上更有意义。)