jsonschema.orgjson-ldgoogle-rich-snippets

Implementation of "@graph" keyword in JSON-LD markup-schema


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>

Solution

  • The last comma in your graph is in the wrong place. Try

    "@graph": {
        "@type": "Product",
        "name": "Wire Rope",
        "aggregateRating": {
            "@type": "AggregateRating",
            "ratingValue": "4.9",
            "reviewCount": "19"
        }
    },
    

    What are you trying to achieve with using graph?