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

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.

Related

Any way to get the tag on a note (not just a page element) via OneNote REST API?

OneNote tags on page elements (e.g. <p>) show up in the HTML content returned via the REST API prefixed with a data-tag=attribute. But if the complete note is tagged, that tag doesn't seem to show up in the returned content.
Or am I missing something?
[EDIT]
Here's a screenshot showing the complete note tagged as 'Important' (star symbol) :
I can't see anything in the returned content that relates to that tag:
<html lang="en-US">
<head>
<title>Didi Chuxing = Jean Liu</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body data-absolute-enabled="true" style="font-family:Calibri;font-size:11pt">
<div style="position:absolute;left:48px;top:67px;width:576px">
<img width="480" height="270" src="https://www.onenote.com/api/v1.0/me/notes/[...]
<br />
<p lang="en-NZ" style="font-size:14pt;margin-top:0pt;margin-bottom:0pt">credit : Fast Company</p>
</div>
</body>
</html>
[EDIT]
This question has led to a UserVoice request for this feature to be added in to the API. Only one vote so far - maybe this mention will get it more ;)
The note-tag you are showing is in the title of the page.
Currently, the OneNote API does not support returning note tags in the title. This is different to note-tags in the body, because the title tag is returned in our API as part of the HTML->head->title - other note-tags are returned within the HTML->body. I believe the right way of representing this information is to add the data-tag attribute to the HTML->head->title element.
I suggest creating a UserVoice item for this feature.
https://onenote.uservoice.com/forums/245490-onenote-developer-apis

How to implement "mainEntityOfPage" to this specific site?

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

Web pages accessible by multiple URLs for SEO reasons

I have a bunch of pages with the following structure:
<html>
<body>
<div id="summary">
</div>
<div id="promotions">
</div>
</body>
</html>
I want these pages to be accessible by both:
/items/one
/items/two
/items/three
And:
/promotional-offers/2014/february/one
/promotional-offers/2014/february/two
/promotional-offers/2014/february/three
/items/... should just open the page. /promotional-offers/2014/february/... should open the page /items/... and go to the anchor #promotions (scroll down to the appropriate div).
/items/one/#promotions
/items/two/#promotions
/items/three/#promotions
I'm not sure though how to set up rewrite rules in web.config to help search engines with indexing my pages and avoid having 'duplicate content'.
I would add a Canonical tag to completely avoid duplicate content, so It won't matter from which page you are showing the same content.
<!--url /promotional-offers/2014/february/one-->
<link rel="canonical" href="http://www.example.com/items/one" />

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.