QAPage with multiple questions

守給你的承諾、 提交于 2019-12-10 09:56:16

问题


Is it possible to list multiple questions in the question markup and link them to one QAPage?

When I try the following JSON-LD, the Google test tool responds with the error that there is only one question allowed:

Exactly one Question expected on page for QAPage.

<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "QAPage",
"@id": "QAPage1",
    "description":"Blabla Blabla Blabla Blabla Blabla Blabla.",
    "image":"https://www.example.com/images/blabla.jpg",
    "name":"Blabla Blabla.",
    "url":"https://www.example.com"

}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
 "@graph": [
{
"@type": "Question",
"@id": "Question1",
"name": "Is this question 1?",
"upvoteCount": "196",
"text": "Is this question 1?",
"dateCreated": "2010-11-04T20:07Z",
"author": {
    "@type": "Person",
    "name": "someuser"
},
"answerCount": "4",
"acceptedAnswer": {
    "@type": "Answer",
    "upvoteCount": "1337",
    "url": "https://www.example.com",
    "text": "(The text of the accepted answer goes here...).",
    "dateCreated": "2010-12-01T22:01Z",
    "author": {
        "@type": "Person",
        "name": "someuser"
    }
},
"suggestedAnswer": {
    "@type": "Answer",
    "upvoteCount": "39",
    "url": "https://www.example.com",
    "text": "(The text of the accepted answer goes here...).",
    "dateCreated": "2010-12-06T21:11Z",
    "author": {
        "@type": "Person",
        "name": "lonelyuser1234"
    }
},
"mainEntityOfPage": "QAPage1"
},
{
"@type": "Question",
"@id": "Question2",
"name": "Is this question 2?",
"upvoteCount": "196",
"text": "Is this question 2?",
"dateCreated": "2010-11-04T20:07Z",
"author": {
    "@type": "Person",
    "name": "someuser"
},
"answerCount": "4",
"acceptedAnswer": {
    "@type": "Answer",
    "upvoteCount": "1337",
    "url": "https://www.example.com",
    "text": "(The text of the accepted answer goes here...).",
    "dateCreated": "2010-12-01T22:01Z",
    "author": {
        "@type": "Person",
        "name": "someuser"
    }
},
"suggestedAnswer": {
    "@type": "Answer",
    "upvoteCount": "39",
    "url": "https://www.example.com",
    "text": "(The text of the accepted answer goes here...).",
    "dateCreated": "2010-12-06T21:11Z",
    "author": {
        "@type": "Person",
        "name": "lonelyuser1234"
    }
},
"mainEntityOfPage": "QAPage1"
}
]
}
</script>

I think it makes sense to allow more than one question per page. In my case it is a FAQ page where are several questions an answers. Is there anyone who has solved that problem?


回答1:


The description of the QAPage type:

A QAPage is a WebPage focussed on a specific Question and its Answer(s), e.g. in a question answering site or documenting Frequently Asked Questions (FAQs).

So it’s for one question. If you have multiple questions on the same page, you shouldn’t use QAPage.

There is a FAQPage type, but it’s currently in Pending (so it’s subject to change, see discussion about it), which currently has this description:

A FAQPage is a WebPage presenting one or more "Frequently asked questions" (see also QAPage).

It could look like:

{
  "@context": "http://schema.org/",
  "@type": "FAQPage",
  "hasPart": [
    {"@type": "Question"},
    {"@type": "Question"},
    {"@type": "Question"}
  ]
}

If your page has multiple questions, but not frequently asked questions (so it’s not a typical FAQ page), you shouldn’t use QAPage nor FAQPage. Go with their parent type, WebPage (or its subtype CollectionPage), instead.



来源:https://stackoverflow.com/questions/52036463/qapage-with-multiple-questions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!