How can you specify the subject matter of a blog post using Wikidata item URIs? - schema.org

I would like to unambiguously describe (by using Wikidata URIs) what the subject matter of a blog post is using Schema.org.
Any pointers on how to do this?

You can use Schema.org’s about property:
The subject matter of the content.
While this property expects a Thing value, it’s possible to provide a URL value.
RDFa examples:
<article typeof="schema:BlogPosting">
<!-- URL value -->
<link property="schema:about" href="http://www.wikidata.org/entity/Q892" />
</article>
<article typeof="schema:BlogPosting">
<!-- Thing value -->
<div property="schema:about" typeof="schema:Person" resource="http://www.wikidata.org/entity/Q892">
<meta property="schema:name" content="J. R. R. Tolkien" />
</div>
</article>

Related

"The property gtin12 is not recognized by Google for an object of type Text"

I read some information from https://schema.org/identifier and https://schema.org/Text.
<div itemprop="identifier" itemtype="http://schema.org/Text" itemscope>
<meta itemprop="gtin12" content="{$product.upc}" />
</div>
Here in https://schema.org/Text property gtin12 is present, but I got this error in Google Schema tester:
The property gtin12 is not recognized by Google for an object of type Text.
Text is a data type. Data types aren’t supposed to be used as types like that.
If you want to add gtin12 to a Product, you don’t need to specify identifier (because gtin12 is a sub-property of identifier) nor Text (in Microdata, the content value is by definition a text value).
<!-- if the gtin12 should not be visible on the page -->
<article itemscope itemtype="http://schema.org/Product">
<meta itemprop="gtin12" content="{$product.upc}" />
</article>
<!-- if the gtin12 should be visible on the page -->
<article itemscope itemtype="http://schema.org/Product">
<p itemprop="gtin12">{$product.upc}</p>
</article>

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

How do I use the 'about' Schema.org property?

I'm trying to markup an article and confused as to how to use the about property (from CreativeWork).
http://schema.org/about
My guess is that it can be used like this...
<p itemprop="about">Short text about the article...</p>
But on schema.org it says that the expected type is Thing so I'm not sure what I should be inserting inside the itemprop="about" tag; I can't find any examples of the about property in use.
Can anyone help and provide an example?
When using Microdata, the syntax would look like:
<p itemprop="about" itemscope itemtype="http://schema.org/Thing">
…
</p>
(Instead of Thing, you could use a more specific type.)
Now you can use properties for this Thing, for example giving it a name, sameAs to link to the corresponding Wikipedia page, and description for a short description:
<p itemprop="about" itemscope itemtype="http://schema.org/Thing">
<span itemprop="description">A <span itemprop="name">Bee</span> is a flying insect.</span>
<link itemprop="sameAs" href="http://en.wikipedia.org/wiki/Bee" />
</p>