Search code examples
blogssemantic-markupmicrodataschema.org

Preferred approach for marking up a blog with Schema.org


Background/context

As schema.org is relatively new, perhaps this question will promote more discussion than a definitive answer. Either way, hopefully some learning from others' application/experience can be gained.

Having studied the http://schema.org documentation pages – and whilst there seems to be an extensive array of properties (read: itemprop attributes) available to enrich a blog post, there seems to be some inconsistencies and 'grey areas' with regard to the best approach to mark up blog comments. Let me provide an example:

The schema.org documentation for blogs can be found on within Thing > CreativeWork > Blog and for reference, a blog post lives within Thing > CreativeWork > Article > BlogPosting

So far, the documentation and markup examples on the aforementioned pages provide enough reference to format a blog index page, and the bulk of content within an individual post (author, pubDate, articleBody, interactionCount, etc.)

The problem: applying the UserInteraction schema to individual blog comments

It is when we start to look at individual UserInteraction elements (blog comments) within the interactionCount that things get a little vague. The documentation leads us through to Thing > Event > UserInteraction > UserComments, and is described as 'User interaction: A comment about an item.' However all of the suggested properties of UserInteraction are geared towards a physical event.

The only property that appears to be relevant to a blog comment in this schema's documentation is description; which could be used for the comment body. What feels lacking is some specific context for user comments about a blog post. There's also no evidence of example markup for said comments, even a search for 'comments' on the site doesn't seem to yield any clarity.

Has anyone marked up their blog using schema.org – and how did you approach/solve this?

I'll also raise this matter via the schema.org feedback form and update this post if anything comes to light.


Solution

  • Have a look at the examples here http://schema.org/WebPage and notice how the reviews are used for the Books.

    You can do the same for Comments in Article, here's an example:

     <div itemscope itemtype="http://schema.org/Article"> 
    
         <-- Article content -->
    
         <div itemprop="comment" itemscope itemtype="http://schema.org/UserComments">     
           <meta itemprop="discusses" content="A masterpiece of literature" />             
           <span itemprop="creator">John Doe</span>   
           <time itemprop="commentTime" datetime="2011-05-08T19:30">May 8, 7:30pm</time>    
    
           <span itemprop="commentText">I really enjoyed this book. It captures the essential  
           challenge people face as they try make sense of their lives.</span>    
         </div>
    
         <div itemprop="comment" itemscope itemtype="http://schema.org/UserComments">     
           <meta itemprop="discusses" content="A masterpiece of literature" />             
           <span itemprop="creator">John Doe</span>   
           <time itemprop="commentTime" datetime="2011-05-08T19:30">May 8, 7:30pm</time>    
    
           <span itemprop="commentText">I really enjoyed this book. It captures the essential  
           challenge people face as they try make sense of their lives.</span>    
         </div>
    
     </div>