Is the application of "@graph" keyword in the code below correct?
What I am trying to do here is to establish a relation between the product "Wire Rope" and the types of wire ropes.
I also want to represent the productGroup "Wire Rope" as a schema of the type Product.
Hence, the "@graph" property.
Is my code correct?
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "ProductGroup",
"name": "Wire Rope",
"@graph": {
"@type": "Product",
"name": "Wire Rope",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.9",
"reviewCount": "19"
},
}
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.9",
"reviewCount": "19"
},
"description": "Various types of wire ropes for different applications.",
"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"
}
},
{
"@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"
}
},
{
"@type": "Product",
"name": "Galvanized wire rope",
"image": "https://sviboindustries.in/wp-content/uploads/2023/05/galvanized-wire-rope-500x500-1.png",
"description": "Galvanized wire rope is a cable made of steel wires that are coated with a layer of zinc through the process of galvanization.",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.7",
"reviewCount": "8"
}
},
{
"@type": "Product",
"name": "Ungalvanized wire rope",
"image": "https://sviboindustries.in/wp-content/uploads/2023/05/black-steel-wire-rope-500x500-1.jpg",
"description": "Ungalvanized wire rope is a cable made of steel wires without a protective zinc coating.",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.9",
"reviewCount": "15"
}
}
]
}
</script>
2
Answers
The last comma in your graph is in the wrong place. Try
What are you trying to achieve with using graph?
If we exclude the syntax error that Tony McCreath told you about, then the semantics of your markup represent the group of products with the name Wire Rope, the separate product with the same name Wire Rope (created as the node with the
@graph
element) with poor product information (only name and rating), and four products included in the product group (created ashasVariant
property values). Check the structured data test result from Schema and visualize your markup with corrected syntax from JSON-LD Playground:It’s quite difficult to evaluate the semantics of your markup without being able to see the main content that the markup represents. Also, it is quite difficult for me to imagine content that has two separate subjects (the group of products and one product) with the same name.
I’m guessing you probably intentionally removed the
url
properties from your markup.Read more about An Extension to the Application Programming Interface for the JSON-LD Syntax, including the
@graph
element.