首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用JSON-LD /如何使用Warranty属性使用schema.org的Warranty

用JSON-LD /如何使用Warranty属性使用schema.org的Warranty
EN

Stack Overflow用户
提问于 2017-01-03 05:34:44
回答 1查看 323关注 0票数 1

(这是一个自我回答的问题。它没有在https://stackoverflow.com/questions/23019537/correct-warranty-itemprop-syntax上发布,因为用户要求的是微数据,而不是JSON-LD)

如何使用schema.org属性“https://schema.org/warranty”中列出的“保证”?

没有提供任何示例,甚至JSON格式也没有。例如,关于https://schema.org/offers的文章提供了如下示例:

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

发布于 2017-01-03 06:44:11

正确的用法如下( HTML代码中的某个地方):

https://search.google.com/structured-data/testing-tool上测试。

代码语言:javascript
复制
<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>

组织,并且应该在其中包含WarrantyPromise

他们也是warrantyScope

QuantitativeValue,使用的是value

WarrantyScope,使用的是description

最后,他们谈到了warrantyPromise (而不是),说明WarrantyPromise属性必须在warrantyPromise中。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41437038

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档