问题描述
(这是一个自我回答的问题.它没有发布在这篇文章中 因为用户要求的是微数据,而不是 JSON-LD)
(This is a self-answered question. It wasn't posted in this post since the user asked for microdata, not JSON-LD)
您如何使用 https://schema.org/warranty?.
How do you use the schema.org property "Warranty", listed in https://schema.org/warranty?.
没有提供示例,甚至没有提供 JSON-LD 格式的示例.例如,关于 offers
的文章提供了这样的例子这个:
There're no examples provided, not even for JSON-LD format. For instance, the article on offers
provides examples like this:
<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>
推荐答案
正确的用法如下(HTML 代码中的某处):
The correct usage is as follows (somewhere inside your HTML code):
在 Google 的结构化数据测试工具上进行了测试.你也可以检查一下.
<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>
组织说warranty
属性必须在Offer
或需求
,里面应该有WarrantyPromise.
The organization says the warranty
property must be inside Offer
or Demand
, and that it should have WarrantyPromise inside.
他们还说 WarrantyPromise 可以具有属性 durationOfWarranty
和 warrantyScope
.
They also say WarrantyPromise can have the properties durationOfWarranty
and warrantyScope
.
对于durationOfWarranty
,您必须使用QuantitativeValue
,允许使用value
.
For durationOfWarranty
you must use QuantitativeValue
, which allows value
to be used.
对于warrantyScope
,您必须使用WarrantyScope
,允许使用description
.
For warrantyScope
you must use WarrantyScope
, which allows description
to be used.
最后,他们谈到了warrantyPromise
(不是WarrantyPromise
) 声明 WarrantyPromise
属性必须在 warrantyPromise
内.
Finally, they talk something about warrantyPromise
(not WarrantyPromise
) stating that WarrantyPromise
property must be inside warrantyPromise
.
这篇关于使用 schema.org 的保修与 JSON-LD/如何使用保修属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!