How to implement "mainEntityOfPage" to this specific site? - schema.org

Please take a look here: https://developers.google.com/structured-data/testing-tool?url=https%253A%252F%252Fglamourina.net%252Fen%252F
How can I correctly add mainEntityOfPage to this site?
In Google documentation example I see something like this:
<div itemscope itemtype="http://schema.org/NewsArticle">
<meta itemscope itemprop="mainEntityOfPage" itemType="https://schema.org/WebPage" itemid="https://google.com/article"/>
But this is a single author blog. And it features blogPosts.
<article itemscope itemtype="https://schema.org/BlogPosting" class="singlearticles">
Would it be good if I change it like this:
<article itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<meta itemscope itemprop="mainEntityOfPage" itemType="https://schema.org/WebPage" itemid="https://linktoarticle"/>
Not sure if I understand well the mainEntityOfPage usage. I would appreciate if someone can suggest how can I do to this specific case/website. Not generically, because each site can have a different mainEntityOfPage, but I need to know and understand the right implementation for this site.

About Google’s Microdata example
Google’s Microdata example is invalid. If the meta element has the itemprop attribute, the content attribute is required (details).
I described different ways how to specify mainEntityOfPage in Microdata, the most straigtforward one being a link element that creates a URL value (instead of another Microdata item):
<link itemprop="mainEntityOfPage" href="http://example.com/article-1" />
mainEntity
It’s easier to understand the use of mainEntityOfPage if we first look its inverse property, mainEntity.
For a WebPage that contains a BlogPosting, we could have:
<body itemscope itemtype="http://schema.org/WebPage">
<article itemprop="mainEntity" itemscope itemtype="http://schema.org/BlogPosting">
</article>
</body>
This means: There’s a WebPage and a BlogPosting, and the BlogPosting is the "primary entity" described in this WebPage. To denote this especially makes sense if there are more items involved, e.g., a Person describing the author, five more BlogPosting items for related posts, a WebSite item giving some metadata, etc. Thanks to mainEntity/mainEntityOfPage, consumers can learn what the primary/main item on that page is (i.e., what the page stands for).
mainEntityOfPage
The following example with mainEntityOfPage would result in equivalent structured data like the example with mainEntity from above:
<article itemscope itemtype="http://schema.org/BlogPosting">
<div itemprop="mainEntityOfPage" itemscope itemtype="http://schema.org/WebPage">
</div>
</article>
As you can see, the element for the BlogPosting item contains the element for the WebPage item. This is of course rather unusual markup.
But the mainEntityOfPage property does not only expect an (CreativeWork) item as value, it alternatively expects a URL. So instead of providing a WebPage item explicitly, you can provide the URL of the page instead:
<article itemscope itemtype="http://schema.org/BlogPosting">
<link itemprop="mainEntityOfPage" href="http://example.com/article-1" />
</article>
(This is what Google expects, according to their documentation for the Articles Rich Snippet.)
Excursus: URL of page vs. post
Many sites don’t differentiate between the URL for the web page and the URL for the blog post. For these sites it might seem silly to state something like
http://example.com/article-1 (the blog post)
is the 'mainEntityOfPage'
http://example.com/article-1 (the web page)
http://example.com/article-1 (the web page)
has 'mainEntity'
http://example.com/article-1 (the blog post)
But it can be useful anyway (e.g., for choosing which item is the primary one, because the other items won’t have this statement; or for a blank node; etc.).
However, some sites do differentiate (especially for Linked Data), so they might state something like
http://example.com/article-1#this (the blog post)
is the 'mainEntityOfPage'
http://example.com/article-1 (the web page)
http://example.com/article-1 (the web page)
has 'mainEntity'
http://example.com/article-1#this (the blog post)
Here, http://example.com/article-1#this represents the blog posting, and http://example.com/article-1 represents the page with information about this posting (or the content of the posting itself). A clearer example would be a person and a page about this person; or a building and a page about this building. See my answer for an example why you might want to do this. (But, as explained above, you don’t have to differentiate; you can use the same URL for both.)

Related

Offers in Products (schema.org / rich snippets)

I try to optimize the microdata/ schema.org/ rich snippet markup for product pages within some templates we use.
While doing so placed itemprop="offers" itemscope itemtype="http://schema.org/Offer" within a itemscope itemtype="http://data-vocabulary.org/Product"
Which should work according to
https://schema.org/offers
as well as
https://developers.google.com/structured-data/rich-snippets/products
but fails to validate on Google's Structured Data testing tool
Can someone give me some insight on which of the information I should focus?
The 'Offer' delivers some interesting properties I really would like to use within products.
Same goes for isRelatedTo which is mentioned on schema.org but fails to validate.
You are using the Product type and the offers¹ property from the vocabulary Data-Vocabulary.org, and the Offer type from the vocabulary Schema.org. (¹ I don’t know if Data-Vocabulary.org really defined an offers property; most of their site seems to be deleted.)
If you want Google Search to consume your data, you’ll want to use the vocabulary Schema.org.
Schema.org also has a type representing products (Product) and a property for referencing an Offer from a Product (offers).
In Microdata, this could look like:
<article itemscope itemtype="http://schema.org/Product">
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
</div>
</article>

schema.org BusinessFunction - GoodRelations

I want to mark web page with schema.org tags. I can find in the documentation that one can specify a kind o business with using tag: BusinessFunction and tag from GoodRelations.
The problem is I can not find example of it. Because the web page is about software developer I'm going to use tag: http://purl.org/goodrelations/v1#ProvideService.
Can anybody give me an example?
First of all: A related yet bit outdated resource on modeling services with GoodRelations (and thus schema.org) is here: http://www.ebusiness-unibw.org/wiki/GoodRelationsService
This explains the basic pattern. Note that Some GoodRelations elements have slightly different names in schema.org, as listed here: http://wiki.goodrelations-vocabulary.org/Cookbook/Schema.org#Naming_Differences
I plan to update this page and migrate it to the new GoodRelations Cookbook. But this is an open issue and will take me a while.
Now, for your concrete question: The use of
http://purl.org/goodrelations/v1#ProvideService
is fine if the good you offer is providing a certain service.
Here is a full example:
<div itemscope itemtype="http://schema.org/Offer" itemid="#offer">
<div itemprop="name">Web Development Services</div>
<div itemprop="description">We build your Web site....</div>
<link itemprop="businessFunction"
href="http://purl.org/goodrelations/v1#ProvideService" />
<!-- Unit price -->
<div itemscope itemprop="priceSpecification"
itemtype="http://schema.org/UnitPriceSpecification">Price:
<meta itemprop="priceCurrency" content="USD">$
<span itemprop="price">50.00</span> per
<meta itemprop="unitCode" content="HUR"> hour
<time itemprop="validThrough"
datetime="2013-11-30T23:59:59Z"></time>
</div>
<!-- other offer properties follow here -->
...
</div>

how to use schema.org metadata on a review for multiple ratings?

I need to markup the review metadata for a product, but the review will have multiple ratings like service, satisfaction, quality, lifetime etc in the original schema.org documentation for review (http://schema.org/Review) there is only property/field: reviewRating using this i can only use it for one field but i need to provide metadata for all the fields, is there a solution for that?
Thanks.
Actually one property isn't an issue here since it can be used multiple times. There were a lot of discussions around cardinality of schema.org properties. You can dive into details here (issue at open tracker) and here (W3C Wiki page).
I personally follow the rule stated by Guha:
Right now, it is always allowed to have multiple values.
Another part of your question is how to describe different ratings. You can use mechanism of "multiple inheritance" like in "serious" programming language. That is one entity may have several types. In your case one type will be http://schema.org/Rating and another (quality, service, etc) you can get from any external to schema.org vocabulary. E.g., productontology is a good candidate (you can use http://www.productontology.org/id/Quality_philosophy, http://www.productontology.org/id/Customer_service accordingly). With RDFA you can just go with it - language itself provides all the necessary mechanisms to say that. But for microdata (and I bet you're using this one) you need to do "dirty hack" and use additionalType property.
So simple example of what you need is smth like this:
<div itemscope itemtype="http://schema.org/Review">
<span itemprop="name">Not a happy camper</span> -
by <span itemprop="author">Ellie</span>,
<meta itemprop="datePublished" content="2011-04-01">April 1, 2011
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
<meta itemprop="additionalType" content="http://www.productontology.org/id/Quality_philosophy">
<meta itemprop="worstRating" content = "1">
<span itemprop="ratingValue">1</span>/
<span itemprop="bestRating">5</span>stars
</div>
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
<meta itemprop="additionalType" content="http://www.productontology.org/id/Customer_service">
<meta itemprop="worstRating" content = "1">
<span itemprop="ratingValue">5</span>/
<span itemprop="bestRating">5</span>stars
</div>
<span itemprop="description">The lamp burned out and now I have to replace
it. </span>
</div>
And Google validator sees all the data.

Where to define schema.org itemtype for Article type: html, body, or div tag?

I have article pages where the only content on the page is the article. When marking up pages with schema.org microdata, is it best to define the itemscope and itemtype at the very top in the <html> tag? Or in the <body> tag? Or a <div> in the body? Or does it not matter?
Example of defining in <html> tag:
<html lang="en" itemscope itemtype="http://schema.org/Article">
<body>
<div>
<span itemprop="name">How to Tie a Reef Knot</span>
...
</div>
</body>
</html>
Versus a <div> in the body:
<html>
<body>
<div itemscope itemtype="http://schema.org/Article">
<span itemprop="name">How to Tie a Reef Knot</span>
...
</div>
</body>
</html>
Is one better than the other in terms of SEO? It seems like it would be best to define it as close to the top of the page as possible (ie, <html> tag) so the search engine spiders pick it up immediately.
If you inspect this very page, you will find that the html tag does indeed include schema.org metadata
<html itemscope="" itemtype="http://schema.org/QAPage">
Not everyone does this, but stackoverflow is a top 100 website- take that for what its worth.
Obviously, you will want schema.org metadata throughout the page as well.
Doesn't matter, in the sense that either will work and neither is "wrong". Where you put these things depends very much on what information's on your page, and how it's arranged (e.g., some schemas can't go inside certain other ones). However, though it's actually implied, you might want to put WebPage on the body element, be more specific from there on down through your page code.
There's absolutely no difference in terms of SEO, partly because it doesn't matter if the microdata is parsed a fraction of a microsecond earlier, and partly because only a few select bits of microdata are currently used by major search engines (of which Article isn't one), and Google have explicitly stated there's no effect on ranking (yet).
You need to put that on div tag as your article is enclosed under it at the lowest level..so when a search engine spider will crawl your page, it can more appropriately index your article content..
Although your pages contain only articles but still they may contain other portions such as menus, author information, etc.

RDFa with schema.org Blog schema

I'm having trouble figuring out if I've done things right with RDFa and the schema.org Blog type. My blog used to have a list of posts that looked like this:
<h2>Why ORM Divides Us</h2>
<h2>A Heretical Calculus</h2>
In trying to augment it with RDFa information, specifically the Blog and BlogPosting types, I have come up with this:
<div vocab="http://schema.org/" typeof="Blog">
<h2 property="blogPosting" typeof="BlogPosting" resource="essays/why-orm-divides-us.html">
<a property="url" href="essays/why-orm-divides-us.html">
<span property="name">Why ORM Divides Us</span>
</a>
</h2>
<h2 property="blogPosting" typeof="BlogPosting" resource="essays/heretic-calculus.html">
<a property="url" href="essays/heretic-calculus.html">
<span property="name">A Heretical Calculus</span>
</a>
</h2>
...
As far as I can tell with Google Rich Snippets Testing Tool, this looks like it parses right, but I can't really tell. I have two other tries:
<div vocab="http://schema.org/" typeof="Blog">
<h2 property="blogPosting" typeof="BlogPosting" resource="essays/why-orm-divides-us.html">
Why ORM Divides Us
</h2>
<h2 property="blogPosting" typeof="BlogPosting" resource="essays/heretic-calculus.html">
A Heretical Calculus
</h2>
...
<div vocab="http://schema.org/" typeof="Blog" rel="blogPosting">
<h2 typeof="BlogPosting" resource="essays/why-orm-divides-us.html">
<a property="url" href="essays/why-orm-divides-us.html">
<span property="name">Why ORM Divides Us</span>
</a>
</h2>
<h2 typeof="BlogPosting" resource="essays/heretic-calculus.html">
<a property="url" href="essays/heretic-calculus.html">
<span property="name">A Heretical Calculus</span>
</a>
</h2>
...
So I'm asking for several pieces of information:
How do you tell if you've achieved conformance with one of these schemas?
Which one of my alternatives is right, and why?
Why do I seem to need to specify the resource directly when I'm on a link?
Why does the <a> tag parse so differently in the RDFa demo tool and the Google Rich Snippets Testing Tool?
Your first snippet is correct and I'd recommend to use it. The second one is incorrect, as the property="name" will target the href value, so don't use that one. The third one is also correct, and uses a more advanced feature of RDFa called chaining (via the rel attribute). It's perfectly valid to use that one if you prefer, Google understands it too.
I'm not aware of any official schema.org validator, but Google Rich Snippet will sometimes tell you if something is wrong (not always though). You can also validate your HTML + RDFa markup with http://validator.w3.org/nu/ and http://www.w3.org/2012/pyRdfa/Validator.html.
your first and third are correct, the second one is wrong (see above). I'd recommend the first one.
well, the url of the link is used for two purposes, first it is used to identify you object on the web, and it's also explicitly used for the 'url' property that schema.org requires. Although the second is a schema.org specific property.
That's something that Google adds on top of the RDFa syntax itself, a pure RDFa parser would not return the value and href grouped like that. I guess Google does that for convenience, but I agree it can possibly be confusing.