所以我有以下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>
答案 0 :(得分:1)
你的JSON-LD似乎是正确的,你使用Schema.org似乎是合适的:
GovernmentService
可以拥有availableChannel
属性availableChannel
需要ServiceChannel
值ServiceChannel
可以拥有servicePhone
属性servicePhone
需要ContactPoint
值这个最小的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中出现错误的许多情况之一,即您的标记错误。