Proper way to use the 'publisher' property ("The attribute publisher.itemtype has an invalid value.") - schema.org

When I attempt to validate my structured data using Google's Structured Data Testing tool, I get an error:
The attribute publisher.itemtype has an invalid value.
I am getting that on this line:
<meta itemprop="publisher" content="My Real Name Here" />
How do I provide a valid value for this property?

The expected value of the publisher property is another item (Organization or Person).
While Schema.org always allows to provide a string value (like you do), Google might require a certain value type for one of their search features (e.g., an Organization value for their Articles rich result for AMP HTML pages). If you don’t care about (or can’t qualify for) this feature, you can ignore the error in the SDTT.
The problems with using a string value: it’s not clear if the publisher is a person or an organization, and it’s not possible to provide additional data about the publisher.
If you want to provide an item, it could look like:
<div itemprop="publisher" itemscope itemtype="http://schema.org/Person">
<p itemprop="name">NewGuy</p>
</div>
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<p itemprop="name">NewGuy Inc.</p>
</div>

Related

SDTT error: "Service is not a known valid target type for the itemReviewed property"

Using the following HTML+RDFa:
<div vocab="https://schema.org/" typeof="Service">
<meta property="name" content="My Service Name"/>
<div property="description">
For verified ratings of our services, please view our:
<a
href="https://www.capterra.com/link/to/captera"
target="_blank"
>4.9 Star Rating on Capterra</a>
</div>
<div property="aggregateRating" typeof="AggregateRating">
<div>
Capterra Rating:
<span property="ratingValue">4.9</span> out of
<span property="bestRating">5</span> with
<span property="ratingCount">112</span> ratings
</div>
</div>
</div>
This snippet is in my code, but when I test it all in Google's Structured Data Testing Tool, I get the following error:
I'm having trouble accepting this error because (if i'm reading this correctly), according to the Service docs in https://schema.org/, this is a supported property. I'm sure there is a syntax error somewhere or, if I dare touch the sun, Google is wrong.
I ran it through the structured data and it recognized it:
What am I doing wrong here?
You are not doing anything wrong.
On 16th Sep 2019, Google tweaked their rich snippets requirements, wherein the itemReviewed property is now supported only for a very small list of Schema.org types.
As per Google:
While, technically, you can attach review markup to any schema type,
for many types displaying star reviews does not add much value for the
user. With this change, we’re limiting the pool of schema types that
can potentially trigger review rich results in search. Specifically,
we’ll only display reviews with those types (and their respective
subtypes)...
Earlier, CreativeWork, Article, BlogPosting, Service were all supported and there was no error message on the structured data testing tool.
Now, any schema other than the list below will trigger a '_______ is not a known valid target type for the itemReviewed property.' error.
The valid types for the itemReviewed property are:
Book
ListItem
Course
CreativeWorkSeason
CreativeWorkSeries
Episode
Event
Game
HowTo
LocalBusiness
MediaObject
Movie
MusicPlaylist
MusicRecording
Organization
Product
Recipe
SoftwareApplication
Note : There are other schema types that are valid and may not trigger an error message on the testing tool for aggregateRating or itemReviewed. However, from the Google Blog posting, I understand it as 'Even if the schema is valid, stars / rich snippets may not show up for schemas other than those specifically listed.'

Publisher and Name Microdata

In a BlogPosting or an Article if the publisher is a person how to use Schema.org and Microdata?
I could find that answer:
Proper way to use 'publisher' in BlogPosting
<div itemprop="publisher" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Some Name</span>
</div>
But the Google Testing Tool says:
The attribute publisher.itemtype has an invalid value
Perhaps I do not understand well well the answer? How to use publisher if it is a person or if it is the same than the author?
That is the correct way to provide the publisher in case it’s a person.
Unfortunately, most of the time Google’s SDTT reports something as error which isn’t an error with Schema.org/Microdata, but with Google’s requirements for getting one of their rich results.
This seems to be the case here, too: it’s likely an error for the AMP version of the Articles rich result, for which Google only considers organizations (and not persons) as publishers:
publisher
Organization; required (AMP), ignored (non-AMP)
The publisher of the article.
So if the publisher is a person, simply ignore this error.
If the publisher is the same as the author, you can use both properties in the same itemprop attribute:
<div itemprop="author publisher" itemscope itemtype="http://schema.org/Person">

Microdata error: "The property http://xmlns.com/foaf/0.1/name is not recognized by Google"

The way I understand it, the Schema.org type called Product inherits from the type Thing. So why does this:
<meta itemscope="" itemtype="http://schema.org/Product" itemid="https://some.url" itemref="md25" />
<div class="field-item even" itemprop="description http://xmlns.com/foaf/0.1/description">
long description goes here
</div>
<meta itemprop="name http://xmlns.com/foaf/0.1/name" content="Blueair Pro L" id="md25" />
… fail, when I enter it in Google's testing tool?
I get error:
The property http://xmlns.com/foaf/0.1/name is not recognized by Google for an object of type Product.
But description is part of Thing and Product inherits from it. It even shows it on the Schema.org page here.
So why is this error being thrown?
The quoted message is about the property http://xmlns.com/foaf/0.1/name, not about the property http://schema.org/name or http://schema.org/description.
And it doesn’t say that it would be an error (in Microdata, it is valid to use absolute URLs as properties), it just says that Google doesn’t recognize it. Which is not surprising, because Google doesn’t document support for the FOAF vocabulary.
On a side note: You can’t use the meta with itemscope like that. You should use a div (or a more specific) element instead.

Schema.org Microdata markup to distinguish between photos and art

Like many sites, we deliver a lot of imagery on our web site.
Use case: set up labels/refinements in Google Custom Search that aggregate and filter two different classes of image objects. Using Schema.org Microdata markup is very easy and works great, but we want the user to select either
1) PHOTOS: a "photo" is taken by with an instrument -- some kind of camera/lens "machine" that comprises something from "real life"
OR
2) ART: all other images that are creative works by an illustrator/artist: vector art, scans of drawings, scans of paintings, water colors etc.
I can easily determine which is which as our web CMS gets metadata from the database, and drives the content through the pipe and fork dynamic insertion of metadata. Something like
<section class="page-content" role="main" itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
<meta itemprop="image" content="Red Roses" /> #art
and toggle to this if it were a photo
"itemprop="photo" content="Daffodils" # photo
But this is really not doing the job. I would expect to have some property like "imageType" that I could then apply like this
itemprop="imageType" content="photo"
itemprop="imageType" content="art"
But I don't see anything that meets this requirement in Schema.org (my eyes are bleeding from reviewing the hierarchy and still can't find what I need). There is nothing to designate "art" as such.
Any ideas?
I don’t know which features Google Custom Search supports,
but you have the following options with Schema.org and Microdata.
Unless you have to implement it right now, I recommend option b).
a) Propose new Schema.org types/properties
See my answer to another question for links.
b) Wait for an appropriate Schema.org type/property
The next Schema.org release will contain the type VisualArtwork (draft):
A work of art that is primarily visual in character.
It has an artform property (draft) that takes text or an URL as value:
e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, etc.
Caution notice: these are drafts, subject to change!
Update: VisualArtwork and artform got released.
<div itemscope itemtype="http://schema.org/VisualArtwork">
<meta itemprop="artform" content="Painting">
</div>
<div itemscope itemtype="http://schema.org/VisualArtwork">
<meta itemprop="artform" content="Photo">
</div>
c) Use Schema.org’s extension mechanism
The "slash-based" extension mechanism is "outdated", but valid.
<div itemscope itemtype="http://schema.org/ImageObject/Photo"></div>
<div itemscope itemtype="http://schema.org/ImageObject/Art"></div>
I would only use this as a last resort.
d) Use an additional Schema.org type
This does not work for most cases, but it’s possible in your case: Both of your images are ImageObject, and only the photos are Photograph in addition.
The itemtype attribute can have several values as long as they are from the same vocabulary. But note that you could only use properties that are defined for all of the used types.
<div itemscope itemtype="http://schema.org/ImageObject">
<!-- art -->
</div>
<div itemscope itemtype="http://schema.org/ImageObject http://schema.org/Photograph">
<!-- photo -->
</div>
e) Use a type/property from a different vocabulary
If you know/find a vocabulary about your subject/model, you can use the corresponding types as value for Schema.org’s additionalType property:
<section itemscope itemtype="http://schema.org/ImageObject">
<link itemprop="additionalType" href="http://example.com/vocabulary/photo">
</section>
<section itemscope itemtype="http://schema.org/ImageObject">
<link itemprop="additionalType" href="http://example.com/vocabulary/art">
</section>
If you find a suitable property, you may use its URL as value for itemprop:
<section itemscope itemtype="http://schema.org/ImageObject">
<meta itemprop="http://example.com/vocabulary/imageType" content="photo">
</section>
<section itemscope itemtype="http://schema.org/ImageObject">
<meta itemprop="http://example.com/vocabulary/imageType" content="art">
</section>
f) Use your own proprietary property
If you don’t find a suitable vocabulary, you can use your own URL as property:
[…] a proprietary item property name (i.e. one used by the author for private purposes, not defined in a public specification)
(Example like the second one in b).)
#unor
My developer told me (talking to him after I posted this) we can use (to avoid adding another meta line to the document):
<section itemscope itemtype="http://schema.org/ImageObject"> # for art
<section itemscope itemtype="http://schema.org/Photo"> # for photography
From tests I see that Google will actually parse this: its structured data previewer show it is being extracted. (though it's structured data preview may throw an error). As such I could use it in a custom search refinement/label.
But, it seems wrong to me from the schema.org standard -- since both classes of
images:(photos),(paintings,drawings,vector)
are all "ImageObjects"

Proper format for Google Schema?

I've been experimenting with Google Schema and I've looked at a few code generators and they vary in design. The link I'm using for info for these examples: http://schema.org/Book
1) When is it proper to use itemscope itemtype="someSchemeURL.org" or an actual href?
Example:
<div itemprop="author" itemscope itemtype="http://schema.org/Person">
or
<div itemprop="bookFormat" href="http://schema.org/bookFormatType">
The second example isn't even valid HTML since the href attribute isn't accepted on a div.
2) For the example above, is the first column always an itemprop and the second column always the itemscope itemtype?
3) If there is no itemscope itemtype specified, does the itemprop default to the parent itemscope itemtype?
Example:
<div itemscope itemtype="http://schema.org/Book">
<div class="book" itemprop="name"></div>
<div itemprop="author" itemscope itemtype="http://shema.org/Person">
<div class="author" itemprop="name"></div>
</div>
</div>
The .author class will result in the name attributed to "author"
The .book class will result in the name attributed to "book"
So this would mean that although multiple itemprop's have the same name, the itemprop always applies to the parent element, correct?
4) Where is it specified when to use meta, link, span, or div? Or is this left up to preference?
Example:
<div>
<meta itemprop="datePublished" content="2013-07-01">
Some text
</div>
<div>
Some text
<link itemprop="bookFormat" href="http://schema.org/bookFormatType">Ebook
</div>
The second example is invalid, I know, but it's an example from one of the code generators. That specific generator produces invalid code so I know not to use it, but where are they getting their idea to use a link tag (albeit incorrectly)?
These docs can answer almost all of your questions. Maybe you've already seen them but just in case.
Microdata Spec
Getting Started Tutorial at Schema.org
So answers for your questions in order they appear:
1.The first one is correct. The official microdata spec tells us
Microdata is most useful, though, when it is used in contexts where
other authors and readers are able to cooperate to make new uses of
the markup.
For this purpose, it is necessary to give each item a type, such as
"http://example.com/person", or "http://example.org/cat", or
"http://band.example.net/". Types are identified as URLs.
The type for an item is given as the value of an itemtype attribute on
the same element as the itemscope attribute.
Example
<section itemscope itemtype="http://example.org/animals#cat">
<h1 itemprop="name">Hedral</h1>
<p itemprop="desc">Hedral is a male american domestic
shorthair, with a fluffy black fur with white paws and belly.</p>
<img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">
</section>
2.No. Itemprop is used to indicate property of some entity. Itemscope - entity scope. And itemtype - type of the entity. These are different tags with different meaning which can be used separately (at least in theory). What doc says:
At a high level, microdata consists of a group of name-value pairs.
The groups are called items, and each name-value pair is a property.
Items and properties are represented by regular elements.
To create an item, the itemscope attribute is used.
To add a property to an item, the itemprop attribute is used on one of
the item's descendants.
And examples
<div itemscope>
<p>My name is <span itemprop="name">Elizabeth</span>.</p>
</div>
<div itemscope>
<p>My name is <span itemprop="name">Daniel</span>.</p>
</div>
3.Even when itemscope itemtype are specified along with itemprop it is still property of the parent type. In this case this property is entity itself. And you're correct with your example: names will go to different entities. Here is what doc says about processing properties.
The property value of a name-value pair added by an element with an
itemprop attribute is as given for the first matching case in the
following list:
If the element also has an itemscope attribute The value is the item
created by the element.
If the element is a meta element The value is the value of the
element's content attribute, if any, or the empty string if there is
no such attribute.
If the element is an audio, embed, iframe, img, source, track, or
video element The value is the absolute URL that results from
resolving the value of the element's src attribute relative to the
element at the time the attribute is set, or the empty string if there
is no such attribute or if resolving it results in an error.
If the element is an a, area, or link element The value is the
absolute URL that results from resolving the value of the element's
href attribute relative to the element at the time the attribute is
set, or the empty string if there is no such attribute or if resolving
it results in an error.
If the element is an object element The value is the absolute URL that
results from resolving the value of the element's data attribute
relative to the element at the time the attribute is set, or the empty
string if there is no such attribute or if resolving it results in an
error.
If the element is a data element The value is the value of the
element's value attribute, if it has one, or the empty string
otherwise.
If the element is a time element The value is the element's datetime
value.
Otherwise The value is the element's textContent.
The URL property elements are the a, area, audio, embed, iframe, img,
link, object, source, track, and video elements.
4.Left up to preference. There is general advice from search engines - markup consumers
However, as a general rule, you should mark up only the content that
is visible to people who visit the web page and not content in hidden
div's or other hidden page elements.
Schema.org doc gives good overview when usage of hidden elements may make sense.
Many pages can be described using only the itemscope, itemtype, and
itemprop attributes (described in section 1) along with the types and
properties defined on schema.org (described in section 2). However,
sometimes an item property is difficult for a machine to understand
without additional disambiguation. This section describes how you can
provide machine-understandable versions of information when marking up
your pages.
Dates, times, and durations: use the time tag with
datetime
Enumerations and canonical references: use the link tag with
href
Missing/implicit information: use the meta tag with content.
Check this link for details.