我有以下结构化数据:
{
"@context": "https://schema.org/",
"@type": "Offer",
"priceCurrency": "EUR",
"price": "12890",
"availability": "https://schema.org/InStock",
"priceValidUntil": "2019-12-13",
"itemOffered": {
"@type": "Car",
"brand": {
"@type": "Brand",
"name": "Renault"
},
"manufacturer": {
"@type": "Corporation",
"sameAs": "https://www.wikidata.org/wiki/Q6686",
"name": "Renault"
},
"name": "Renault Captur Life",
"model": "Captur Life",
"image": "https://www.xxxx.fr/uploads/models/renault-captur.png",
"description": "Renault Captur Life neuve - Essence - 90cv - 5 portes : 12 890€ ",
"fuelType": "Essence",
"vehicleTransmission": "Manuelle",
"vehicleConfiguration": "0.9 tce 90 bvm5",
"numberOfDoors": "5",
"vehicleEngine": {
"@type": "EngineSpecification",
"enginePower": {
"@type": "QuantitativeValue",
"value": "90",
"unitCode": "N12"
}
},
"itemCondition": "https://schema.org/NewCondition"
}
}
根据Google Structured Data Testing Tool,出现问题(这是最近的更新,我的结构化数据曾经有效):
应提供要约或评论之一或aggregateRating。
根据Rich Snippets Testing Tool,它是有效的。
那么这是怎么回事?为什么我必须添加offers
或review
或aggregateRating
?
答案 0 :(得分:1)
当人们以您的方式构造数据时,该更改导致该错误消失。即要约作为主要实体。如果您将标记翻转过来,所以它是一个有报价的产品,那么错误应该会消失。两种方法都是有效的,第二种方法与Google的示例及其测试工具所报告的内容一致。
答案 1 :(得分:1)
要扩展托尼的答案,Offer
应该是Car
(Product
)的扩展。 Product
可以嵌套在Offer
(see this recent question)内,但是看起来并不像您想要的那样。
为此修改您的JSON-LD将使事情有效(就Googles Structured Data Testing Tool而言):
{
"@context": "https://schema.org/",
"@type": "Car",
"fuelType": "Essence",
"model": "Captur Life",
"name": "Renault Captur Life",
"description": "Renault Captur Life neuve - Essence - 90cv - 5 portes : 12 890€ ",
"vehicleEngine": {
"@type": "EngineSpecification",
"enginePower": {
"@type": "QuantitativeValue",
"value": "90",
"unitCode": "N12"
}
},
"manufacturer": {
"@type": "Corporation",
"sameAs": "https://www.wikidata.org/wiki/Q6686",
"name": "Renault"
},
"image": "https://www.xxxx.fr/uploads/models/renault-captur.png",
"vehicleTransmission": "Manuelle",
"vehicleConfiguration": "0.9 tce 90 bvm5",
"numberOfDoors": "5",
"brand": {
"@type": "Brand",
"name": "Renault"
},
"offers": [{
"@type": "Offer",
"price": "12890",
"priceCurrency": "EUR",
"availability": "https://schema.org/InStock",
"priceValidUntil": "2019-12-13"
}],
"itemCondition": "https://schema.org/NewCondition"
}
}
在这种情况下,我们将Offer
嵌套在Car
中,以便Car
描述有关车辆的所有信息,而嵌套的Offer
描述如何购买。
我会注意到,截至本文撰写之日,Rich Snippets Testing Tool仍处于测试阶段,因此我会花一点时间来评估其结果。您可能会争辩,因为它是一个新工具,它可能与Google对Rich Snippets的处理方式更加吻合。.但在您的情况下,我相信结构化数据测试工具的期望是合理的。