Mobile app version of vmapp.org
Login or Join
BetL925

: JSON-LD markup for review snippets shows duplicates 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

@BetL925

Posted in: #GoogleRichSnippetsTool #JsonLd #SchemaOrg

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @BetL925

1 Comments

Sorted by latest first Latest Oldest Best

 

@Shanna517

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"}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme