UserComments in test: “dtstart required”, but not part of standard? - html

I put some effort in marking up an ancient message board with schema.org/UserComments microdata. Testing it in WMT yields an error message: Missing required field "dtstart".
Here’s an item, and apart from the table markup, I think it’s all fine:
<tr itemscope itemtype="http://schema.org/UserComments" itemprop="comment">
<td>
<meta content="2013-09-23T17:39:14+01:00" itemprop="commentTime">
<meta content="http://example.com/cmts/?id=321" itemprop="replyToUrl">
<meta content="comment’s title" itemprop="name">
<div itemscope itemtype="http://schema.org/Person" itemprop="creator">
<a itemprop="url" href="http://www.example.com/user/Nickname">
<img itemprop="image" src="http://cdn.example.com/pic.jpg">
<span itemprop="name">Nickname</span>
</div>
</td>
<td>
<p itemprop="commentText">the comment’s actual text</p>
</td>
</tr>
In UserComments, there’s no field named “dtstart”. In a similiar, yet not helpful question, there’s another link to WMT, stating somewhat implicit that startDate and dtstart are synonyms. This does not prove true, at least not for UserComments.
Is it a hitch at Google, so I can disregard it? Am I missing some point (datetime instead of content)?

Your Microdata and Schema.org usage is correct. They don’t define any required properties. So when the Google Structured Data Testing Tool reports "Missing required …" errors, it only means that Google (probably) won’t consider displaying a Rich Snippet when specific properties are missing.
When testing your snippet with a parent item for the comment property, no errors are reported, e.g.:
<article itemscope itemtype="http://schema.org/CreativeWork">
<table>
<!-- your tr here -->
</table>
</article>
Another solution: adding a startDate property (but Google might want to see a date from the future here.)
(The term "dtstart" probably comes from the data-vocabulary.org vocabulary, where Google required this property for the Event Rich Snippet. And Schema.org’s UserComments is also some kind of Event, see notes below.)
If you don’t care about Google’s Rich Snippets, you can keep it like that.
Notes about your snippet:
You might want to use Comment instead of UserComments (because the latter one is an Event, not a CreativeWork).
However, currently, the comment property expects UserComments, but this will most likely change in one of the next Schema.org updates.
For specifying replyToUrl, you must use link instead of meta.

Related

How to implement Schema.org properties in meta data?

Schema.org describes how to implement object properties using the meta tag but the examples given are properties with primitive types such as Text or Boolean. Let's say I want to display a grid of images and each image is of type ImageObject. The copyrightHolder property itself is either an Organization or Person. If I want to include the organization legal name, how would I do that using only meta data?
With "regular" HTML elements I would write:
<span itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<span itemprop="legalName">ACME Inc.</span>
</span>
This obviously doesn't look right:
<meta itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc.">
</meta>
The only thing that comes into mind is using a set of hidden spans or divs.
Using Microdata, if you want to provide structured data that is not visible on the page, you can make use of these elements:
link (with itemprop) for values that are URLs
meta (with itemprop) for values that aren’t URLs
div/span (with itemscope) for items
So your example could look like this:
<div itemscope itemtype="http://schema.org/ImageObject">
<div itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc." />
</div>
</div>
If you want to provide the whole structured data in the head element (where div/span aren’t allowed), see this answer. If you only want to provide a few properties in the head element, you can make use of the itemref attribute.
That said, if you want to provide much data in that hidden way, you might want to consider using JSON-LD instead of Microdata (see a comparison).
I was reading Getting Started again and noticed 2b that states
When browsing the schema.org types, you will notice that many properties have "expected types". This means that the value of the property can itself be an embedded item (see section 1d: embedded items). But this is not a requirement—it's fine to include just regular text or a URL.
So I assume it would be fine to just use
<meta itemprop="copyrightHolder" content="ACME Inc.">

OneNote API (REST) - <div> tags seeem to be stripped during PATCH

Note: using the same PATCH request as defined in Onenote API (REST) - PATCH append - "must include a 'commands'" error when Commands is already supplied (?!)
Each PATCH request is an append operation, and uses the following layout supplied to |HTML| in my code:
<div>
<h1>Hardcoded_Name_ForNow</h1>
<h3>4.345054</h3>
<p>sdfsdfsdf</p>
<img src="name:image-part-name" alt="New binary image" />
</div>
However, when I GET the content of the page (ref: https://jsapi.apiary.io/apis/onenote/reference/get-pages/v10pagesid/get.html?console=1), it turns out like this:
(HEADER OMITTED)
<body data-absolute-enabled="true" style="font-family:Calibri;font-size:11pt">
<div style="width:624px">
<h1 style="font-size:16pt;color:#1e4e79;margin-top:11pt;margin-bottom:11pt">Hardcoded_Name_ForNow</h1>
<h3 style="font-size:12pt;color:#5b9bd5;margin-top:11pt;margin-bottom:11pt">47.77527</h3>
<p>TEST</p>
<img alt="New binary image" width="624" height="353" src="https://www.onenote.com/api/v1.0/resources/0-60a8d03c70a04372ad60cabb8191f86d!1-6C3CB48828A4FCE7!185/$value" data-src-type="image/png" data-fullres-src="https://www.onenote.com/api/v1.0/resources/0-60a8d03c70a04372ad60cabb8191f86d!1-6C3CB48828A4FCE7!185/$value" data-fullres-src-type="image/png" />
<h1 style="font-size:16pt;color:#1e4e79;margin-top:11pt;margin-bottom:11pt">Hardcoded_Name_ForNow</h1>
<h3 style="font-size:12pt;color:#5b9bd5;margin-top:11pt;margin-bottom:11pt">41.16911</h3>
<p>ewqeqweqweqew</p>
<img alt="New binary image" width="624" height="353" src="https://www.onenote.com/api/v1.0/resources/0-9d9ab7935d16464eb826e70dd7fdb3ef!1-6C3CB48828A4FCE7!185/$value" data-src-type="image/png" data-fullres-src="https://www.onenote.com/api/v1.0/resources/0-9d9ab7935d16464eb826e70dd7fdb3ef!1-6C3CB48828A4FCE7!185/$value" data-fullres-src-type="image/png" />
...
</div>
</body>
I know that if I didn't supply a specific target ID, the PATCH request will target the topmost . However, I expected the PATCH request to throw in the layout wholesale without stripping the encapsulator.
Currently working around it by assuming h1, h3, p, img will always be in order, but this is harder to maintain if the tag order changes or new tags are added.
Enabling div id attributes doesn't help, the are simply not there in the first place.
We don't really have a way to store arbitrary containers in OneNote, so we sort of do our best to resynthesize them on demand. Unless they have some meaningful distinguishing data, individual ones can melt away, as you are seeing. Our aim it to get presentation content in and out of the surface rather than to be a high fidelity HTML store.
So that said, if you add a data-id="UniqueFoo" attribute to your , we treat it as semantically meaningful, so we do extra work to reproduce those semantics. The HTML may not be exactly the same, but we should produce the semantic equivalent as far as containment goes, which will likely in this simple case mean your is preserved as you'd expect.
You could use a guid or some such as the data-id attribute for an easy unique value if there's nothing unique in your app that these divs represent.

Represent person/representative or writer/agent relationship with RDFa, schema.org and FOAF

I'm a little confused how to model a writer-agent relationship using RDFa (Lite), schema.org and FOAF. I'm not even sure if I need FOAF.
Let's say I publish a book, me being the writer and represented by an agent. So we have two Persons, one is me and one is the agent. To clarify, my intention is to link the agent as a contact point for the writer, while at the same time indicating that the writer is me, the subject of the page:
<!-- the agent representing me -->
<div resource="/Writecorp/Michael Stern" vocab="http://schema.org/" typeof="Person">
<span property="name">Michael Stern</span>
<div property="memberOf">
<div typeof="Organization">
<span property="name">Writecorp Inc. agency</span>
</div>
</div>
</div>
<!-- the writer, me -->
<div rel="me" vocab="http://schema.org/" typeof="Person">
<link rel="agent" property="contactPoint" href="/Writecorp/Michael Stern" />
<span property="name">H. P. Lovecraft</span>
</div>
The <link> solution I gleaned from https://stackoverflow.com/a/19389163/441662.
When I feed this to the RDFa 1.1 Distiller and Parser, it shows the following output:
#prefix ns1: <http://www.w3.org/ns/rdfa#> .
#prefix ns2: <http://schema.org/> .
<> ns2:me [ a ns2:Person;
ns2:contactPoint </Writecorp/Michael Stern>;
ns2:name "H. P. Lovecraft" ];
ns1:usesVocabulary ns2: .
</Writecorp/Michael Stern> a ns2:Person;
ns2:memberOf """
Writecorp Inc. agency
""";
ns2:name "Michael Stern" .
[] a ns2:Organization;
ns2:name "Writecorp Inc. agency" .
Did it recognize rel="me" properly? It is showing ns1:me, but I can't find anything about it in the referred namespace vocabulary, schema.org. Should I use a FOAF prefix and then use foaf:me? I can't find many examples on that either.
How do I model the agent as a contactPoint relationship? According to schema.org and Google's testing tool, a Person is not allowed to be a contactPoint.
Solution?
One solution proposed further down is to have an entity that is both a ContactPoint and a Person, but Google's validator doesn't seem to like it much.
Another possible solution is to have both agent and writer point to the same ContactPoint resource (see https://stackoverflow.com/a/30055747/441662).
Concerning rel="me", that came from a microformats example and is not possible with schema.org (yet, as #unor states in his answer) or foaf.
/edit 7-5-2015: I raised a GitHub issue for this problem. I'll update this post when I learn more...
While agent is a Schema.org property, its domain is Action (which you don’t seem to intend). And it’s neither a FOAF property nor a registered link type (so it must not be used in HTML5). So I guess you’d have to find an appropriate property instead.
me is a link type, not a Schema.org or FOAF property. But as you are using vocab, the RDFa parser assumes that it’s a property from the default vocabulary (Schema.org, in your case). I’m not sure if you really intend to use it as link type (as you are using in the RDFa-way on non-link elements).
(If the use of link types is intended, a possible solution is to use prefix instead of vocab. This way, unprefixed values of rel are interpreted as link types, prefixed values as properties.)
If using Schema.org, the book would be of type Book. You would be the author of this Book.
You’d have to check the available properties for Book (if the agent is related to your work, not your person) or Person (or Organization if it’s your business) if Schema.org offers a suitable property for specifying your agent. Ah, I missed that the agent should be a ContactPoint. Now, I doubt if Schema.org intended that this type could also refer to organizations or persons, but I guess nothing is stopping you from stating that something is a ContactPoint and an Organization.
Regarding resource (or about): Yes, it’s usually better to provide URIs for your entities instead of using blank nodes. That way, you and others can make statements about these entities, in the same or a different document.
So ideally, you would give every entity an URI (including yourself, different to the document’s URI).
For example, on the web page http://example.com/lovecraft, you could have:
<body prefix="schema: http://schema.org/">
<div typeof="schema:Person" resource="#me"></div>
<div typeof="schema:Organization schema:ContactPoint" resource="#agent"></div>
<div typeof="schema:Book" resource="#book-1"></div>
</body>
Now your URI is http://example.com/lovecraft#me (this represents you, the person, not the page about you), your agent’s organization has the URI http://example.com/lovecraft#agent, your book has the URI http://example.com/lovecraft#book-1.
This allows you to make statements about these, in various ways, e.g.:
<body prefix="schema: http://schema.org/">
<div typeof="schema:Person" resource="#me">
<link property="schema:contactPoint" href="#agent" />
<link property="schema:author" href="#book-1" />
</div>
<div typeof="schema:Organization schema:ContactPoint" resource="#agent"></div>
<div typeof="schema:Book" resource="#book-1"></div>
</body>
To state that the page (http://example.com/lovecraft) is about you (http://example.com/lovecraft#me), you could wait for Schema.org’s mainEntity property (included in the next release), and/or use Schema.org’s about property, and/or use FOAF’s isPrimaryTopicOf property.
One option is to have both agent and writer point to the same ContactPoint resource.
This seems to work somewhat. This allows the proper markdown to format the agent and its contact details and at the same time have the writer point to the agent's contact details. However, this is still not relating the agent properly as a representative for the writer (i.e. don't deal with me, but with my agent). And I'm not sure how machine readers will handle this situation.
<!-- the agent representing me -->
<div resource="/Writecorp/MichaelStern" vocab="http://schema.org/" typeof="Person">
<span property="name">Michael Stern</span>
<link property="contactPoint" href="/Writecorp/MichaelStern#contact" />
<div resource="/Writecorp/MichaelStern#contact" vocab="http://schema.org/" typeof="ContactPoint">
<meta property="name" content="Michael Stern" />
<div>Phone:
<span property="telephone">(540) 961-4469</span>
</div>
<div>
<a property="email" href="mailto:michael.stern#writecorp.inc.agency.com">michael.stern#writecorp.inc.agency.com</a>
</div>
</div>
<div property="memberOf">
<div typeof="Organization">
<span property="name">Writecorp Inc. agency</span>
</div>
</div>
</div>
<!-- the writer, me -->
<div vocab="http://schema.org/" typeof="Person">
<link property="contactPoint" href="/Writecorp/MichaelStern#contact" />
<span property="name">H. P. Lovecraft</span>
</div>
Notice that the name property on ContactPoint is a meta tag instead of a normal span element. This is to prevent double name output, while giving machine readers a way to still populate their data model with a contact point name.
Turtle output in RDFa 1.1 Distiller and Parser:
#prefix ns1: <http://www.w3.org/ns/rdfa#> .
#prefix ns2: <http://schema.org/> .
<> ns1:usesVocabulary ns2: .
</Writecorp/MichaelStern> a ns2:Person;
ns2:contactPoint </Writecorp/MichaelStern#contact>;
ns2:memberOf """
Writecorp Inc. agency
""";
ns2:name "Michael Stern" .
</Writecorp/MichaelStern#contact> a ns2:ContactPoint;
ns2:email <mailto:michael.stern#writecorp.inc.agency.com>;
ns2:name "Michael Stern";
ns2:telephone "(540) 961-4469" .
[] a ns2:Person;
ns2:contactPoint </Writecorp/MichaelStern#contact>;
ns2:name "H. P. Lovecraft" .
[] a ns2:Organization;
ns2:name "Writecorp Inc. agency" .
/edit 7-5-2015: I raised a GitHub issue for this problem. I'll update this post when I learn more...

HTML5 <a> tag as container bad for SEO?

I'm trying to use the <a> tag in HTML5 more as a container as this tag can now have block elements as children, example:
before (valid XHTML 1.1)
<div>
<h3>
article title
</h3>
<p>
text
</p>
<a href="page.html" title="article title" >
<img alt="image">
</a>
<a href="page.html" title="article title" >
read more
</a>
</div>
after (valid HTML5)
<a href="page.html" title="article title" >
<h3>
article title
</h3>
<p>
text
</p>
<img alt="image">
<div>
read more
</div>
</a>
Does this new way of markup have any effects for SEO?
OK, removing pure semantics from your question (which, in my mind, does have a material impact on deciding on implementing your chosen method) and concentrating on pure "SEO" value and impact:
The first example needs to be qualified more, as if we take your example as literal, then you are linking to the same page.html 3 times. Google (specifically) only takes the link anchor value from the 1st link to any page that it comes across, so - the value for the first example is only extracted from that first link. The 2nd link (using an IMG tag with an ALT attribute as the anchor value), and the 3rd link using read more as the anchor value are effectively "ignored". It's important that other signals are used to supplement the first link's true intended value, such as surrounding text, images etc.
The 2nd example (HTML5), wraps all of that semantic/surrounding content up to make the effective 'anchor' value from which search engines will derive the link's intended meaning, and then as a consequence, the meaning of the destination page of the link.
Using an anchor tag as a containing wrapper for content that contains additional emphasis (the H tag), an image and an additional div only increases the difficulty that a search engine has to decipher the intended meaning of the link so it can associate it with the destination page.
Search engines (and Google predominantly) are constantly improving their crawling ability to enable better algorithmic parsing and processing of the HTML. Apart from emphasis signals (which are very low), Google mostly ignores the mark-up. The exception is of course links - so making an effort to simplify the parsing/processing by providing clear signals as to a link's anchor text is the safest way forward. Expecting them to understand all of the differences of HTML3, vs HTML4, vs HTML5 and all of the transitional, strict and other variations of each, is probably expecting too much.
TL;DR
Possibly, but only in terms of true link value.
As far as i know in the second way is not bad in anyway in term of seo But first may be slightly better as the titles,images are more closely linked to link.
Q. But better by how much?
A. May be not too much

Using HTML5+Microdata's <meta> tag in the <body>

I want to specify if the Product is "In Stock" using HTML5+Microdata's <meta> tag using Schema.org.
I am unsure if this is the correct syntax:
<div itemscope itemtype="http://schema.org/Product">
<h2 itemprop="name">Product Name</h2>
<dl itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<dt itemprop="price">$1</dt>
<meta itemprop="availability" itemscope itemtype="http://schema.org/ItemAvailability" itemid="http://schema.org/InStock">
</dl>
</div>
The meta tag can't be used with an itemscope like that. The correct way to express this is through a canonical reference using the link tag:
<div itemscope itemtype="http://schema.org/Product">
<h2 itemprop="name">Product Name</h2>
<dl itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<dt itemprop="price">$1</dt>
<link itemprop="availability" href="http://schema.org/InStock">
</dl>
</div>
I did the same as the OP and got the same thing, where the availability on the testing tool is linked to a sub-item... I was finally able to get it to verify properly with this:
<meta itemprop='availability' content='http://schema.org/InStock'>
Here is the Google structured tool output for the offer:
Item 1
type: http://schema.org/offer
property:
price: Price: $139.00
pricecurrency: USD
availability: http://schema.org/InStock
While it is allowed to use meta (if used for Microdata!) in the body, your example is not correct for several reasons:
The dl element can only contain dt or dd (and script/template) elements. You either have to place the meta inside of dt/dd, or outside of dl (but then you would have to move the itemscope).
The meta element must have a content attribute.
Using itemid for this purpose is not correct, and http://schema.org/ItemAvailability is not a type, so using itemscope+itemtype isn’t correct either.
However, if the itemprop value is a URI, you must use the link element instead of the meta element.
Furthermore, the price value should not contain a currency symbol, and it seems that your dt should actually be a dd (with a dt containing "Price" or something).
So you could use:
<dl itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<dt>Price</dt>
<dd>$<span itemprop="price">1</span> <link itemprop="availability" href="http://schema.org/InStock" /></dd>
</dl>
I made a jsfiddle here: http://jsfiddle.net/dLryX/, then put the output (http://jsfiddle.net/dLryX/show/) into the rich snippets tool.
That came back with:
I believe the syntax is correct, and that the Warning isn't important, as it doesn't have a property, as it's a meta tag.
See under the heading Non-visible content (not sure if this helps):
Google webmaster tools - About microdata
In general, Google won't display content that is not visible to the user. In other words, don't show content to users in one way, and use hidden text to mark up information separately for search engines and web applications. You should mark up the text that actually appears to your users when they visit your web pages.
There are a few exceptions to this guideline. In some situations it can be valuable to provide search engines with more detailed information, even if you don't want that information to be seen by visitors to your page. For example, if a restaurant has a rating of 8.5, users (but not search engines) will assume that the rating is based on a scale of 1–10. In this case, you can indicate this using the meta element, like this:
<div itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating">
Rating: <span itemprop="value">8.5</span>
<meta itemprop="best" content="10" />
</div>
This is an example from schema.org's getting started guide to support #Lawrence's answer.
However, I don't like the use of the link tag inside the body of the page. From MDN:
A link tag can occur only in the head element;
Isn't there a better way of specifying availability using a valid markup?