W3C home > Mailing lists > Public > public-vocabs@w3.org > February 2012

Re: One Book with many offers (was Re: Multiple "Products" per page, one product Title) - a tested solution

From: Aaron Bradley <aaranged@yahoo.com>
Date: Fri, 24 Feb 2012 09:29:26 -0800 (PST)
Message-ID: <1330104566.18972.YahooMailNeo@web161006.mail.bf1.yahoo.com>
To: "Ziarek, Nathan" <NZiarek@asq.org>, Adrian Giurca <giurca@tu-cottbus.de>
Cc: "public-vocabs@w3.org" <public-vocabs@w3.org>
Thanks Adrian and Nathan.  I was wrangling a bit with itemref, but had been declaring it in the wrong place.  The last code looks solid to me too.


> From: "Ziarek, Nathan" <NZiarek@asq.org>
>To: Adrian Giurca <giurca@tu-cottbus.de> 
>Cc: "public-vocabs@w3.org" <public-vocabs@w3.org>; "aaranged@yahoo.com" <aaranged@yahoo.com> 
>Sent: Friday, February 24, 2012 6:46:40 AM
>Subject: Re: One Book with many offers (was Re: Multiple "Products" per  page,  one product Title) - a tested solution
> 
>
>Ah-ha! I had never run across itemref, although I was slowly coming to the realization that we needed some sort of reference to the top-levle book item (as you said).
>
>
>I made one last tweak—removing the wrapping <div itemprop=offers>, moving that property directly to each Offer  scope. The result seems to perform the same in the structured data linter, but it performs much better in the rich snippet tool (Google now parses out the prices) and the Live Microdata tool [1] (offers are now broken down properly; before they were just a string -- if the URL works [2] below is a link directly to the results).
>
>
><body itemscope itemtype="http://schema.org/Book"; id="MyTerribleBook">
>   <h1 itemprop="name">The Catcher in the Rye</h1>
>     <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"; id="Offer1">
>      <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Book"; itemref="MyTerribleBook">
>         <link itemprop="bookFormat" href="http://schema.org/Hardcover"/>Hardcover,
>         <span itemprop="numberOfPages">234</span> pages - 
>      </div>
>      <meta itemprop="priceCurrency" content="USD" />$<span itemprop="price">4.99</span>  
>     </div>
>     <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"; id="Offer2">
>      <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Book"; itemref="MyTerribleBook">
>         <link itemprop="bookFormat" href="http://schema.org/Paperback"/>Softcover,
>         <span itemprop="numberOfPages">321</span> pages - 
>      </div>
>       <meta itemprop="priceCurrency" content="USD" />$<span itemprop="price">2.99</span>
>   </div>
>   <div>by <span itemprop="author">J.D. Salinger</span></div>
>   <div itemprop="bookEdition">2nd Edition</div>
></body>
>
>
>This seems pretty solid.
>
>
>Thoughts?
>
>
>Best,
>Nathan
>
>
>
>
>
>
>
>
>
>
>[1] http://foolip.org/microdatajs/live/
>[2] http://foolip.org/microdatajs/live/?html=%3Cbody%20itemscope%20itemtype%3D%22http%3A%2F%2Fschema.org%2FBook%22%20id%3D%22MyTerribleBook%22%3E%0A%20%20%20%3Ch1%20itemprop%3D%22name%22%3EThe%20Catcher%20in%20the%20Rye%3C%2Fh1%3E%0A%20%20%20%20%20%3Cdiv%20itemprop%3D%22offers%22%20itemscope%20itemtype%3D%22http%3A%2F%2Fschema.org%2FOffer%22%20id%3D%22Offer1%22%3E%0A%20%20%20%20%20%20%3Cdiv%20itemprop%3D%22itemOffered%22%20itemscope%20itemtype%3D%22http%3A%2F%2Fschema.org%2FBook%22%20itemref%3D%22MyTerribleBook%22%3E%0A%20%20%20%20%20%20%20%20%20%3Clink%20itemprop%3D%22bookFormat%22%20href%3D%22http%3A%2F%2Fschema.org%2FHardcover%22%2F%3EHardcover%2C%0A%20%20%20%20%20%20%20%20%20%3Cspan%20itemprop%3D%22numberOfPages%22%3E234%3C%2Fspan%3E%20pages%20-%20%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%20%20%3Cmeta%20itemprop%3D%22priceCurrency%22%20content%3D%22USD%22%20%2F%3E%24%3Cspan%20itemprop%3D%22price%22%3E4.99%3C%2Fspan%3E%20%20%0A%20%20%20%20%2
0%3C%2Fdiv%3E%0A%20%20%20%20%20%3Cdiv%20itemprop%3D%22offers%22%20itemscope%20itemtype%3D%22http%3A%2F%2Fschema.org%2FOffer%22%20id%3D%22Offer2%22%3E%0A%20%20%20%20%20%20%3Cdiv%20itemprop%3D%22itemOffered%22%20itemscope%20itemtype%3D%22http%3A%2F%2Fschema.org%2FBook%22%20itemref%3D%22MyTerribleBook%22%3E%0A%20%20%20%20%20%20%20%20%20%3Clink%20itemprop%3D%22bookFormat%22%20href%3D%22http%3A%2F%2Fschema.org%2FPaperback%22%2F%3ESoftcover%2C%0A%20%20%20%20%20%20%20%20%20%3Cspan%20itemprop%3D%22numberOfPages%22%3E321%3C%2Fspan%3E%20pages%20-%20%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%20%20%20%3Cmeta%20itemprop%3D%22priceCurrency%22%20content%3D%22USD%22%20%2F%3E%24%3Cspan%20itemprop%3D%22price%22%3E2.99%3C%2Fspan%3E%0A%20%20%20%3C%2Fdiv%3E%0A%20%20%20%3Cdiv%3Eby%20%3Cspan%20itemprop%3D%22author%22%3EJ.D.%20Salinger%3C%2Fspan%3E%3C%2Fdiv%3E%0A%20%20%20%3Cdiv%20itemprop%3D%22bookEdition%22%3E2nd%20Edition%3C%2Fdiv%3E%0A%3C%2Fbody%3E%0A
>
>
>On Feb 24, 2012, at 5:19 AM, Adrian Giurca wrote:
>
>Find below an example tested with Rich Snippets:
>>
>><body itemscope itemtype="http://schema.org/Book"; id="MyTerribleBook">
>>   <h1 itemprop="name">The Catcher in the Rye</h1>
>>   <div itemprop="offers">
>>     <div itemscope itemtype="http://schema.org/Offer"; id="Offer1">
>>      <div itemprop="itemOffered" itemscope
    itemtype="http://schema.org/Book"; itemref="MyTerribleBook">
>>         <link itemprop="bookFormat"
    href="http://schema.org/Hardcover"/>Hardcover,
>>         <span itemprop="numberOfPages">234</span> pages
    - 
>>      </div>
>>      <meta itemprop="priceCurrency" content="USD" />$<span
    itemprop="price">4.99</span>  
>>     </div>
>>     <div itemscope itemtype="http://schema.org/Offer"; id="Offer2">
>>      <div itemprop="itemOffered" itemscope
    itemtype="http://schema.org/Book"; itemref="MyTerribleBook">
>>         <link itemprop="bookFormat"
    href="http://schema.org/Paperback"/>Softcover,
>>         <span itemprop="numberOfPages">321</span> pages
    - 
>>      </div>
>>       <meta itemprop="priceCurrency" content="USD"
    />$<span itemprop="price">2.99</span>
>>   </div>
>>  </div>
>>   <div>by <span itemprop="author">J.D.
    Salinger</span></div>
>>   <div itemprop="bookEdition">2nd Edition</div>
>></body>
>>
>>Regards,
>>Adrian Giurca
>>
>>On 2/24/2012 11:30 AM, Adrian Giurca wrote: 
>>The offers must refer exactly to the defined book (in the <body>). As such I don't think  that using itemref can be avoided.
>>>
>>><body itemscope itemtype="http://schema.org/Book"; id="MyTerribleBook">
>>>   <h1 itemprop="name">The Catcher in the Rye</h1>
>>>   <div itemprop="offers" itemscope itemtype="http://schema.org/Offer";>
>>>      <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Book"; itemref="MyTerribleBook">
>>>         <link itemprop="bookFormat" href="http://schema.org/Hardcover">Hardcover, 
>>>         <span itemprop="numberOfPages">234</span>
      pages - 
>>>      </div>
>>>         <meta itemprop="priceCurrency" content="USD"
      />$<span itemprop="price">4.99</span>
>>>   </div>
>>>   <div itemprop="offers" itemscope itemtype="http://schema.org/Offer";>
>>>      <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Book"; itemref="MyTerribleBook">
>>>         <link itemprop="bookFormat" href="http://schema.org/Paperback">Softcover, 
>>>         <span itemprop="numberOfPages">321</span>
      pages - 
>>>      </div>
>>>         <meta itemprop="priceCurrency" content="USD"
      />$<span itemprop="price">2.99</span>
>>>   </div>
>>>   <div>by <span itemprop="author">J.D.
      Salinger</span></div>
>>>   <div itemprop="bookEdition">2nd Edition</div>
>>></body>
>>>
>>>A second issue is with respect of the bookFormat: while it is
      defined by Book  and, as the name is singular,  looks for a unique
      value, the ablove example is about a Book  printed with two
      formats.
>>>
>>>Regards,
>>>Adrian Giurca
>>>
>>>On 2/24/2012 1:31 AM, Ziarek, Nathan wrote: 
>>>That's actually similar to something I started testing, except I placed the Book itemscope inside of the offer. My roughed-in page would look like: <body itemscope itemtype="http://schema.org/Book";> <h1 itemprop="name">The Catcher in the Rye</h1> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer";> <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Book";> <link itemprop="bookFormat" href="http://schema.org/Hardcover">Hardcover,  <span itemprop="numberOfPages">234</span> pages -  </div> <meta itemprop="priceCurrency" content="USD" />$<span itemprop="price">4.99</span> </div> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer";> <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Book";> <link itemprop="bookFormat" href="http://schema.org/Paperback">Softcover,  <span itemprop="numberOfPages">321</span> pages -  </div> <meta itemprop="priceCurrency" content="USD" />$<span
 itemprop="price">2.99</span> </div> <div>by <span itemprop="author">J.D. Salinger</span></div> <div itemprop="bookEdition">2nd Edition</div>
</body> I opted for Book-Offer-Book (vs. your Book-Book-Offer) because Books don't have book itemprop (although I like the use of bookFormat there ... I need to think on it some more). They do have an offer itemprop, and offer item scopes can contain products via the itemOffered prop. Honestly, neither feel right. Mine seems to be creating products with no name; yours makes it difficult to go beyond a single extra itemprop. Would be interested to hear more thoughts on it, if you have them! Best,
Nathan ________________________________________
From: Aaron Bradley [aaranged@yahoo.com]
Sent: Thursday, February 23, 2012 3:41 PM
To: Ziarek, Nathan; public-vocabs@w3.org Subject: Re: Multiple "Products" per page, one product Title Might this syntax work?  It looks pretty good to me on both the Rich Snippets Testing Tool and the Linter (after many, many failures to see the offer properly associated with the format:): <div itemscope itemtype="http://schema.org/Book";> <span itemprop="name">The Catcher in the Rye</span> -
by <a itemprop="author" href="/author/jd_salinger.html">J.D. Salinger</a> <div itemprop="bookFormat" itemscope itemtype="http://schema.org/Book";>
<span itemprop="BookFormatType">Paperback</span>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer";> Price: <span itemprop="price">$6.99</span> <meta itemprop="priceCurrency" content="USD" />
</div>
</div> <div itemprop="bookFormat" itemscope itemtype="http://schema.org/Book";>
<span itemprop="BookFormatType">Hardcover</span>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer";> Price: <span itemprop="price">$16.99</span> <meta itemprop="priceCurrency" content="USD" />
</div>
</div> Though of course, if this syntax is valid (certainly not guaranteeing that:) it would increasingly complicated to add other Book attributes specifically for the types Paperback and Hardcover (e.g. number of pages, ISBN).  Though this does allow you to have a single entry for any of the book's shared attributes (e.g. title, author). I'm glad you brought this up, and I hope others weigh in, because it's an extremely common situation:  a thing may have properties shared by all offers, but specific offers vary according to one or more specific properties of the thing.  A hotel room that has a different price to stay on Saturday than on Wednesday, but is still the same hotel room; a used car that has a different price depending on condition, but is still the same make, model and year; an MP3 player that has different availability based on color, but is still the same make and model of MP3 player; and so on. [1]
 http://www.google.com/webmasters/tools/richsnippets [2] http://linter.structured-data.org/
>>>>From: "Ziarek, Nathan" <NZiarek@asq.org> To: "public-vocabs@w3.org" <public-vocabs@w3.org> Sent: Friday, January 27, 2012 12:36:10 PM
Subject: Multiple "Products" per page, one product Title I'm sure this has already been covered, and would appreciate any pointers to where. I'm proud to report I did search. I'm sad to say my searching skills are sub-par. * * * I have a book page. The <h1> at the top if the book title. Below that is a list of formats (hardcover, softcover, spiral bound) and then, finally, ancillary details like author, ISBN and rating. <h1>Great Book</h1> <!--Formats-->
<div>Hard cover, $30</div>
<div>Softcover, $20</div> <!--Other Data-->
<div>Joe Schmoe</div>
<div>3.5 / 5</div> My confusion is this: I feel as if, semantically, the "Formats" are really the Product or Book object, since they actually represent the good. However, if I scope them as the product, then I'm stuck duplicating Author, title, rating, etc information and hiding it within those DIVs. On the other hand, if I scope the entire page as the book and each format as an Offer, then I seem (?) to miss out on applying the specific book properties (bookFormat, numberOfPages). * * * Am I considering this correctly? Maybe these are just the tradeoffs, but I feel as if I (or MUCH more likely the whole schema.org organization :) am missing a crucial concept in the scoping. Best,
Nate 
-- 
>>>
>>>- Adrian 
>>>Follow Me on Twitter 
>>>Connect on Linkedin 
>>
>
>
>
Received on Friday, 24 February 2012 17:29:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 06:48:59 GMT