My First Book

From Schema Bib Extend Community Group

First Steps

This is a very simple example of describing a book using Schema.org. Starting with un-marked up HTML, it shows how the Schema Type of Book can be used with both RDFa and Microdata serialisations for this display:

Basic Display
Title: Dune
Author: Frank Herbert
ISBN: 1439501661
Publisher: Paw Prints
Genre: Fiction
Date Published: 2008
Pages: 535
Alternate description: WorldCat.org
HTML
<div>
    Title: Dune<br/> 
    Author: <a href="http://viaf.org/viaf/59083797">Frank Herbert</a><br/>
    ISBN: 1439501661<br/>
    Publisher: Paw Prints<br/>
    Genre: Fiction<br/>
    Date Published: 2008<br/>
    Pages: 535<br/>
    Alternate description: <a href="http://www.worldcat.org/oclc/464251305">WorldCat</a><br/>
</div>


In these examples it is assumed that the description is for an item on this page of a web site: http://example.com/shop/item/1234. The use of the about property in RDFa (itemid in Microdata) is optional, as the address of the web page is assumed to be the identifying URI for the resource. However, it is recommended as good practice to specify the identifier for the resource which is helpful when describing several resources on a single page and moving descriptions around a site

RDFa
<div vocab="http://schema.org/" typeof="Book" resource ="http://example.com/shop/item/1234">
    Title: <span property="name">Dune</span><br/>
    Author: <a property="author" href="http://viaf.org/viaf/59083797">Frank Herbert</a><br/>
    ISBN: <span property="isbn">1439501661</span>
    Publisher: <span property="publisher">Paw Prints</span><br/>
    Genre: <span propert="genre">Fiction</span><br/>
    Date Published: <span property="datePublished">2008</span><br/>
    Pages: <span property="numberOfPages">535</span><br/>
    Alternate description: <a property="sameAs" href="http://www.worldcat.org/oclc/464251305">WorldCat</a><br/>
</div>
Microdata
<div itemscope itemtype="http://schema.org/Book" itemid="http://example.com/shop/item/1234">
    Title: <span itemprop="name">Dune</span><br/>
    Author: <a itemprop="author" href="http://viaf.org/viaf/59083797">Frank Herbert</a><br/>
    ISBN: <span itemprop="isbn">1439501661</span>
    Publisher: <span itemprop="publisher">Paw Prints</span><br/>
    Genre: <span itemprop="genre">Fiction</span><br/>
    Date Published: <span itemprop="datePublished">2008</span><br/>
    Pages: <span itemprop="numberOfPages">535</span><br/>
    Alternate description: <a itemprop="sameAs" href="http://www.worldcat.org/oclc/464251305">WorldCat</a><br/>

</div>


The following description in the RDF Turtle serialisation is provided to show the raw data that would be extracted from the above HTML examples.

Turtle
@prefix schema: <http://schema.org/> .
<http://example.com/shop/item/1234>
   rdf:type schema:Book;
   schema:name "Dune";
   schema:author "Frank Herbert";
   schema:isbn "123456677";
   schema:publisher "Paw Prints";
   schema:genre "Fiction";
   schema:datePublished "2008";
   schema:numberOfPages 535;
   schema:sameAs <http://www.worldcat.org/oclc/464251305>.