Adding Schema.org 'Brand' in JSON-LD - schema.org

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

Related

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

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

Gmail event registration mark up not working

I am trying to test gmail event registration email mark up from google dev docs, But it is not adding any event on google calendar.
For testing I am using google app script. I am using my personal gmail ID which contain #gmail.com
Following is the script tag which is validated by Email Markup Tester
<!DOCTYPE html>
<html>
<head>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "E123456789",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "John Smith"
},
"reservationFor": {
"#type": "Event",
"name": "Foo Fighters Concert",
"startDate": "2027-03-06T19:30:00-08:00",
"performer": {
"#type": "Organization",
"name": "The Foo Fighters",
"image": "http://www.amprocktv.com/wp-content/uploads/2027/01/foo-fighters-1-680x383.jpg"
},
"location": {
"#type": "Place",
"name": "AT&T Park",
"address": {
"#type": "PostalAddress",
"streetAddress": "24 Willie Mays Plaza",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94107",
"addressCountry": "US"
}
}
},
"modifiedTime": "2027-05-01T08:00:00-08:00",
"modifyReservationUrl": "http://united.com/modifyreservation.html"
}
</script>
</head>
<body>
<p>Event Reservation Example</p>
</body>
</html>
Please help me to find out where I am making mistake or is there any issue with schema mark up.
Or Do I need to register with google while I am using google app script.

Connecting multiple organizations and websites via JSON-LD schema.org

I'm trying to accomplish machine-understandable relationship descriptions for companies/subsidiaries and their websites. Let's suppose there is one parent company with two subsidiaries, all of which have their own websites. I deploy one Organization script, and one WebSite script per home page.
The parent organization's JSON-LD reads:
<script type="application/ld+json">
{
"#context": "http://www.schema.org",
"#type": "Organization",
"#id": "https://www.parentorg.com/#organization",
"name": "Parent Org",
"legalName": "Parent Org Inc.",
"description": "Description of company",
"foundingDate": "1978",
"logo": "https://www.parentorg.com/images/logo.png",
"image": "https://www.parentorg.com/de/images/outside.jpg",
"url": "https://www.parentorg.com/",
"address": {
"#type": "PostalAddress",
"streetAddress": "Street 110",
"addressLocality": "City",
"postalCode": "XX XXX",
"addressCountry": "XX"
},
"contactPoint": {
"#type": "ContactPoint",
"contactType": "customer support",
"telephone": "+12-345-678-91011",
"email": "contact#parentorg.com"
},
"sameAs": [
"https://twitter.com/parentorg/",
"https://www.instagram.com/parentorg/",
"https://www.youtube.com/user/parentorg/",
"https://plus.google.com/parentorg"
],
"subOrganization": [
{
"#type": "Organization",
"#id": "https://www.subsidiary-one.de/#organization",
"name": "Subsidiary One"
},
{
"#type": "Organization",
"#id": "https://www.subsidiary-two.de/#organization",
"name": "Subsidiary Two"
}
]
}
</script>
The parent's website JSON-LD is:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "WebSite",
"#id": "https://www.parentorg.com/#website",
"url": "https://www.parentorg.com/",
"author": {
"#type": "Organization",
"#id": "https://www.parentorg.com/#organization",
"name": "Parent Org"
}
}
</script>
And now the subsidiaries' organization JSON-LD contain a parentOrganization property:
"parentOrganization": {
"#type": "Organization",
"#id": "https://www.parentorg.com/#organization",
"name": "Parent Org"
}
Would this be a good way to cross-reference those entities? And do I even need to write out the name properties inside subOrganization, parentOrganization, and author, when there are URIs referenced?
Yes, you follow the best practice how to cross-reference entities (by giving each entity an #id that is different from the url).
You don’t have to provide additional properties when referencing entities, so this is fine:
"author": {"#id": "https://www.parentorg.com/#organization"}
"subOrganization": [
{"#id": "https://www.subsidiary-one.de/#organization"},
{"#id": "https://www.subsidiary-two.de/#organization"}
]
"parentOrganization": {"#id": "https://www.parentorg.com/#organization"}
However, this of course requires that consumers fetch the referenced documents. But not all do (probably). So if you want to provide data for those consumers, too, you could add properties in addition to the #id. It could be just one, a few, or even all properties. I think the two from your example are the most important ones:
Providing #type can also be useful for consumers that are capable of fetching documents, as it may allow them to decide whether the referenced resource is of interest to them before fetching it. For example, a consumer might only care about works authored by an Organization, not by a Person.
Providing the name property can be useful for consumers that display the included structured data in some way that benefits from a name/label.

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

Cannot update Google Now card using email

I am trying to test the triggering of a Google Now card from email and then updating the time using the modifiedTime property. Here is my markup of the initial email to trigger the initial Google Now card (It's working):
<html>
<body>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "E123456789",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "Test Person"
},
"reservationFor": {
"#type": "Event",
"name": "Test Event",
"startDate": "2015-05-19T16:00:00-05:00",
"location": {
"#type": "Place",
"name": "Your Home",
"address": {
"#type": "PostalAddress",
"streetAddress": "111 Main Street",
"addressLocality": "Columbus",
"addressRegion": "OH",
"postalCode": "43215",
"addressCountry": "US"
}
}
},
"modifyReservationUrl": "http://www.test.com/testing"
}
</script>
<div>Test Appointment</div>
</body>
</html>
Here is the followup email I'm using to try to update the Google Now card to reflect changes in time (It has no effect):
<html>
<body>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "E123456789",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "Test Person"
},
"reservationFor": {
"#type": "Event",
"name": "Test Event",
"startDate": "2015-05-19T16:00:00-05:00",
"location": {
"#type": "Place",
"name": "Your Home",
"address": {
"#type": "PostalAddress",
"streetAddress": "111 Main Street",
"addressLocality": "Columbus",
"addressRegion": "OH",
"postalCode": "43215",
"addressCountry": "US"
}
}
},
"modifyReservationUrl": "http://www.test.com/testing",
"modifiedTime": "2015-05-19T18:00:00-05:00"
}
</script>
<div>Test Appointment Changed</div>
</body>
</html>
Per the documentation here: https://developers.google.com/gmail/markup/reference/event-reservation#update_a_event I am reading that "You may update a event reservation simply by sending the updated event reservation and setting modifiedTime to the time of the update.", The ONLY difference between the 2 emails is the body of the email and the fact that I am including modifiedTime in the second.
Some extra background info:
1. I have validated my markup here prior to sending: https://www.google.com/webmasters/markup-tester
2. I am using the Gmail Actions sample app to send my test emails: http://gmail-actions.appspot.com/
After looking at the markup in your first email and the followup email, it looks like your startDate properties are identical (2015-05-19T16:00:00-05:00). Your follow up email should have the updated time (2015-05-19T18:00:00-05:00) in the startDate property.
If you check out the description on the documentaiton, the modifiedTime property is where you input when the reservation was last modified and not the actual updated time.