"The attribute publisher.itemtype has an invalid value" - schema.org

I'm new to code. I'm trying to add Structured Data code for Google reviews on my contact page:
http://www.catnips.co.uk/in-home-mobile-cat-groomer-feline-behaviourist.html
I am using the reviews from my Google Maps client reviews.
Testing it in Google Structured Data Testing Tool, it says
The attribute publisher.itemtype has an invalid value.
I can't work out what I'm doing wrong.
<div itemprop="review" itemscope itemtype="http://schema.org/Review">
<meta itemprop="author" content="Anita Kelsey">
<strong itemprop="itemreviewed">Mobile Cat Grooming</strong> by Jen Crothers<br />
<strong>My Rating:</strong> <span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><img src="http://www.catnips.co.uk/wp-content/uploads/2014/09/5-stars-356x73.png" alt="5 stars" width="356" height="73" class="alignnone size-medium wp-image-4614" /><meta itemprop="ratingValue" content="5" /><meta itemprop="bestRating" content="5" /></span>
</div>
<span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
Anita was absolutely brilliant with my Persian cat Ernie, who was a wriggly customer at times. She skillfully and gently removed the mats on his coat and gave him a very thorough groom. Brilliant, professional and easily a five star service provided from start to finish.
<meta itemprop="ratingValue" content="5" /><meta itemprop="bestRating" content="5" />

The error is not in the code you provided in your question body, but rather in the JSON-LD. In the Structured Data Testing Tool, you can click on an error to be taken to the line in the code that caused the error. This helps you identify what caused the problem.
The error is informing you that the itemtype you provided for the publisher property is invalid. Whilst schema.org does support the type Person for the publisher property of Article, Google does not. Google only supports Organization, not Person, as the type for the publisher property, as mentioned in the Articles Structured Data page on Google Developers.
                          

You can fix error in settings: Yoast SEO > Search Appearance > Knowledge Graph > Choose Company or Person.

Of course you do! You just don't know it yet. ;) Try using this line:
"publisher":{"id":"http://www.catnips.co.uk/#organization"},

"baseSalary": {
"#type": "MonetaryAmount",
"currency": "EUR",
"value": {
"#type": "QuantitativeValue",
"value": 850,
"unitText": "MONTH"
}
}

Related

JobPosting schema issue: Number is not a known valid target type for the baseSalary property

I'm a little confused about the new JobPosting listing on schema.org, specifically the baseSalary property's expected type.
The docs say that Number is one of the three expected types:
schema JobPosting SS
But when I test the page on Google structured data testing tool I get this warning:
Google warning
stating that 'Number is not a known valid target type for the baseSalary property.'
Nothing weird in the code, just a simple span with the baseSalary itemprop:
<span itemprop="baseSalary">36000</span>
Am I misunderstanding this or missing something?
Cheers
This is not schema.org error. This issue related specifically to google validator & rich snippets recommended properties/guidelines (I agree that an error message does not contribute too much information).
For rich results - Google Required MonetaryAmount as a type for baseSalary (Not number)
"baseSalary": {
"#type": "MonetaryAmount",
"currency": "USD",
"value": {
"#type": "QuantitativeValue",
"value": 40.00,
"unitText": "HOUR"
}
}
Docs & examples:
https://developers.google.com/search/docs/data-types/job-posting
In case someone wants to use HTML elements for the baseSalary instead of ld+json schema:
<span itemprop="baseSalary" itemtype="https://schema.org/MonetaryAmount" itemscope>
<span itemprop="value" itemtype="https://schema.org/QuantitativeValue" itemscope>
<span itemprop="value">30</span>
<span itemprop="unitText">HOUR</span>
</span>
<span itemtype="https://schema.org/salaryCurrency" itemprop="currency">USD</span>
</span>

Google Search Console and Testing Tool giving different errors about best/worst AggregateRating values

On Google Search Console, I'm getting the error missing best and worst rating. But when I tested the link on testing tool, I am getting:
Failed to normalize the rating value.
Your rating value was out of the default range, you must provide best and worst values.
The code is given below:
<h3>Reviews</h3>
<div class="average-rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<p class="rating-title">Average Rating</p>
<div class="rating-box">
<div class="average-value" itemprop="ratingValue">0/5</div>
<div class="review-amount" itemprop="ratingCount">0 rating</div>
</div>
When I change in rating value to
<div class="average-value" itemprop="ratingValue">0/5</div>
or to this
<div class="average-value" itemprop="ratingValue">0/-454545</div>
it gives a warning:
0 rating (The value provided for ratingCount must be an integer.)
How can I solve this?
The min/max attributes are plain HTML attributes, they don’t affect the Microdata (and they can, by the way, not be used on div elements).
In Schema.org, the worst/best rating can be specified with worstRating and bestRating. If you don’t provide these properties, "0" and "5" are assumed.
If you fix the other errors (ratingCount would have to be "0", not "0 rating"; and it might be better to use "0" instead of "0/5" as ratingValue), you could omit worstRating/bestRating. But it’s typically better to be explicit, so you could add:
<meta itemprop="worstRating" content="0" />
<meta itemprop="bestRating" content="5" />
or:
<meta itemprop="worstRating" content="0" />
<span itemprop="ratingValue">0</span>/<span itemprop="bestRating">5</span>

schema.org structured data in visible elements

The two code fragments below will both be invisible for the user, but are parsed well in GSDTT.
<div>
<div itemtype="http://schema.org/WebPage" itemscope>
<div itemprop="mainEntity" itemtype="http://schema.org/Book" itemscope>
<meta itemprop="datePublished" content="2001-01-15" />
<meta itemprop="bookFormat" content="http://schema.org/Paperback" />
<link itemprop="image" href="http://rdf-translator.appspot.com/plato-cover.jpg" />
<meta itemprop="author" content="Plato" />
<meta itemprop="numberOfPages" content="224" />
<meta itemprop="inLanguage" content="English" />
<div itemprop="review" itemtype="http://schema.org/Review" itemscope>
<meta itemprop="name" content="Old is new again" />
<meta itemprop="reviewBody" content="A lovely read." />
<meta itemprop="author" content="O. Talp" />
<meta itemprop="datePublished" content="2001-01-16" />
</div>
</div>
</div>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "WebPage",
"mainEntity":{
"#type": "Book",
"author": "Plato",
"bookFormat": "http://schema.org/Paperback",
"datePublished": "2001-01-15",
"image": "plato-cover.jpg",
"inLanguage": "English",
"numberOfPages": "224",
"review": [
{
"#type": "Review",
"author": "John Doe",
"datePublished": "2001-01-16",
"name": "O. Talp",
"reviewBody": "A lovely read."
}
]
}
}
</script>
Now consider the code below, which contains structured data wich is also visble to users; and it is parsed well in GSDTT:
<div itemtype="http://schema.org/WebPage" itemscope>
<div itemprop="mainEntity" itemtype="http://schema.org/Book" itemscope>
<p itemprop="datePublished" content="2001-01-15">Published: 2001-01-15 </p>
<p itemprop="bookFormat" content="http://schema.org/Paperback" />Format: Paperback </p>
<img itemprop="image" src="https://nl.wikipedia.org/wiki/Plato#/media/File:Plato_Pio-Clemetino_Inv305.jpg" >
<p itemprop="author" content="Plato" >Author: Plato</p>
<p itemprop="numberOfPages" content="224" >Pages: 224</p>
<p itemprop="inLanguage" content="English" >Language: English</p>
<div itemprop="review" itemtype="http://schema.org/Review" itemscope>
<p><strong>Review</strong></p>
<p itemprop="name" content="Old is new again" >Old is nieuw again</p>
<p itemprop="reviewBody" content="A lovely read.">A lovely read.</p>
<p itemprop="author" content="O. Talp">Author: O. Talp</p>
<p itemprop="datePublished" content="2001-01-16">Published: 2001-01-16</p>
</div>
</div>
</div>
I would prefer the last code fragment, because it contains structured data and produces visible output. Nevertheless microdata seems deprecated, or will be sooner or later. What would be best practice to produce structured HTML data that is also visible for users?
Microdata is not deprecated.
WHATWG has it specified as part of their Living HTML spec. W3C has it specified in a Note (with a new plan to publish it as Recommendation).
The Schema.org sponsors (still) support the three syntaxes JSON-LD, Microdata, and RDFa. They have no plans to deprecate any of these.
Consumers of Schema.org data might of course support only a subset of these syntaxes, or other ones. Unless you want to support a consumer that you know doesn’t support Microdata, there is no reason not to use it.
(By the way, the consumer Google recommends to use JSON-LD, but still supports Microdata and RDFa. There is no reason to follow their recommendation if Microdata/RDFa works better for you, unless you have to add it on the client-side with JavaScript).
Each syntax has its advantages and disadvantages (JSON-LD vs. Microdata vs. RDFa).
If you want to mark up your existing content (instead of duplicating the content), you have to use Microdata or RDFa. Either one should be fine for your case (Microdata vs. RDFa).

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"

How to use DSM & Schema.org?

Does anyone know what I would set as the value for the "content" attribute if I'm utilizing the Diagnostic and Statistical Manual of Mental Disorders (DSM)?
<span itemprop="code" itemscope itemtype="http://schema.org/MedicalCode">
<meta itemprop="code" content="305.90"/>
<meta itemprop="codingSystem" content="_______"/>
</span>
Might the codingSystem content value be "DSM-IV", "DSM-4", "DSM4" or "DSM-4"?
Schema.org doesn’t restrict how the value for the codingSystem property should be specified (apart from the recommendation that the value should be Text).
You should use the name/abbreviation that is most widely known. Wikipedia lists it as "DSM-IV", so unless you know better, go with this.
I don’t know anything about this domain, but I think codeValue (which expects Text) is more appropriate than code (which expects another MedicalCode item):
<span itemprop="code" itemscope itemtype="http://schema.org/MedicalCode">
<meta itemprop="codeValue" content="305.90" />
<meta itemprop="codingSystem" content="DSM-4" />
</span>