1
votes

How would you go about creating a review for a person? For instance if a user, submitted a review that provided both a rating and an associated bit of information about a person's/service provider's quality of service... how should that be coded using JSON-LD? I think the code below is how you would correctly accomplish this but I'm not completely certain. If you have any suggestions, please include code with your input to provide maximum clarity.

Please keep in mind the code below is not for a page that lists all of the ratings but rather a single page that displays only this rating.

Person/Service Single Review:

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Review",
  "itemReviewed": {
    "@type": "Person",
    "name": "John Smith", // Person being reviewd
  },
  "reviewRating": {
    "@type": "Rating",
    "bestRating": "5",
    "ratingValue": "3",
    "worstRating": "1"
  }
  "name": "Excellent Service!",
  "author": {
    "@type": "Person",
    "name": "Bob Smith"
  },
  "reviewBody": "John provided excellent service!"
}
</script>

Ref: https://developers.google.com/structured-data/rich-snippets/reviews

1

1 Answers

2
votes

Apart from the comment and two comma errors this is valid JSON-LD. I wouldn't expect this to show up as a rich snippet though. The page you referenced lists the entitz types for which reviews are supported: "We support reviews and ratings for a wide range of schema.org types, including businesses, products, and different creative works such as books or movies." If possible, I would thus associate the Review to a Service instead (the person can be made the provider of the service).

Here's the snippets with the two minor syntactic issues fixed:

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Review",
  "itemReviewed": {
    "@type": "Person",
    "name": "John Smith"
  },
  "reviewRating": {
    "@type": "Rating",
    "bestRating": "5",
    "ratingValue": "3",
    "worstRating": "1"
  },
  "name": "Excellent Service!",
  "author": {
    "@type": "Person",
    "name": "Bob Smith"
  },
  "reviewBody": "John provided excellent service!"
}
</script>