(这是一个自我回答的问题。由于用户要求提供微数据,而不是JSON-LD,因此未在this post中发布
如何使用https://schema.org/warranty中列出的schema.org属性“保修”?。
没有提供示例,即使是JSON-LD格式也没有。例如, 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>
答案 0 :(得分:1)
正确用法如下(HTML代码中的某处):
在Google's Structured Data Testing Tool. You can check it too上进行了测试。
<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>
他们也say WarrantyPromise can have the properties durationOfWarranty
and warrantyScope
。
For durationOfWarranty
you must use QuantitativeValue
,allows value
将被使用。
For warrantyScope
you must use WarrantyScope
,allows description
将被使用。
最后,他们谈论了warrantyPromise
( not WarrantyPromise
),指出WarrantyPromise
属性必须位于warrantyPromise
内。