2

I'm developing a site for an antiques shop, specialized in rare and ancient books.
Every page for each book will have a description sheet available with several data for the item.

Descriptions generally include:

  • catalog number (wich i guess can be microdata omitted)
  • book name
  • author
  • genre
  • format
  • book size (width-height)
  • pages
  • print year
  • print location
  • description
  • eventual blemishes
  • special notes
  • author biography

the client asked me the possiblity to add more "fields" if needed.

As you can see, some of the data given is very diverse from the given boundaries of the Product and Book schema types (for example print location and book sizes are not listed in the book type, while ofc attributes like genre, author ecc are totally a best fit for the book type).

So as per title:
what should I use to correctly markup with microdata these kind of items in their respective pages?

Even if Book and CreativeWork are indeed the first candidates, many properties are not listed; I see there is a possibility to extend with the additionalType property from the Thing base schema, but wouldnt this excessively confuse the meaning if I cross it with product for example? what is the best way to procede in this case?

Maybe I'm missing something quite obvious, but I can't really decide what's the right thing to do. Also some of the data above maybe is not worth to be listed in microdata for the items descriptions, but I can't really tell.

Any suggestions is very appreciated, thank you!

  • Unfortunately schema.org mark-up is somewhat narrow in scope. This is why I like your question. It is a damned good question! I am not sure what to do either. But there are people who use mark-up a fair amount here so hopefully someone will have some ideas for you. I have a data driven site that there is no mark-up for and that drives me nuts! (not that it was a long trip anyways...) – closetnoc Jul 2 '15 at 3:21
  • Correct me if i am wrong, but aren't schemas intended to make it easy for machines to read your data? Then wouldn't a book app not want any extra data it isn't set up to receive? A human can deduce the meaning of a new field, but what about a computer? – Daniel F Jul 2 '15 at 17:01
  • @DanielF that's pretty much the point, wich lead to this question: "is every data relevant to be marked with microdata?" To me is "yes, IF it's possible to better nail data relevant to a user search". So what is the best way to procede? – Gruber Jul 2 '15 at 20:30
1

An entity (like a book) can have multiple types. Stating that something is a Book and a Product (or in your case maybe IndividualProduct) is possible and can make sense.

However, Microdata has only limited support for multi-typed entities: the spec requires that

  • all types come from the same vocabulary, and that
  • each property is defined for all of the used types.

The first requirement is why Schema.org introduced the additionalType property (it’s only useful to Microdata): it allows to add additional types from other vocabularies; but this does not also allow to use properties from these other vocabularies.

The second requirement is unsolved (and maybe stays like that). Many people just ignore it and use all properties anyway.

Other syntaxes than Microdata (i.e., JSON-LD and RDFa) don’t have these limitations.

  • Thank you, that's quite interesting. Also JSON-LD is already my chose syntax, tho I don't know really how to implement it regarding my issue. You suggested individual product which is interesting but I think "out of scope" in my case since its for "A single, identifiable product instance (e.g. a laptop with a particular serial number)". While indeed some books are unique, in some cases few copies of a rare book are available. How would you implement json related to my question? how would you structure the code? – Gruber Jul 4 '15 at 19:56
  • 1
    @Gruber: Yeah, I had unique books in mind as you listed "eventual blemishes". By using an array, you can provide several values for the same property in JSON-LD (see also example 13 from the JSON-LD spec). – unor Jul 4 '15 at 20:25
  • @Gruber: If you don’t want to go the MTE route (tool/consumer support might not be the best, but I don’t know that, can only guess), you may want to decide to use only one type (in which case Microdata works fine). I think using Book in your case would be the better choice. You can link an Offer (including price etc.) for this book with the offers property. So you don’t really need a Product type at all. – unor Jul 4 '15 at 20:28
  • +1 and thank you for the link on several values, multiple entity is not an issue since JSON will be the preferred syntax. I'll do some tests and hope additionaltype array will be the actual solution! – Gruber Jul 4 '15 at 22:15
1

If the books are given the schema http://schema.org/Book then they inherit all the properties from http://schema.org/CreativeWork and of course http://schema.org/Thing - because Book is a subtype of CreativeWork, and everything is a subtype of Thing. Using http://schema.org/Book gives you isbn, edition, etc from Book, plus award, genre, author, contributor etc from CreativeWork, plus you can use comment and keywords as you choose. Also available using Book is anything inherited for Thing, like description and sameAs.

You can mix in whichever non-schema fields (like book size) that you want without causing a problem with the structured data. It just means that book size (for instance) isn't as likely to be in the snippet and that searching by book size won't improve the page's hits. Blemishes and book size don't seem to be key terms a person is likely to use for searching (compared to say, book name or publication year).

By choosing Book you can fill in the author and then link to the http://schema.org/Person schema to give more information about the author, possibly using sameAs to link to the wikipedia page or another source to uniquely identity the author. Any links like this that you don't wish to display can be hidden with the tag or

For each individual copy of a book you can use offer - which is a property of CreativeWork (and inherited by Book). This allows you to have multiple offers by linking to http://schema.org/Offer - You can represent the condition of the book and Price within Offer.

Examples adapted from http://schema.org/Offer A single book which including book size without schema:

<div itemscope itemtype="http://schema.org/Book">
<img itemprop="image" src="catcher-in-the-rye-book-cover.jpg"
 alt="cover art: red horse, city in background"/>
 <span itemprop="name">The Catcher in the Rye</span>
 <link itemprop="sameAs" href="http://wikipedia.org/Catcher-in-the-Rye">
 Author: <a itemprop="author" href="/author/jd_salinger.html">J.D. Salinger</a>
<span itemprop="numberOfPages">224</span> pages
Publisher: <span itemprop="publisher">Little, Brown, and Company</span>
<meta itemprop="datePublished" content="1991-05-01">May 1, 1991<br>
ISBN-10: <span itemprop="isbn">0316769487</span><br>
Book size: 6 x 8 inches<br>
</div>

A single book with http://schema.org/Offer linked in to give the book's condition and Price.

<div itemscope itemtype="http://schema.org/Book">
<img itemprop="image" src="catcher-in-the-rye-book-cover.jpg"
 alt="cover art: red horse, city in background"/>
 <span itemprop="name">The Catcher in the Rye</span>
 <link itemprop="sameAs" href="http://wikipedia.org/Catcher-in-the-Rye">
 Author: <a itemprop="author" href="/author/jd_salinger.html">J.D. Salinger</a>
<span itemprop="numberOfPages">224</span> pages
Publisher: <span itemprop="publisher">Little, Brown, and Company</span>
<meta itemprop="datePublished" content="1991-05-01">May 1, 1991
ISBN-10: <span itemprop="isbn">0316769487</span>
  <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  Price: <span itemprop="price" content="6.99">$6.99</span>
  <meta itemprop="priceCurrency" content="USD" />
  Condition: <span itemprop="condition">Slightly creased spine</span>
  </div> <!-- marks the end of the Offer schema -->
</div> <!-- marks the end of the Book schema -->

I've found it easier to get the webpage written and add in the schema one by one, eg just add Book, once it works correctly then add Offer, then Author, etc. It only takes a few days after getting google to re-fetch the page before it shows in search results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.