结构化数据测试工具与标记测试器的不同验证结果

时间:2016-03-25 22:11:57

标签: validation schema.org json-ld

所以我有以下JSON-LD标记,它通过标记测试器(https://www.google.com/webmasters/markup-tester/)没有错误,但是结构化数据测试工具(https://developers.google.com/structured-data/testing-tool/)未通过"必须附加ContactPoint到具有声明类型的父级。"

据我所知,我的ContactPoint附加到我的GovernmentService对象。有没有我没见过的东西?

<script type='application/ld+json'>
{
  "@context": "http://schema.org",
  "@type": "GovernmentService",
  "name": "Jibber Jabber",
  "serviceType": "Jabber Application",
  "description": "The Jibber Jabber application is tired of you Jibber jabber!",
  "availableChannel": {
    "@type": "ServiceChannel",
    "serviceUrl": "http://rustled.jimmies.com/",
Error-->"servicePhone":  {
      "@type" : "ContactPoint",
      "telephone" : "+1505890897",
      "name" : "Jabber phone service",
      "contactType": "customer support"
    }
  },
  "url": "http://jibjab.rustled.jimmies.com",
  "provider": {
    "@type": "GovernmentOrganization",
    "name": "Jibbering and Howling",
    "url": "http://desertbluffs.state.az.gov",
    "logo": "http://desertbluffs.state.az.gov/Eagle.gif"
  }
}
</script>

1 个答案:

答案 0 :(得分:1)

你的JSON-LD似乎是正确的,你使用Schema.org似乎是合适的:

  1. GovernmentService可以拥有availableChannel属性
  2. availableChannel需要ServiceChannel
  3. ServiceChannel可以拥有servicePhone属性
  4. servicePhone需要ContactPoint
  5. 这个最小的JSON-LD在Google的SDTT中给出了同样的错误:

    <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "GovernmentService",
      "availableChannel": {
        "@type": "ServiceChannel",
        "servicePhone":  {
          "@type" : "ContactPoint" 
        }
      }
    }
    </script>
    

    错误消息是指Google的知识图谱功能Corporate Contacts。除非我遗漏了某些内容,否则这似乎是Google工具does not mean中出现错误的许多情况之一,即您的标记错误。