Mobile app version of vmapp.org
Login or Join
Martha676

: Google Testing Tool reports error on Schema.org "location" I am testing Microdata + Schema.org for an Event but the Google Testing Tool says the location is missing although it's been provided.

@Martha676

Posted in: #GoogleRichSnippetsTool #Microdata

I am testing Microdata + Schema.org for an Event but the Google Testing Tool says the location is missing although it's been provided.

Any idea what I am messing up?

<div itemscope itemtype="http://schema.org/SocialEvent">
<a itemprop="url" href="www.convention-name.org"><div itemprop="name"><strong>Bob's Convention</strong></div>
</a>
<div itemprop="description">blah blah blah blah blah</div>
<div><meta itemprop="startDate" content="2015-05-01:00.000">Starts: 2015-05-01:00.000</div>
<meta itemprop="endDate" content="2015-05-02:00.000">Ends: 2015-05-02:00.000
</div>
<div itemprop="location" itemscope itemtype="http://schema.org/PostalAddress">
<div itemprop="streetAddress">55 street</div>
<div><span itemprop="addressLocality">Nashville</span>, <span itemprop="addressRegion">TN</span></div><div itemprop="postalCode">37225</div>
<div itemprop="addressCountry">usa</div>
</div>

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Martha676

3 Comments

Sorted by latest first Latest Oldest Best

 

@Eichhorn148

Although it says on schema.org that Event.location can be either Place or PostalAddress, the google documentation says otherwise.

Event.location is required and has to be a Place


location: Place, required

A nested schema.org/Place (or more specific subtype, such as schema.org/EventVenue or schema.org/PerformingArtsTheater).


Event.location.address is also required and has to be a PostalAddress


address: PostalAddress, required

The venue's address. You may either provide the whole address as a single string, or provide the separate fields of the address in a nested schema.org/PostalAddress.


So going by your example, the proper format should be (Which currently validates without any red text on Google testing tool):

<div itemscope itemtype="http://schema.org/SocialEvent">
<a itemprop="url" href="www.convention-name.org">
<div itemprop="name"><strong>Bob's Convention</strong></div>
</a>
<div itemprop="description">blah blah blah blah blah</div>
<div>
<meta itemprop="startDate" content="2015-05-01:00.000">
Starts: 2015-05-01:00.000
</div>
<meta itemprop="endDate" content="2015-05-02:00.000">
Ends: 2015-05-02:00.000

<div itemprop="location" itemscope itemtype="http://schema.org/Place">
<div itemprop="name">Unknown Venue</div>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<div itemprop="streetAddress">55 street</div>
<div><span itemprop="addressLocality">Nashville</span>, <span itemprop="addressRegion">TN</span></div>
<div itemprop="postalCode">37225</div>
<div itemprop="addressCountry">usa</div>
</div>
</div>
</div>

10% popularity Vote Up Vote Down


 

@Si4351233

From what I found, Google Structured Data Validation tool doesn't allow you to use PostalAddress for 'location' despite it being allowed by the schema. In here schema.org/location it's specifically said that 'location' can be either Place or PostalAddress.

Given that the Place have attributes 'address' and 'name' and GSDVT is asking for them despite the location being the type PostalAddress I think it's safe to say that it's a bug. If this is not allowed, then the error should be "location cannot be of type PostalAddress". If you actually add 'address' to the type of PostalAddress, GSDVT will make a complain about that one too.

Also, it makes sense to have events that don't have named places of happening.

10% popularity Vote Up Vote Down


 

@Shanna517

You are missing some closing </div> tags. If I correctly interpret your intentions, it should look like this:

<div itemscope itemtype="http://schema.org/SocialEvent">

<a itemprop="url" href="www.convention-name.org"><div itemprop="name"><strong>Bob's Convention</strong></div></a>
<div itemprop="description">blah blah blah blah blah</div>
<div><meta itemprop="startDate" content="2015-05-01:00.000">Starts: 2015-05-01:00.000</div>
<div><meta itemprop="endDate" content="2015-05-02:00.000">Ends: 2015-05-02:00.000</div>

<div itemprop="location" itemscope itemtype="http://schema.org/PostalAddress">
<div itemprop="streetAddress">55 street</div>
<div>
<span itemprop="addressLocality">Nashville</span>,
<span itemprop="addressRegion">TN</span>
</div>
<div itemprop="postalCode">37225</div>
<div itemprop="addressCountry">usa</div>
</div> <!-- /PostalAddress -->

</div> <!-- /SocialEvent -->


Now checking this markup, Google’s Testing Tool will report different errors for PostalAddress:


address: missing and required

name: missing and required

Field location may not be empty.


Adding a name to the PostalAddress item fixes the last two errors, so it leaves you with this strange error: "address: missing and required".

Strange, because PostalAddress can’t have an address property, as I’ve explained in an answer to a similar question on Stack Overflow. My guess: Google’s Testing Tool is bugged.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme