2017-01-03 59 views
1

(这是一种自我回答问题。这不是在this post因为用户要求的微观数据,而不是JSON-LD转贴)使用/如何使用担保财产

如何使用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> 

回答

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> 

组织says the warranty property must be inside Offer or Demand, and that it should have WarrantyPromise inside

他们还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使用。

最后,他们谈论一些关于warrantyPromiseWarrantyPromise)指出WarrantyPromise属性必须是内warrantyPromise