1

I'm following Google's official examples to make JSON-LD markup for reviews and test in Google's structured data testing tool.

When making list of reviews for the same organization (all reviews are about the same organization), the testing tool shows duplicates.

For example, two reviews of the same Thing (a book) pass the test OK:

<script type="application/ld+json">
[{
  "@context": "http://schema.org/",
  "@type": "Review",
  "itemReviewed": {
    "@type": "Thing",
    "name": "Super Book"
  },
  "author": {
    "@type": "Person",
    "name": "Joe"
  },
  "reviewRating": {
    "@type": "Rating",
    "ratingValue": "8",
    "bestRating": "10"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Washington Times"
  }
},
{
  "@context": "http://schema.org/",
  "@type": "Review",
  "itemReviewed": {
    "@type": "Thing",
    "name": "Super Book"
  },
  "author": {
    "@type": "Person",
    "name": "Jane"
  },
  "reviewRating": {
    "@type": "Rating",
    "ratingValue": "7",
    "bestRating": "10"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Washington Times"
  }
}]
</script>

Results: Google correctly detects two reviews of a Book with single reference to the Books name in each review.

Now I just change Thing to Organization, and what I get is a mess.

<script type="application/ld+json">
[{
  "@context": "http://schema.org/",
  "@type": "Review",
  "itemReviewed": {
    "@type": "LocalBusiness",
    "@id": "www.some-url.com",
    "name": "Company Name"
  },
  "author": {
    "@type": "Person",
    "name": "Jack"
  },
  "reviewRating": {
    "@type": "Rating",
    "ratingValue": "5",
    "bestRating": "5"
  },
  "publisher": {
    "@type": "Organization",
    "@id": "www.some-url.com",
    "name": "Company Name"
  }
},
{
  "@context": "http://schema.org/",
  "@type": "Review",
  "itemReviewed": {
    "@type": "LocalBusiness",
    "@id": "www.some-url.com",
    "name": "Company Name"
  },
  "author": {
    "@type": "Person",
    "name": "Jane"
  },
  "reviewRating": {
    "@type": "Rating",
    "ratingValue": "4",
    "bestRating": "5"
  },
  "publisher": {
    "@type": "Organization",
    "@id": "www.some-url.com",
    "name": "Company Name"
  }
}
]
</script>

The output in the testing tool shows multiple references to the organization name:

Four times for two reviews. When I add a hundred of reviews, each will contain hundreds of references to the organization.

Why is it such a mess? if this affects the code, how fix it?

0

Now I just change Thing to Organization, […]

This was not the only change. Your second example also contains an @id for every node about the company.

It’s a good practice to provide such node identifiers. In your case, it conveys that all reviews are about the same company, and that the reviewed company is also the publishing company.

It should not be relevant how Google’s SDTT displays it, as long as it doesn’t display something that’s wrong. It seems to display all properties from all nodes with the same @id, even if they have the same value (like they typically should have). It’s just a display issue, nothing wrong with your data.

Alternative: reference instead of embed

There is a way that doesn’t require you to add a full node every time you want to say someting about the company: use @id to reference the full node.

This doesn’t only save space, and avoid possible data duplication issues, it also gets rid of the display issues in the SDTT.

You can find a full example in this answer.

In your case:

Add a top-level node with "@type": "LocalBusiness", give it your organization’s @id, and provide all relevant properties:

{
  "@context": "http://schema.org/",
  "@type": "LocalBusiness",
  "@id": "http://www.example.com/#organization",
  "name": "Company Name"
}

Reference this node from the Review items:

"itemReviewed": {"@id": "http://www.example.com/#organization"}
"publisher": {"@id": "http://www.example.com/#organization"}
  • Thanks! Omitting "@type": "LocalBusiness" and just keeping the "@id": "www.some-url.com" does the trick. The only note is that SDTT shows that reviewed item by default is a @Thing, not a LocalBusiness. I hope Google bot can understand, that it's a local business by it's unique @id. – Alex V Jun 28 '17 at 14:07
  • @AlexV: It should parse the type correctly, not as Thing (it works for me). Did you copy-paste my first snippet exactly like that? It should display the @type specified there. – unor Jun 28 '17 at 15:02
  • 1
    Oh, yes, I see it now. I first tested reviews only. Now it really works and makes sense. Thanks! – Alex V Jun 28 '17 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.