使用角色的 hasOccupation 对象数组的 SDTT 错误:"hasOccupation is not a known valid target type for the hasOccupation property"

Error in SDTT for an array of hasOccupation objects using Roles: "hasOccupation is not a known valid target type for the hasOccupation property"

使用 JSON-LD 语法和 Schema.org 词汇,根据 Schema.org's Occupation example 4,以下内容应该有效,但事实并非如此。

{
    "@context": "http://schema.org",
    "@type": "Person",
    "name": "Jane Smith",
    "sameAs": "http://en.wikipedia.org/wiki/Jane_Smith",
    "worksFor": {
        "@type": "Organization",
        "name": "McKinsey & Company",
        "url" : "http://www.mckinsey.com"
    },
    "hasOccupation": [ {
          "@type": "Role",
          "hasOccupation": {
            "name": "Management Consultant"
          },
          "startDate": "2016-04-21"
        }, {
          "@type": "Role",
          "hasOccupation": {
            "name": "Chief Strategic Officer"
          },
          "startDate": "2013-11-14",
          "endDate": "2016-03-22"
        }, {
          "@type": "Role",
          "hasOccupation": {
            "name": "Vice President of Sales"
          },
          "startDate": "2009-09-20",
          "endDate": "2013-10-14"
        }
    ]
}

通过 Google 的 Structured Data Testing Tool:

hasOccupation is not a known valid target type for the hasOccupation property.

您没有在 Role 中提供 hasOccupation 值的类型。它需要一个 Occupation 值。

所以这个

"hasOccupation": {
  "name": "Management Consultant"
}

应该变成这样

"hasOccupation": {
  "@type": "Occupation",
  "name": "Management Consultant"
}

(其他情况相同。)