Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
272 views
in Technique[技术] by (71.8m points)

Google JSON Review Snippet not validating

I'm using the following JSON to produce a review snippet:

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "Review",
  "name": "Great service from the start.",
  "author": {
    "@type": "Person",
    "name": "Chris Tonich"
  },
  "reviewBody": "Very thorough...would highly recommend!",
  "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "4.9",
        "bestRating": "5",
        "ratingCount": "110",
        "itemReviewed": {
            "@type": "Product",
            "image": "https://www.homeintegrity.com.au/wp-content/uploads/2020/12/hi-new-logo2.jpg",
            "name": "Pre-Purchase Building Inspections",
            "priceRange": "$$",
            "telephone": "08 8375 8130",
            "address" :{
                "@type": "PostalAddress",
                "streetAddress": "PO Box 163",
                "addressLocality": "Scarborough",
                "addressRegion": "WA",
                "postalCode": "6019",
                "addressCountry": "AU"
            }
        }
    }
}
</script>

The Google Rich Snippet Test says:

enter image description here

Why am I receiving the error when the Review contains aggregateRating which contains itemReviewed?

Why does it say I rated a Review rather than an Item?

Help appreciated.

question from:https://stackoverflow.com/questions/65878379/google-json-review-snippet-not-validating

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Your structure is not according to the schema found on https://schema.org/

A Review must contain a field itemReviewed (or be embedded in the object, which is reviewed). (see examples at https://schema.org/Review)

A Review on the other hand must not contain an AggregateRating (see https://schema.org/AggregateRating), because an AggreateRating may only be a sub-node of a Brand, CreativeWork, Event, Offer, Organization, Place, Product, or Service. Note that these types may contain a Review too.


Your structure roughly is as follows:

  • Review "Great service from the start."
    • Author "Chris Tonich"
    • Aggregate rating "4.9"
      • Product "Pre-Purchase Building Inspections"
        • Address "6019 - ..."

What you probably want is something along the lines of:

  • LocalBusiness "Pre-Purchase Building Inspections"
    • Address "6019 - ..."
    • Review "Great service from the start."
      • Author "Chris Tonich"
    • Aggregate rating "4.9"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...