How to fix "ContactPoint must be attached to a parent with a declared type" linting error repored by SDTT - schema.org

The following template is supposed to represent a Gov Service with a ServicePhone / Contact Point:
{
"#context": "http://schema.org",
"#type": "GovernmentService",
"name": "",
"serviceType": "",
"url": "",
"audience": {
"#type": "Audience",
"name": ""
},
"availableChannel": {
"#type": "ServiceChannel",
"name": "",
"serviceLocation": {
"address": {
"#type": "PostalAddress",
"streetAddress": "",
"addressLocality": "",
"postalCode": ""
}
},
"servicePhone": {
"#type" : "ContactPoint",
"telephone" : "",
"email": "",
"name": ""
}
}
}
Which leads to the error message
"ContactPoint must be attached to a parent with a declared type."
https://search.google.com/structured-data/testing-tool
What am I missing?
edit: removing out-of-schema props, add screenshot
result of SDTT

Related

Google Email RentalCarReservation Schema markup not showing up in Calendar

I added a RentalCarReservation schema markup to my email, which has passed all the tests for whitelisting by Google, except that it does not create the calendar event automatically. I do see the event card above my email in Google and the action button is also working, but whatever I do, the event is not shown in the calendar (despite having 'Smart features' enabled in all Google apps).
https://www.google.com/webmasters/markup-tester/ lists no issues. I thought it might have something to do with the formatting of the datetime and switched this up a few times, but the card above the email shows the correct day and time.
What might I be doing wrong? Any help is appreciated!
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "RentalCarReservation",
"reservationNumber": "11111",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"url": "https://www.test.com/app/",
"underName": {
"#type": "Person",
"name": "FirstName",
"email": "firstname#email.com"
},
"programMembership": {
"#type": "ProgramMembership",
"memberNumber": "222222"
},
"bookingAgent": {
"#type": "Organization",
"name": "OrganizationName",
"url": "https://www.test.com/"
},
"bookingTime": "2022-02-22T06:25:07-01:00",
"modifyReservationUrl": "https://www.test.com/app/book?id=11111",
"potentialAction": [
{
"#type": "CancelAction",
"target": "https://www.test.com/app/edit?id=11111"
}
],
"reservationFor": {
"#type": "RentalCar",
"name": "Mini Cooper",
"model": "Mini Cooper",
"brand": {
"#type": "Brand",
"name": "Mini"
},
"description": "Ipsem Lorum.",
"rentalCompany": {
"#type": "Organization",
"name": "OrganizationName"
}
},
"pickupLocation": {
"#type": "Place",
"name": "Parkeerlocatie",
"address": {
"#type": "PostalAddress",
"streetAddress": "Nijmegenweg 2",
"addressLocality": "Almere",
"addressRegion": "Flevoland",
"postalCode": "1111AA",
"addressCountry": {
"#type": "Country",
"name": "NL"
}
},
"telephone": "+31000000000"
},
"pickupTime": "2022-03-11T07:00:00-01:00",
"dropoffLocation": {
"#type": "Place",
"name": "Parkeerlocatie",
"address": {
"#type": "PostalAddress",
"streetAddress": "Nijmegenweg 2",
"addressLocality": "Almere",
"addressRegion": "Flevoland",
"postalCode": "1111AA",
"addressCountry": {
"#type": "Country",
"name": "NL"
}
},
"telephone": "+31000000000"
},
"dropoffTime": "2022-03-11T10:00:00-01:00"
}
</script>

How to write hours of operations for Schema.org 'Preschool'?

I'm doing structured markup for multiple preschools. While the ChildCare type allows for openingHours, the Preschool type does not. Can anyone recommend a good way to include this? I'm keen on keeping it the Preschool type if only because that's what the category is set as in GMB.
Here is what I have so far for the entire structured markup. I'm also trying to find a way to get priceRange in there but can't seem to figure it out.
{
"#context": "http://schema.org",
"#type": "Preschool",
"name": "Name of Preschool",
"description": "Description of Preschool",
"address": {
"#type": "PostalAddress",
"streetAddress": "Address of Preschool",
"addressLocality": "City Name",
"addressRegion": "State Name",
"postalCode": "Zip Code",
"addressCountry": "United States"
},
"image": "Image URL",
"logo": "Image URL",
"url": "Preschool URL",
"foundingDate": "2016-05-01",
"founder": {
"#type": "Person",
"name": "Name of Founder"
},
"numberOfEmployees": {
"#type": "QuantitativeValue",
"value": "2"
},
"contactPoint": {
"#type": "ContactPoint",
"telephone": "Phone Number",
"contactType": "Customer Service",
"areaServed": {
"#type": "Place",
"name": "Neighborhood of the Preschool",
"branchCode": "Preschool Code",
"hasMap": "Google Map URL",
"geo": {
"#type": "GeoCoordinates",
"latitude": "Coordinate",
"longitude": "Coordinate"
}
}
},
"parentOrganization": {
"#type": "Organization",
"name": "Name of Parent Company",
"url": "URL of Parent Company"
}
}
It works for the ChildCare type, because it has LocalBusiness as parent type, which comes with the properties openingHours and priceRange.
If your preschools really are businesses, too, you could use a MTE by applying both types:
"#type": ["Preschool", "LocalBusiness"]
This allows you to use properties from Preschool as well as from LocalBusiness.

SDTT warning: "The property priceSpecification is not recognized by Google for an object of type Product."

I have the following JSON-LD and am trying to represent a pay monthly product such as a mobile phone contract which consists of an upfront fee and a monthly fee.
When I try to add the unitCode, I get the following warning:
The property priceSpecification is not recognized by Google for an object of type Product.
{
"#context": "https://schema.org/",
"#type": "Product",
"name": "Apple iPhone",
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"description": "Apple iPhone XS ...",
"sku": "0446310786",
"mpn": "925872",
"brand": {
"#type": "Thing",
"name": "ACME"
},
"review": {
"#type": "Review",
"reviewRating": {
"#type": "Rating",
"ratingValue": "4",
"bestRating": "5"
},
"author": {
"#type": "Person",
"name": "Fred Benson"
}
},
"aggregateRating": {
"#type": "AggregateRating",
"ratingValue": "4.4",
"reviewCount": "89"
},
"offers": {
"#type": "Offer",
"url": "https://example.com/anvil",
"priceCurrency": "GBP",
"price": "39.99",
"priceValidUntil": "2020-11-05",
"itemCondition": "https://schema.org/UsedCondition",
"availability": "https://schema.org/InStock",
"seller": {
"#type": "Organization",
"name": "Executive Objects"
}
},
"priceSpecification": {
"#type": "UnitPriceSpecification",
"price": "25",
"priceCurrency": "GBP",
"referenceQuantity": {
"unitCode": "MON"
}
}
}
You need to add the priceSpecification property to the Offer, not to the Product.
{
"#context": "https://schema.org/",
"#type": "Product",
"offers": {
"#type": "Offer",
"priceSpecification": {
"#type": "UnitPriceSpecification"
}
}
}
You can find the expected domain/range of a property on its page. For priceSpecification, it says:
Used on these types
Demand
Offer
TradeAction
So, it’s not expected on Product.

aggregateRating within Review object

We're trying to use the aggregateRating tag but we're getting this warning in the SDTT:
The aggregateRating property inside a Review object applies to the review itself, as a creative work. Did you mean to use reviewRating instead.
We want to aggregate the reviews from all users, not use reviewRating (we already use that one for our own reviews).
Does anyone know how to fix this error?
JSON-LD (example page):
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Review",
"name": "It",
"datePublished": "2017-09-06",
"description": "Based on Stephen King's 1986 novel, […]",
"url": "https://dev.commonsensemedia.org/movie-reviews/it",
"reviewBody": "Based on Stephen King's 1986 novel, […]",
"author": {
"#type": "Person",
"name": "Jeffrey M. Anderson",
"sameAs": "https://dev.commonsensemedia.org/users/jeffrey-m-anderson"
},
"itemReviewed": {
"#type": "Movie",
"name": "It",
"sameAs": "http://www.imdb.com/title/tt1396484/",
"datePublished": "2017-09-08",
"image": {
"#type": "ImageObject",
"url": "image.jpg"
},
"director": {
"#type": "Person",
"name": "Andres Muschietti"
},
"actor": [
{
"#type": "Person",
"name": "Bill Skarsg\u00e5rd"
},
{
"#type": "Person",
"name": "Jaeden Lieberher"
},
{
"#type": "Person",
"name": "Finn Wolfhard"
}
]
},
"publisher": {
"#type": "Organization",
"name": "Common Sense Media",
"sameAs": "https://www.commonsensemedia.org"
},
"reviewRating": {
"#type": "Rating",
"ratingValue": "4"
},
"aggregateRating": {
"#type": "AggregateRating",
"ratingValue": "4.04651",
"bestRating": 5,
"worstRating": 1,
"reviewCount": "43",
"name": "Parents say",
"description": "All parent member reviews for It"
}
}
</script>
When you add the aggregateRating property to the Review item, the aggregated rating is for the review, not for the reviewed item.
If the aggregated rating is for the reviewed item, you have to add the aggregateRating to this item (e.g., Movie).
If that is what you want, you can move the aggregateRating under Movie, e.g.:
{
"#context": "http://schema.org",
"#type": "Review",
"itemReviewed": {
"#type": "Movie",
"aggregateRating": {
"#type": "AggregateRating"
}
}
}

google now not showing event registration card

I am able to see the event in email but not in Google Now app. I am triggering email from Google App Script. The markup has been verified by Google's markup tester and is valid. Below is JSON-LD format:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "IO123456789",
"modifyReservationUrl": "http://www.searshomeservices.com",
"modifiedTime": "2015-03-04T02:30:00-06:00",
"underName": {
"#type": "Person",
"name": "John Smith"
},
"reservationStatus": "http://schema.org/Confirmed",
"reservationFor": {
"#type": "Event",
"name": "Event Confirmation",
"startDate": "2015-03-05T04:30:00-06:00",
"performer": {
"#type": "Person",
"name": "Jitendra",
"image": "https://lh3.googleusercontent.com/-qYfc01xZOSg/Uw46cceE_EI/AAAAAAAAABw/xNYxVibhDSs/s70-no/cara_verde.png"
},
"location": {
"#type": "Place",
"name": "Moscone Center",
"address": {
"#type": "PostalAddress",
"streetAddress": "800 W Howard St.",
"addressLocality": "Chicago",
"addressRegion": "IL",
"postalCode": "60626",
"addressCountry": "US"
}
}
}
}
</script>