Wikidata:WikiProject Books/Microdata

This is a draft of specification of a Microdata schema in order to embed machine readable bibliographic metadata into wiki pages. It should be used to annotate the HTML outputted by templates with the HTML attributes itemscope, itemprop, itemtype and itemid.

Design choices: use the Schema.org vocabulary as much as possible and match its usages by OCLC and Google.

It is recommended to set the itemid attribute to the Wikidata URI of the described entity (under the format the format http://www.wikidata.org/entity/QXX). The Lua function mw.wikibase.getEntityIdForTitle may be useful for that.

Bibliographic metadata edit

This covers all kind of bibliographic items: works, editions, volumes, articles... Some types are provided but the FRBR level has to be guessed from the presence or not of the http://schema.org/exampleOfWork property.

Possible types (itemtype)
Class URI Description Wikidata mapping (edition level) Wikidata mapping (work level) Wikisource Index pages identifier
http://schema.org/Book A book (Q571) (work or edition) version, edition or translation (Q3331189) creative work (Q17537576) or group of literary works (Q17518870) book if it is a summary page
http://schema.org/Thesis A thesis (work or edition) thesis (Q1266946) for original thesis scanned on ws thesis (Q1266946) phdthesis if it is a summary page
http://schema.org/PublicationVolume An issue of a periodical issue (Q28869365) journal if it is a summary page
http://schema.org/Article An article article (Q191067) journal if it is not a summary page
http://schema.org/Chapter A part of a book (edition) none, should not have a Wikidata item ; but there is chapter (Q1980247) when it exists chapter (Q1980247) book or phdthesis if it is not a summary page
http://schema.org/Collection A collection version, edition or translation (Q3331189) group of literary works (Q17518870) - list of sub-values tinyurl.com/ychjxhsa collection if it is a summary page
http://schema.org/CreativeWork Most general type if no other type applies version, edition or translation (Q3331189) creative work (Q17537576) which also contains non-text works

Some other interesting types are available:

Property URI Description Expected value type Wikidata mapping Wikisource microformat mapping Example
http://schema.org/exampleOfWork The entity the current entity is an edition of http://schema.org/CreativeWork edition or translation of (P629)
<meta itemprop="exampleOfWork" itemscope itemtype="http://schema.org/Book" itemid="http://www.wikidata.org/entity/Q130295" />
http://schema.org/translationOfWork The entity the current entity is a translation of http://schema.org/CreativeWork edition or translation of (P629)
<meta itemprop="translationOfWork" itemscope itemtype="http://schema.org/Book" itemid="http://www.wikidata.org/entity/Q130295" />
http://schema.org/isPartOf The super entity of this entity: e.g. the edition if it is a chapter or a volume, the journal issue if it is a journal... http://schema.org/CreativeWork part of (P361)
<span itemprop="isPartOf" itemscope itemtype="http://schema.org/Book"><link itemprop="mainEntityOfPage" href="http://wikisource.org/MyEdition"></span>
http://schema.org/hasPart The components of this entity: the chapters... http://schema.org/CreativeWork has part(s) (P527)
<span itemprop="hasPart" itemscope itemtype="http://schema.org/Book"><link itemprop="mainEntityOfPage" href="http://wikisource.org/MyEdition/Chapter1"></span>
http://schema.org/mainEntityOfPage URL of the Wikisource page describing the entity URL sitelink
<link itemprop="mainEntityOfPage" href="http://wikisource.org/MyEdition" />
http://schema.org/name Title of the entity. If it is a chapter, it is the title of the chapter monolingual text in the language of the wiki or tagged with the relevant lang attribute label ws-title
<span itemprop="name" lang="fr">A long story</span>
http://schema.org/author Main creator(s) of the element http://schema.org/Person or http://schema.org/Organization author (P50) ws-author
<span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">[[Author:William_Shakespeare|William Shakespeare]]</span><link itemprop="mainEntityOfPage" href="https://en.wikisource.org/wiki/Author:William_Shakespeare"/></span>
http://schema.org/translator Translator(s) of the element http://schema.org/Person or http://schema.org/Organization translator (P655) ws-translator
<span itemprop="translator" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Best translator</span></span>
http://schema.org/illustrator Illustrator(s) of the element http://schema.org/Person or http://schema.org/Organization illustrator (P110) ws-illustrator
<span itemprop="illustrator" itemscope itemtype="http://schema.org/Person"><span itemprop="name">John Doe</span></span>
http://schema.org/editor http://schema.org/Person editor (P98) ws-editor
http://schema.org/publisher Publisher of the element http://schema.org/Organization or http://schema.org/Person publisher (P123) ws-publisher
<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">Big publishing company</span></span>
http://schema.org/datePublished Date of publication point in time publication date (P577) ws-year
<time itemprop="datePublished" datetime="2003-11-24">November 24, 2003</time>
http://schema.org/inLanguage Entity language BCP 47 language code language of work or name (P407)
<meta itemprop="inLanguage" content="fr"/>
http://schema.org/volumeNumber The number of the volume the entity is in string volume (P478) ws-volume
<span itemprop="volumeNumber">3</span>
http://schema.org/pageStart The page on which the entity starts string
<span itemprop="startPage">3</span>
http://schema.org/pageEnd The page on which the entity ends string
<span itemprop="endPage">10</span>
http://schema.org/pagination The range of pages the entity is in. Follows the same formats as the <pages> tag include parameter string page(s) (P304)
<span itemprop="pagination">1-6,33</span>
http://schema.org/previousItem The previous element (e.g. the previous chapter/poem...) http://schema.org/CreativeWork follows (P155)
<span itemprop="previousItem" itemscope itemtype="http://schema.org/Chapter"><link itemprop="mainEntityOfPage" href="http://wikisource.org/MyEdition/Chapter1"></span>
http://schema.org/nextItem The next element (e.g. the next chapter/poem...) http://schema.org/CreativeWork followed by (P156)
<span itemprop="nextItem" itemscope itemtype="http://schema.org/Chapter"><link itemprop="mainEntityOfPage" href="http://wikisource.org/MyEdition/Chapter3"></span>
http://purl.org/library/placeOfPublication[1] Place of publication http://schema.org/Place place of publication (P291) ws-place
<span itemprop="http://purl.org/library/placeOfPublication" itemscope itemtype="http://schema.org/Place"><span itemprop="name">Paris</span></span>

Full example:

<div itemscope itemtype="http://schema.org/Book">
    <link itemprop="mainEntityOfPage" href="https://en.wikisource.org/wiki/The_Wonderful_Wizard_of_Oz"/>
    <h2 itemprop="name">The Wonderful Wizard of Oz</h2>
    <div itemprop="author" itemscope itemtype="http://schema.org/Person" itemid="http://www.wikidata.org/entity/Q207544">
        <link itemprop="mainEntityOfPage" href="https://en.wikisource.org/wiki/Author:Lyman_Frank_Baum"/>
        <span itemprop="name">L. Frank Baum</span>
    </div>
    <div><time itemprop="datePublished" datetime="1900">1900</time></div>
    <meta itemprop="exampleOfWork" itemscope itemtype="http://schema.org/Book" itemid="http://www.wikidata.org/entity/Q130295" />
    <ul>
        <li itemprop="hasPart" itemscope itemtype="http://schema.org/Chapter">
            <link itemprop="mainEntityOfPage" href="https://en.wikisource.org/wiki/The_Wonderful_Wizard_of_Oz/Chapter_1"/>
            <span itemprop="name">Chapter 1: The Cyclone</span>
        </li>
    </ul>
</div>

Footnotes edit

  1. There is no such property in the schema.org vocabulary. We reuse here the extension done by OCLC.