How to specify more than one areaServed (eg multiple municipalities) for a LocalBusiness? - schema.org

A lot of businesses serve multiple municipalities.
How should this be expressed in https://schema.org/areaServed (JSON LD)?
Eg as per https://schema.org/Service:
<script type="application/ld+json">
{
"#context": "https://schema.org/",
"#type": "Service",
"serviceType": "Weekly home cleaning",
"provider": {
"#type": "LocalBusiness",
"name": "ACME Home Cleaning"
},
"areaServed": {
"#type": "City",
"name": "New York"
},
... ?
</script>
Should it be:
"areaServed": {
"#type": "City",
"name": "New York"
},
"areaServed": {
"#type": "City",
"name": "Buffalo"
},
"areaServed": {
"#type": "City",
"name": "Syracuse"
},
Or something like:
"areaServed": {
"#type": "City",
"name": "New York",
"name": "Buffalo",
"name": "Syracuse"
},
Or something else?

According to the Schema documentation, the property areaServed can have values expected to be one of these types:
AdministrativeArea
GeoShape
Place
Text
There is no type City here as you indicate in your example. So I used type Place for my suggestion for you (alternative is the type AdministrativeArea):
{
"#context": "https://schema.org/",
"#type": "Service",
"serviceType": "Weekly home cleaning",
"provider": {
"#type": "LocalBusiness",
"name": "ACME Home Cleaning"
},
"areaServed": {
"#type": "Place",
"name":[ "New York","Buffalo"]
}
}
To use an alternative just change the name to type.

City is a "More specific Type" of "AdministrativeArea" according to schema.org documentation, so nothing wrong with using that.
(unfortunately haven't got enough points to write this as a comment under nikant25s comment but thought it was important to mention)
I would write something like this:
"areaServed": [{
"#type": "City",
"name": “New York”,
"sameAs": "https://en.wikipedia.org/wiki/New_York_City"
},
{
"#type": "City",
"name": “Buffalo”,
"sameAs": (the Wiki-page for the right Buffalo)
}],
Since there are a lot of cities with the same name it’s probably good to use the sameAs property to specify which one you mean :)

Related

How do i add Likes Received to Structured Data in JSON-LD for Product Type

I've been trying to figure out a way to add how many likes were received to a product using structured data. Is what I have below correct? Or would the second example be more correct?
Is my usage of ["Product","InteractionCounter"] for the type correct in the first example?
I'm trying to have the google show a likes counter much like the aggregateRating property of Product.
I'm also not sure what the url in offers is supposed to point to or if it's necessary. Any ideas?
<script type="application/ld+json">
{
"#context": "https://schema.org",
"#type": ["Product","InteractionCounter"],
"name": "CC-1",
"description": "Wedding Cake",
"interactionType":{
"#type":"LikeAction",
"name": "Likes",
"description": "Likes Received"
},
"interactionService": {
"#type":"WebSite",
"url": "https://example.com/index.php?page=gallery"
},
"userInteractionCount": 55
}
</script>
OR
<script type="application/ld+json">
{
"#context": "https://schema.org",
"#type": "Product",
"name": "CC-1",
"description": "Wedding Cake",
"additionalProperty": {
"#type": "PropertyValue",
"name": "Likes",
"description": "Likes Received",
"value": 55
}
}
</script>
This is what I have right now:
<script type="application/ld+json">
{
"#context": "https://schema.org",
"#type": ["Product","InteractionCounter"],
"name": "CC-1",
"description": "Wedding Cake with bla bla bla",
"category": "Wedding Cakes",
"brand": {
"#type": "Brand",
"logo": "https://example.com/images/logo.png",
"slogan": "Cakes Are Nice"
},
"offers": {
"#type": "Offer",
"url": "https://example.com/anvil",
"priceCurrency": "CAD",
"price": "119.99"
},
"image": "https://example.com/collection/wedding_cakes/mid_def/CC-1",
"interactionType":{
"#type":"LikeAction",
"name": "Likes",
"description": "Likes Received"
},
"interactionService": {
"#type":"WebSite",
"url": "https://mimozas.com/index.php?page=gallery"
},
"userInteractionCount": "55 PLACEHOLDER"
}
If the product is the subject of content, then it makes sense to indicate likes as part of the type Product. My suggestion for you:
{"#context":"https://schema.org",
"#type":"Product",
"name":"CC-1",
"description":"Wedding Cake",
"subjectOf":{
"#type": "InteractionCounter",
"interactionType":{
"#type":"LikeAction",
"name":"Likes",
"description":"Likes Received"
},
"interactionService":{
"#type":"WebSite",
"url":"https://example.com/index.php?page=gallery"
},
"userInteractionCount":"55"
}
}
And be careful about inverted commas.
My addition after expanding the question.
I'm trying to have the google show a likes counter much like the
aggregateRating property of Product.
Google has no direct support for the type InteractionCounter - read more Explore the search gallery. However, in the rich test results of my suggestion, there are no errors or warning messages from Google:
Probably needs experimentation.

Adding Schema.org 'Brand' in JSON-LD

I have been adding rich snippets to my ecommerce store, and for the most part I have had no problems. For some reason when I go to add in the "brand" that is recommeneded by Google and Google Merchant services I have problems.
I have added this under: http://schema.org/Offer. And by adding it in the script in my header also with no luck.
<script type="application/ld+json" data-resource-group="head_tag" data-resource-code="organization_schema">{
"#context": "http://schema.org",
"#type": "Organization",
"address": {
"#type": "PostalAddress",
"addressLocality": "",
"addressRegion": "",
"addressCountry": "",
"postalCode": "",
"streetAddress": ""
},
"email": "customerservice#domain.com",
"name": "Comany namee",
"telephone": "company number"
},
"brand":{
"#type":"Thing",
"name":"[manufacture_name]"
},
</script>
<meta itemprop="brand" content="[manufacturer_name]" />
"brand":{
"#type":"Thing",
"name":"[manufacture_name]"
},
The second one just simply isn't detected for some reason.
I have code similar to the meta tag throughout the documnet so I would prefer to keep with that format if possible.
Your JSON-LD has syntax errors:
The Organization is closed with },, but the brand property appears after it.
A closing } is missing.
There should be no , after the last }.
So it would be:
{
"#context": "http://schema.org",
"#type": "Organization",
"address": {
"#type": "PostalAddress"
},
"name": "company name",
"brand": {
"#type": "Brand",
"name": "manufacturer name"
}
}
(Note that I used Brand instead of Thing.)

Errors in Google SDTT for Schema.org Product, Offer, and PriceSpecification

I'm new with Schema.org markup, so I've actually come up with the following codes for my real estate markup, and Google testing keep saying I shouldn't use offer for priceSpecification. I'm so lost now.
{
"#context": "http://schema.org/",
"#type": "Product",
"name": "Nodorus - Precinct 17",
"image": "http://www.setiaalam.com.my/images/products/p17/nodorus-c.jpg",
"description": "A distinct modern link residence set amidst award-winning green spans, wetland wonders and multiple amenities. Come home to articulately crafted spaces where architecture and nature's beauty infuse home with fresh chic. Rejoice in this cosy new addition to Setia Alam North.",
"additionalType": "Product",
"Offer": {
"#type": "PriceSpecification",
"priceCurrency": "RM",
"priceSpecification": {
"minPrice": "593000",
"maxPrice": "890000"
},
"availability": "http://schema.org/InStock",
"seller": {
"#type": "Organization",
"name": "S P Setia"
}
}
}
If you want to add an Offer for a Product, you have to use the offers property.
So instead of this (which doesn’t make sense, because Offer is not a property):
{
"#context": "http://schema.org/",
"#type": "Product",
"Offer": {}
}
You have to use this:
{
"#context": "http://schema.org/",
"#type": "Product",
"offers": {}
}
The type of the offers value should be Offer, not PriceSpecification.
The PriceSpecification can be added to the Offer via the priceSpecification property.
So the structure could look like:
{
"#context": "http://schema.org/",
"#type": "Product",
"offers": {
"#type": "Offer",
"priceSpecification": {
"#type": "PriceSpecification"
}
}
}

Warning that "image" and "logo" have wrong values

I've added Schema.org on my blog list with JSON-LD:
{
"#context": "http://schema.org",
"#type": "BlogPosting",
"headline": "Fixer la navigation Off-Canvas sur Foundation",
"image": "https://stephane-richin.s3-eu-central-1.amazonaws.com/S/foundation-website.jpg",
"author": "Stéphane Richin",
"datePublished": "2015-02-03",
"dateModified": "2015-02-03",
"publisher": {
"#type": "Organization",
"name": "Stéphane Richin",
"url": "http://stephane-richin.fr",
"logo" : "http://stephane-richin.fr/images/logo/logo-stephane-richin.svg"
},
"mainEntityOfPage": "True"
}
But, I've 2 warnings on image and logo:
image.itemtype has wrong value
logo.itemtype has wrong value
Do you have any idea why image and logo have wrong values?
Looks like in order to pass the Structured Data Testing Tool you need to use ImageObject as a required property of image and publisher.logo.
From their documentation:
image - ImageObject, required
Your final code will look like:
{
"#context":"http://schema.org",
"#type":"BlogPosting",
"headline":"Fixer la navigation Off-Canvas sur Foundation",
"image": {
"#type": "ImageObject",
"url": "https://google.com/thumbnail1.jpg",
"height": 800,
"width": 800
},
"author": {
"#type": "Person",
"name": "Stéphane Richin"
},
"datePublished":"2015-02-03",
"dateModified":"2015-02-03",
"publisher": {
"#type":"Organization",
"name":"Stéphane Richin",
"url":"http://stephane-richin.fr",
"logo": {
"#type": "ImageObject",
"url": "https://google.com/logo.jpg",
"width": 600,
"height": 60
}
},
"mainEntityOfPage": "True"
}
I also amended it to recognise the author as Person schema.

do type=#id values have to be explicitly typed in JSON-LD?

I'm looking into JSON-LD specifically in combination with schema.org.
one of the Json-LD examples of schema.org/Person struck me as wrong:
{
"#context": "http://schema.org",
"#type": "Person",
"address": {
"#type": "PostalAddress",
"addressLocality": "Seattle",
"addressRegion": "WA",
"postalCode": "98052",
"streetAddress": "20341 Whitworth Institute 405 N. Whitworth"
},
"colleague": [
"http://www.xyz.edu/students/alicejones.html",
"http://www.xyz.edu/students/bobsmith.html"
],
"email": "mailto:jane-doe#xyz.edu",
"image": "janedoe.jpg",
"jobTitle": "Professor",
"name": "Jane Doe",
"telephone": "(425) 123-4567",
"url": "http://www.janedoe.com"
}
What seems wrong to me is that colleague is defined to be of type=Person (see above link), but instead an entity reference (url/text) is supplied.
The proper way to format this seems to be supplying extra info in the #context like so:
{
"#context": {
"#vocab": "http://schema.org/",
"colleague": { "#type": "#id" }
},
"#type": "Person",
"address": {
"#type": "PostalAddress",
"addressLocality": "Seattle",
"addressRegion": "WA",
"postalCode": "98052",
"streetAddress": "20341 Whitworth Institute 405 N. Whitworth"
},
"colleague": [
"http://www.xyz.edu/students/alicejones.html",
"http://www.xyz.edu/students/bobsmith.html"
],
"email": "mailto:jane-doe#xyz.edu",
"image": "janedoe.jpg",
"jobTitle": "Professor",
"name": "Jane Doe",
"telephone": "(425) 123-4567",
"url": "http://www.janedoe.com"
}
Is the example on schema.org (code example 1) indeed incorrect/incomplete, and is code example 2 correct?
Or in general: when referencing instead of embedding entities, is it required to make this explicit (using #type: #id) or, alternatively, is there some implicit notion in the spec that when a value is an URL it's considered to be a reference by #id?
You are right, the example is not 100% correct. The type-coercion to #id is missing. I filed a bug to get this fixed: https://github.com/schemaorg/schemaorg/issues/929