Wire Rope系列产品JSON-LD结构化数据技术咨询
问题解答
1. 代码包含几个结构化数据?
你的代码意图定义2个结构化数据项:一个类型为Product的"Wire Rope"父产品,以及一个类型为ItemList的子产品变体列表。但当前代码存在JSON格式错误——两个顶级对象直接用逗号分隔,不符合JSON语法规范(正确的多数据项格式需要用数组包裹:[{}, {}]),所以实际无法被正常解析。
2. 是否可以用ProductGroup搭配hasVariant编写代码?
完全可以。Schema.org的ProductGroup类型就是专门用来表示一组相关的产品变体,hasVariant属性正是用于关联该组下的具体Product实例。这种方式比ItemList更能清晰体现父产品与子变体之间的层级关系,完全匹配你当前的业务场景(SS wire rope、PVC Coated wire rope等均为Wire Rope的子类)。
3. 当前代码是否正确?能否用于网页?
当前代码不正确,不能直接用于网页,核心问题有两个:
- JSON格式无效:两个顶级JSON对象未用数组包裹,浏览器和搜索引擎解析时会报错,无法识别结构化数据。
- 语义关系缺失:父产品"Wire Rope"和子产品变体之间没有建立关联,搜索引擎无法理解它们的层级关系,浪费了结构化数据的语义价值。
修正后的示例(采用ProductGroup方案)
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "ProductGroup", "name": "Wire Rope", "hasVariant": [ { "@type": "Product", "name": "Stainless Steel SS wire rope", "image": "https://sviboindustries.in/wp-content/uploads/2023/06/ss-wire-rope.jpg", "description": "The SS wire rope is a strong and flexible cable made of stainless steel wires twisted together, commonly used for various applications such as lifting, rigging, and suspension due to its durability and resistance to corrosion.", "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.9", "reviewCount": "16" }, "review": [ { "@type": "Review", "author": "Parth Parmar", "datePublished": "2021-05-08", "reviewBody": "The Stainless Steel SS wire ropes are strong and durable. Will recommend to others", "name": "Will Recommend", "reviewRating": { "@type": "Rating", "bestRating": "5", "ratingValue": "4", "worstRating": "1" } }, { "@type": "Review", "author": "Prashant Naik", "datePublished": "2022-09-01", "reviewBody": "Great Product from Svibo Industries, almost perfect! 4.5 stars.", "name": "Good Service", "reviewRating": { "@type": "Rating", "bestRating": "5", "ratingValue": "4.5", "worstRating": "1" } } ] }, { "@type": "Product", "name": "PVC Coated wire rope", "image": "https://sviboindustries.in/wp-content/uploads/2023/05/pr-203.png", "description": "PVC coated wire rope is a type of cable consisting of stainless steel wires encased in a protective PVC (polyvinyl chloride) coating. This coating provides additional resistance to corrosion, abrasion, and weathering, making it suitable for outdoor and marine applications.", "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.7", "reviewCount": "21" }, "review": [ { "@type": "Review", "author": "Durgesh Kulkarni", "datePublished": "2023-09-18", "reviewBody": "The plastic used is of top quality.", "name": "High quality plastic", "reviewRating": { "@type": "Rating", "bestRating": "5", "ratingValue": "4.9", "worstRating": "1" } }, { "@type": "Review", "author": "Saurabh Sinha", "datePublished": "2022-05-17", "reviewBody": "You can forget corrosion", "name": "Prevents corrosion well", "reviewRating": { "@type": "Rating", "bestRating": "5", "ratingValue": "4.6", "worstRating": "1" } } ] }, // 剩余两个变体产品(Galvanized、Ungalvanized)可直接沿用原有结构添加至此 ] } </script>
内容的提问来源于stack exchange,提问作者ssc1234
相关产品推荐
相关产品推荐

