I have a database of people who provide mobile notary services. I decided to go with Service instead of just a Person, because the person provides the service.
<div itemscope itemtype="http://schema.org/Service">
<meta itemprop="serviceType" content="Notary" />
<span itemprop="provider" itemscope itemtype="http://schema.org/person">
<span itemprop="name">Derrick Calhoun</span>
<img itemprop="image" src="/headshots/hs-3246356.jpg" alt="" />
<span itemprop="birthPlace">Omaha, NE</span>
</span>
<span itemprop="telephone">555-555-5555</span>
<meta itemprop="ratingValue" content="4" />
Last time available:<time datetime="2015-05-08T19:30">May 8, 7:30pm</time>
Current Location: <span itemprop="place">Lincoln, NE</span>
</div>
Should the birthPlace be formatted differently?
http://schema.org/birthPlace says that the value expected is a Place. However, Place only shows examples of places with full addresses. I only have a city.
I thought about using addressLocality, however, that is supposed to be used on a PostalAddress, which I do not have.
Should I embed Place under provider like this?
<span itemprop="provider" itemscope itemtype="http://schema.org/person">
<span itemprop="name">Derrick Calhoun</span>
<img itemprop="image" src="/headshots/hs-3246356.jpg" alt="" />
<span itemprop="place" itemscope itemtype="http://schema.org/place">
<span itemprop="addressLocality">Seattle</span>
<span itemprop="addressRegion">WA</span>
</span>
</span>
I think I am confused on the basic structure, parent child. Can anyone shed some epic light on this?
The birthPlace property does expect a Place value, but Place doesn’t need to have a full address. You can provide as much properties of Place as you have/want, and the same goes for the PostalAddress value of its address property (where you could provide a addressLocality property etc.).
If you only have a city, you could use a City value, which is a sub-type of Place (those are listed under "More specific Types"):
<span itemprop="birthPlace" itemscope itemtype="http://schema.org/City">
<span itemprop="name">Omaha</span>
</span>
Note that you are making some errors in your Schema.org use:
Schema.org terms are case-sensitive, so person is not the same as Person. (Schema.org follows the convention of starting properties with a lowercase letter, and types with an uppercase letter.)
There is no place property, so itemprop="place" can’t be right.
itemtype="http://schema.org/place" has to be
itemtype="http://schema.org/Place"
itemtype="http://schema.org/person" has to be
itemtype="http://schema.org/Person"
Related
I have searched stackoverflow and the web and I can't find an direct answer to this question.
On my website I have added the schema information for the price of an item (see below)
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
Adults and over 10 years old Presale– <span itemprop="price" content="10.00">
<span itemprop="priceCurrency" content="USD">
<span itemprop="availability">
<span itemprop="availabilityStarts" content="2017-01-01T00:00">
<span itemprop="availabilityEnds" content="2017-03-17T23:00">
<span itemprop="inventoryLevel" content="10000">
<span itemprop="url" content="http://www.website.com">
$10</span></span></span></span></span></span></span>
</span>
So as you can see, I have a TON of <span > code. I want to try and reduce this.
I have tested the validation of this snippet via W3C and it validated just fine.
What I am curious about is A) is there a better way, and B) can I just reduce to 1 <span> and include all of that in one so it would look like this:
<span itemprop="priceCurrency" content="USD">
<span itemprop="availability" itemprop="availabilityStarts" content="2017-01-01T00:00" itemprop="availabilityEnds" content="2017-03-17T23:00" itemprop="inventoryLevel" content="10000" itemprop="url" content="http://www.website.com">
Or am I trying to cram too much in one area?
In principle, what you did is fine. However, you currently list the itemprop and content attributes many times on this single <span> element. This is invalid HTML.
Instead, I recommend using data-* attributes.
<span data-price="10.00"
data-price-currency="USD"
data-availability="true"
data-availability-starts="2017-01-01T00:00"
data-availability-ends="2017-03-17T23:00"
data-inventory-level="10000"
data-url="http://www.example.com"></span>
Further reading: using data attributes.
I have a page that contains multiple Schema.org Events that have identical properties (name, location, description, etc.). I've figured out how to handle location by doing something like this:
<div itemscope itemtype="http://schema.org/Event">
…
<meta itemprop="location" itemscope itemtype="http://schema.org/Place" itemref="venue-place" />
</div>
<span id="venue-place">
<a href="http://www.example.com/" itemprop="url">
<span itemprop="name">Crystal Ballroom</span>
</a>
<span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">1332 W Burnside St.</span>
<span itemprop="addressLocality">Portland</span>,
<span itemprop="addressRegion">OR</span>
<span itemprop="postalCode">97209</span>
</span>
</span>
However, I can't figure out how to do this for the Event's description. I've done something like this, which makes an empty description appear in the Event in Google's Structured Data Testing Tool:
<div itemscope itemtype="http://schema.org/Event">
…
<meta itemprop="description" itemscope itemref="event-summary" />
</div>
<div id="event-summary">
This is the description text.
</div>
What am I doing wrong?
The itemref attribute allows you to reference properties (itemprop), and it has to be specified on the item (itemscope) these properties should be added to.
So you have to
move itemref="event-summary" to the Event element, and
move itemprop="description" to the element with the description.
<div itemscope itemtype="http://schema.org/Event" itemref="event-summary">
</div>
<div itemprop="description" id="event-summary">
</div>
You would ideally do this for the location, too, because having a meta element without a content attribute is invalid (but this could be fixed by adding an empty attribute), and because you could save one element that way.
<div itemscope itemtype="http://schema.org/Event" itemref="venue-place event-summary">
</div>
<div itemprop="location" itemscope itemtype="http://schema.org/Place" id="venue-place">
</div>
<div itemprop="description" id="event-summary">
</div>
(Note that Google’s Structured Data Testing Tool will use the id value of the Place element to display URIs under #id. I think that’s a bug on their end, so don’t let this confuse you. If you want to get rid of it, you could add an itemid attribute in addition to provide a real/actual URI for the place.)
I'm improving the markup for the Products section of a site of mine by using Microdata. Everything is doing just fine, as the info is being showed in the Google results as expected.
But I think it would be nice to specify a category to a given product. I've searched everywhere and rode every attribute spec found in http://Schema.org/Product but it seems there is nothing there I can use to spec a "Category".
I tried to set itemprop="category" but Google's Rich Snippet Tool gives me this warn: "Page contains property "category" which is not part of the schema.", which is true.
Does anyone knows which property should I use to designate the Category for a Product? Any thoughts on this would be nice.
schema.org/Offer has category property.
A category for the item. Greater signs or slashes can be used to
informally indicate a category hierarchy.
So smth like that will work.
<div itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Kenmore White 17" Microwave</span>
<img src="kenmore-microwave-17in.jpg" alt='Kenmore 17" Microwave' />
<div itemprop="aggregateRating"
itemscope itemtype="http://schema.org/AggregateRating">
Rated <span itemprop="ratingValue">3.5</span>/5
based on <span itemprop="reviewCount">11</span> customer reviews
</div>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span itemprop="price">$55.00</span>
<link itemprop="availability" href="http://schema.org/InStock" />In stock
<span itemprop="category">LargeCategory > SmallCategory</span>
</div>
</div>
OR
Another option is to use data-vocabulary.org which has category property in its Product class. OK for Google, NOT OK for other Search Engines though. But for Google it will work. Smth like that:
<div itemscope itemtype="http://data-vocabulary.org/Product">
<span itemprop="brand">ACME</span> <span itemprop="name">Executive
Anvil</span>
<img itemprop="image" src="anvil_executive.jpg" />
<span itemprop="description">Sleeker than ACME's Classic Anvil, the
Executive Anvil is perfect for the business traveler
looking for something to drop from a height.
</span>
Category: <span itemprop="category" content="Hardware > Tools > Anvils">Anvils</span>
Product #: <span itemprop="identifier" content="mpn:925872">
925872</span>
<span itemprop="review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">
<span itemprop="rating">4.4</span> stars, based on <span itemprop="count">89
</span> reviews
</span>
<span itemprop="offerDetails" itemscope itemtype="http://data-vocabulary.org/Offer">
Regular price: $179.99
<meta itemprop="currency" content="USD" />
$<span itemprop="price">119.99</span>
(Sale ends <time itemprop="priceValidUntil" datetime="2020-11-05">
5 November!</time>)
Available from: <span itemprop="seller">Executive Objects</span>
Condition: <span itemprop="condition" content="used">Previously owned,
in excellent condition</span>
<span itemprop="availability" content="in_stock">In stock! Order now!</span>
</span>
</div>
You can find out more about this vocabulary here.
I don't get it
On http://schema.org/Product there is category mentioned ( under brand ), still in https://developers.google.com/structured-data/testing-tool/ it apears as an error.
Have they added this attribute recently?
I'm setting some Microdata for products sold by 3rd parties. I have the location of the product (as the buyer might want to physically pick it up) and the username of the seller. But all other information is product specific.
Is there was a correct way to specify that a product was located in a specific location or should I just include it and not mark it up with Microdata?
This is my code so far:
<div itemscope itemtype="http://schema.org/Product">
<img itemprop="image" src="ad-image.jpg" />
<span itemprop="name">Name of item</span>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="priceCurrency" content="AUD" />
<span itemprop="price">$19.95</span>
<span itemprop="itemCondition" href="http://schema.org/NewCondition">New</span>
<span itemprop="model">2010</span>
<meta itemprop="availability" href="http://schema.org/InStock" />
</div>
<span itemprop="description">The description....</span>
</div>
Microdata don't allow such markup in its vocabulary. You could specify where the manufacturer is from, but that doesn't seem to help you.
You could of course use a seperate Place item to mark the cordinates. But you wont have the opportunity to use it as a property to the Product item in the way you describe.
You can use the availableAtOrFrom property:
The place(s) from which the offer can be obtained (e.g. store locations).
It takes a Place as value.
Note that it has to be added to the Offer, not the Product.
I am experimenting with microdata in particular the use of schema.org tags. I am trying to describe multiple sports events that may have the same location property.
<!--Sports Events -->
<div itemscope itemtype="http://schema.org/SportsEvent">
<span itemprop="name" style="font-weight:bold;">Event One</span><br />
<meta itemprop="location" content="venue" itemscope itemtype="http://schema.org/Place" itemref="olympicpark" />
<meta itemprop="startDate" content="2011-08-04T10:00">
<meta itemprop="endDate" content="2011-08-04T13:45">
</div>
<div itemscope itemtype="http://schema.org/SportsEvent">
<span itemprop="name" style="font-weight:bold;">Event Two</span><br />
<meta itemprop="location" content="venue" itemscope itemtype="http://schema.org/Place" itemref="olympicpark" />
<meta itemprop="startDate" content="2011-08-04T10:00">
<meta itemprop="endDate" content="2011-08-04T13:45">
</div>
<!--End Events -->
<!--Places -->
<h3>Venues</h3>
<div id="olympicpark">
<a itemprop="url" href="http://www.london2012.com/olympic-park">Olympic Park</a>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">Olympic Park</span>
<span itemprop="addressLocality">Stratford</span>
<span itemprop="addressRegion">London</span>
<span itemprop="postalCode">E20 2ST</span>
</div>
<div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
<meta itemprop="latitude" content="51.54615" />
<meta itemprop="longitude" content="-0.01269" />
</div>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">4</span> stars - based on
<span itemprop="reviewCount">250</span> reviews
</div>
</div>
<!-- End Places -->
The property "location" of each sport event is linked to the "olympic park" place via the itemref property. This seems to be correct, and the google rich snippets tool reports no errors. My only concern is that the rich snippet data shows the location property not pointing directly to the olympicpark but to another item which references it.
This can be seen below:
Item
Type: http://schema.org/sportsevent
name = Event Two
location = Item( 2 )
startdate = 2011-08-04T10:00
enddate = 2011-08-04T13:45
Item 2
Type: http://schema.org/place
Ref to item: Item( olympicpark )
What I would like to see is the microdata reporting "location = Item ( olympicpark )" for each sports event item. I can get this if i change the location to the following
<span itemprop="location" content="venue" itemscope itemtype="http://schema.org/Place" itemref="olympicpark">
If I do this however, then the start date and end date are not used, which I can understand because the span tag does not get closed.
I am going round in circles trying to resolve this, would really appreciate some help if possible. Apologies if this seems confusing, im finding it hard to describe the problem.
Mike
I don't see anything wrong with your original implementation. From what I've read and experienced on my own sites, doing it the way you are is correct to avoid explicitly creating multiple locations nested within each event.
The reason the google rich snippet tool is showing you that is because it needs to convey what type the location is. If it just did location = Item ( olympicpark ) like you desire, you'd be left wondering what type did it recognize Item ( olympicpark) as.
You should probably specify the itemscope and itemtype in your olympicpark div, and use itemid instead of id. Check this: How do I relate items in schema.org?
My only concern is that the rich snippet data shows the location property not pointing directly to the olympicpark but to another item which references it.
Its fully correct, you must not be confused about it: you create with itemprop="location" itemscope itemtype="http://schema.org/Place" an embedded/nested item with own properties, which are correctly shown as properties of item2