Holdings via Offer

From Schema Bib Extend Community Group

Status: Recommended by Schema BibEx (best practice)


Mapping bibliographic holdings to schema.org

This recommendation uses the http://schema.org/Offer class to model bibliographic holdings in schema.org - specifically, those holdings that are available to purchase or borrow. This approach is also used by http://abebooks.com to mark up the used books it has for sale.

In general, use the primary schema.org class (for example, http://schema.org/Book) and then include <link itemprop="additionalType" href="http://schema.org/Product"> to provide access to the Product properties you want to express. Or in RDFa, you can just use both types in the typeof property (for example, typeof="Book Product").

Library holdings

While sellers of bibliographic items have a fairly clear mapping to http://schema.org/Offer, the applicability for libraries is a bit less obvious. Therefore, the following mapping is recommended as a best practice for consistency across library systems. To express individual items that are available to purchase or borrow, use http://schema.org/Offer for each item, map your holding properties as follows:

  • Library = http://schema.org/seller : (Note: 'seller' now been suplemented by the more approporiate http://schema.org/offeredBy property - now recommended to be used) the attribute name is overly specific, but it will be treated by schema.org processors as the organization or individual offering the item; the fact that it may be a loan instead of a sale can be handled as part of the Offer.
  • Call number / shelf number = http://schema.org/sku : the attribute name is overly specific, but the intended role as an inventory identifier and physical locator for a specific organization is a reasonable match for a call number
  • Barcode = http://schema.org/serialNumber : as a unique identifier for a single item, serialNumber is a good match for barcodes.
  • Shelving location = http://schema.org/availableAtOrFrom : ideally, one would use schema's Place::containedIn::Place relationship to identify a location within a given building, but in practice most sites will likely supply a simple text value like "Stacks" or "Reference"
  • Item status = http://schema.org/availability
    • Available for loan:
      <link property="availability" href="http://schema.org/InStock">
    • Checked out:
      <link property="availability" href="http://schema.org/OutOfStock">
    • On order:
      <link property="availability" href="http://schema.org/PreOrder" />
    • Reference:
      <link property="availability" href="http://schema.org/InStoreOnly">
  • Borrowing terms = http://schema.org/businessFunction : the closest match for “loan” is http://purl.org/goodrelations/v1#LeaseOut and this overrides the default value of “for sale”.

Example

 <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <meta itemprop="businessFunction" 
           content="http://purl.org/goodrelations/v1#LeaseOut">
    <div>Library: <span itemprop="offeredBy">Example Branch 1</span></div>
    <div>Call number: <span itemprop="sku">780 B15</span></div>
    <div>Barcode: <span itemprop="serialNumber">123456</span></div>
    <div>Location: <span itemprop="availableAtOrFrom">Stacks</span></div>
    <div>Item status: <span>
        <link itemprop="availability" href="http://schema.org/InStock">
        Available
    </span></div>
 </div>

Consortial system - showing quantities available at each branch

In a consortial system, to show the number of available copies at a given branch or store location, use http://schema.org/AggregateOffer

Example

 <div itemprop="offers" itemscope itemtype="http://schema.org/AggregateOffer">
    <meta itemprop="offerCount" content="28">
    <meta itemprop="seller" content="Example Consortium">
    28 copies at Example Consortium.
    <a href="http://example.com/idshowall/id/foobar">(Show)</a>
 </div>

Minimal example (RDFa)

The cleanest way to surface an Offer is to use the offers property to link the Product to the offer:

 <!-- Uses both the "Book" and "Product" item types to support Offer relationships -->
 <div vocab="http://schema.org/" resource="#record" typeof="Book Product">
   <h3 property="name">Le concerto</h3>
   <table summary="Bibliographic Details">
     <tr>
       <th>Main Author: </th>
       <td property="author">Ferchault, Guy</td>
     </tr>
     <tr>
       <th>Published: </th>
       <td>
         <span property="publisher" typeof="Organization">
           <span property="location">Paris</span> : 
           <span property="name">Presses universitaires de France</span>, 
         </span>
         <span property="datePublished">1978</span>
       </td>
     </tr>
   </table>
   <table summary="Holdings details from Example Bookmobile 1">
     <!-- Example of a copy available for loan -->
     <tr property="offers" typeof="Offer">
       <th>Copy </th>
       <td>Available
         <link property="availability" href="http://schema.org/InStock">
         <div>Library: <span property="seller">Example Bookmobile 1</span></div>
         <div>Barcode: <span property="serialNumber">CONC91000937</span></div>
         <div>Call number: <span property="sku">780 R2</span></div>
         <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
       </td>
     </tr>
     <!-- Example of a copy available for on-site use only -->
     <tr property="offers" typeof="Offer">
       <th>Copy </th>
       <td>On reserve - Ask at Circulation Desk
         <link property="availability" href="http://schema.org/InStoreOnly">
         <div>Library: <span property="seller">Example Bookmobile 1</span></div>
         <div>Barcode: <span property="serialNumber">CONC91000938</span></div>
         <div>Call number: <span property="sku">780 R2</span></div>
         <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
       </td>
     </tr>
     <!-- Example of a copy that is currently checked out -->
     <tr property="offers" typeof="Offer">
       <th>Copy </th>
       <td>Checked out
         <link property="availability" href="http://schema.org/OutOfStock">
         <div>Library: <span property="seller">Example Bookmobile 1</span></div>
         <div>Barcode: <span property="serialNumber">CONC91000939</span></div>
         <div>Call number: <span property="sku">780 R2</span></div>
         <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
       </td>
     </tr>
      <!-- Repeat, one row per holding / Offer -->
   <table>
 </div>

Alternate examples (RDFa)

Some systems may not enable you to easily embed the offers from within the bibliographic details. With RDFa, you can use the @resource attribute to unite the properties of the bibliographic record:

 <!-- Uses both the "Book" and "Product" item types to support Offer relationships -->
 <div vocab="http://schema.org/" resource="#record" typeof="Book Product">
   <h3 property="name">Le concerto</h3>
   <table summary="Bibliographic Details">
     <tr>
       <th>Main Author: </th>
       <td property="author">Ferchault, Guy</td>
     </tr>
   </table>
 </div>

 <!-- Repeat the @resource attribute here to unite the contained markup with the previous @resource of the same value -->
 <table vocab="http://schema.org/" resource="#record" summary="Holdings details from Example Bookmobile 1">
   <!-- Example of a copy available for loan -->
   <tr property="offers" typeof="Offer">
     <th>Copy </th>
     <td>Available
       <link property="availability" href="http://schema.org/InStock">
       <div>Library: <span property="seller">Example Bookmobile 1</span></div>
       <div>Barcode: <span property="serialNumber">CONC91000937</span></div>
       <div>Call number: <span property="sku">780 R2</span></div>
       <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
     </td>
   </tr>
 <table>

Alternately, you can use the itemOffered property to make a reference from the Offer itself back to the Product:

 <!-- Uses both the "Book" and "Product" item types to support Offer relationships -->
 <div vocab="http://schema.org/" resource="#record" typeof="Book Product">
   <h3 property="name">Le concerto</h3>
   <table summary="Bibliographic Details">
     <tr>
       <th>Main Author: </th>
       <td property="author">Ferchault, Guy</td>
     </tr>
   </table>
 </div>

 <table vocab="http://schema.org/" summary="Holdings details from Example Bookmobile 1">
   <!-- Example of a copy available for loan -->
   <tr typeof="Offer">
     <th>Copy </th>
     <td>Available
       <link property="availability" href="http://schema.org/InStock">
       <div>Library: <span property="seller">Example Bookmobile 1</span></div>
       <div>Barcode: <span property="serialNumber">CONC91000937</span></div>
       <div>Call number: <span property="sku">780 R2</span></div>
       <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
       <link property="itemOffered" href="#record">
     </td>
   </tr>
 <table>