Multiple entries for email, phone, website, etc. in json-ld schema file - json

Adding additional entries when a business has more than one phone number or emails, etc., how do you do this in a json-ld file?
It works fine in html, but when I add a second item in json and run it through the validator it return the last one entry, i.e., if I list three phone numbers it return last number.

You have to define for example "Telephone" in this way :
{
"#context": "http://schema.org",
"#type": "Example",
"email": "mailto:example#example.com",
"telephone": [
"+123456789",
"+987654321"
]
}
You check your Schema with Google tool checker

It's note a valid code, you forget to add "," to the last line for phone tags :
{
"#context": "http://schema.org",
"#type": "Example",
"email": "mailto:example#example.com",
"telephone": [
"+123456789",
"+987654321"
],
}

Related

Should I include both #id and #type for node referencing in JSON-LD structured data?

While creating node referencing to avoid doing the same thing again and again, do I need to only specify the #id or both #id and #type?
For example, for a brand description, if the JSON-LD used on the homepage is:
"brand": {
"#type": "Brand",
"#id": "https://example.com/#brand",
"name": "Brand Name",
"description": "Brand description"
"url": "https://example.com/",
"sameAs": ["link1", "link2", "link3"]
}
then which of the following is the right way to reference the brand on the product pages?
Option 1:
"brand": {
"#type": "Brand",
"#id": "https://example.com/#brand"
}
Option 2:
"brand": {
"#id": "https://example.com/#brand"
}
Option 3:
"brand": "https://example.com/#brand"
You only need to specify the #id, the other parameters then get merged into the one entity.
I typically add a few extra parameters if I'm referencing an entity on a different page. e.g. #type, name, url. This helps consumers know a little about the referenced entity without crawling the alternate page. And it can stop testing tools from complaining.
In your example I'd do at least option 1 and maybe also add url.

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:
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.
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"

JSON-LD format for WebPage and BlogPosting

I have a medic weblog. My first page only has some data and top posts.
So I use this:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "WebPage",
"name": "website name",
"description": "website description",
"publisher": {
"#type": "WebPageMedic",
"name": "my company name"
}
}
</script>
Now for another page, how can I write JSON-LD format?
I try this:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "WebPage",
"name": "website name",
"description": "website description",
"publisher": {
"#type": "WebPageMedic",
"name": "my company name"
},
"mainEntity":{
"#type":"BlogPosting",
"headline":"BlogPosting",
"datePublished":"2015-03-09T13:08:00-07:00",
"articleBody": "articleBody"
}
}
</script>
I think I must write website information (WebPage) in all pages and then in mainEntity I can write BlogPosting and other things.
Am I right?
Yes, that is an appropriate structure if you want to have a WebPage item for every page (which is not necessary, but can be useful).
For a page that has multiple blog posts (in which case you might want to use CollectionPage), you could use a Blog item or an ItemList item as main entity. Another option is to use the hasPart property. See an example with mainEntity ItemList.
Notes about your example:
The properties of WebPage should be about the page, not about the site. You used "website name" and "website description". If you want to state something about your site, you can use the WebSite type.
There is no WebPageMedic type. You’ll probably want to use Organization or one of its sub-types, e.g., MedicalBusiness.

There is any way to reuse data on json-ld?

There is some way to reuse data in json-ld?
I have a WebSite and an Organization schemas with name, url and social links on it, i'm trying to get a better Google SEO and maybe one Google Graph Card like this:
https://developers.google.com/search/docs/guides/enhance-site
My json-ld is something like this:
<script type="application/ld+json">
[
{
"#context": "http://schema.org",
"#type": "WebSite",
"name": "Name",
"url": "http://www.example.com"
},
{
"#context": "http://schema.org",
"#type": "Organization",
"name": "Name",
"url": "http://www.example.com",
"sameAs": [
"https://twitter.com/example"
]
}
]
</script>
There is some way to not repeat name and url in both schemas?
And am I doing right? i really need the Organization schema to get these social links on the google card? Or the "sameAs" key could be in the WebSite schema?
I am following this guides:
https://developers.google.com/search/docs/data-types/sitename
https://developers.google.com/search/docs/data-types/social-profile-links

JSON-LD Create Single Review for Person

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