(这是一个自我回答的问题。它没有在https://stackoverflow.com/questions/23019537/correct-warranty-itemprop-syntax上发布,因为用户要求的是微数据,而不是JSON-LD)
如何使用schema.org属性“https://schema.org/warranty”中列出的“保证”?
没有提供任何示例,甚至JSON格式也没有。例如,关于https://schema.org/offers的文章提供了如下示例:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Product",
"aggregateRating": {
"@type": "AggregateRating",
"bestRating": "100",
"ratingCount": "24",
"ratingValue": "87"
},
"image": "dell-30in-lcd.jpg",
"name": "Dell UltraSharp 30\" LCD Monitor",
"offers": {
"@type": "AggregateOffer",
"highPrice": "$1495",
"lowPrice": "$1250",
"offerCount": "8",
"offers": [
{
"@type": "Offer",
"url": "save-a-lot-monitors.com/dell-30.html"
},
{
"@type": "Offer",
"url": "jondoe-gadgets.com/dell-30.html"
}
]
}
}
</script>发布于 2017-01-03 06:44:11
正确的用法如下( HTML代码中的某个地方):
在https://search.google.com/structured-data/testing-tool上测试。
<script type="application/ld+json">
{
"@context" : "http://schema.org/",
"@type" : "Product",
"name": "Sample product",
"offers" : {
"@type" : "Offer",
"description": "Producto de Seiteka",
"availability": "http://schema.org/InStock",
"priceSpecification" : {
"@type" : "PriceSpecification",
"priceCurrency": "USD",
"price": "45"
},
"warranty": {
"@type": "WarrantyPromise",
"durationOfWarranty" : {
"@type" : "QuantitativeValue",
"value": "6",
"unitCode": "MON"
},
"warrantyScope": {
"@type" : "WarrantyScope",
"description": "Product listed in this page has 6 months of warranty."
}
}
}
}
</script>他们也是warrantyScope。
QuantitativeValue,使用的是value。
WarrantyScope,使用的是description。
最后,他们谈到了warrantyPromise (而不是),说明WarrantyPromise属性必须在warrantyPromise中。
https://stackoverflow.com/questions/41437038
复制相似问题