It looks like you're offline.
Open Library logo
additional options menu

RDF-XML template for /type/edition

This doc was last edited by Karen Coyle August 31, 2009.

plugin upstream
Templates in the website are disabled now. Editing them will not have any effect on the live website.
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
$def with (book)
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
  xmlns:ol="http://openlibrary.org/type/edition#"
  xmlns:owl='http://www.w3.org/2002/07/owl#'
  xmlns:bibo='http://purl.org/ontology/bibo/'
  xmlns:rdfs='http://www.w3.org/2000/01/rdf-schema#'
  xmlns:rdvocab='http://RDVocab.info/elements/'
  xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
  xmlns:dcterms='http://purl.org/dc/terms/'
  xmlns:dc='http://purl.org/dc/elements/1.1/'
  xmlns:dcam='http://purl.org/dc/dcam/'

>
    $if book.title_prefix:
        $ title = book.title_prefix + " " + book.title
    $else:
        $ title = book.title

    $if book.subtitle:
        $ title = title + " " + book.subtitle
    $else:
        $ title = title

    $ bookID = book.key
    $if book.pagination:
        $ pages = book.pagination
    $else:
        $ pages = book.number_of_pages

    $def display(tag, value):
        $if isinstance(value, list):
            $for x in value:
                <$tag>$x</$tag>
        $elif value:
            <$tag>$value</$tag>

    <rdf:Description rdf:about="http://openlibrary.org$bookID">
    <!-- authors -->
    <bibo:authorList rdf:parseType="Collection">
      $for a in book.authors:
          <rdf:Description rdf:about="http://openlibrary.org$a.key">
             <rdf:value>$a.name</rdf:value>
          </rdf:Description>
    </bibo:authorList>
    $:display("dcterms:contributor", book.contributions)
    <!-- bibliographic description -->
    $:display("dcterms:title", title)
    $:display("dcterms:publisher", book.publishers)
    $:display("rdvocab:placeOfPublication", book.publish_places)
    $:display("dcterms:issued", book.publish_date)
    $:display("dcterms:extent", pages)
    $:display("rdvocab:dimensions", book.physical_dimensions)
    $:display("bibo:edition", book.edition_name)
    <!-- subjects -->
    $:display("dc:subject", book.subjects)
    $if book.dewey_decimal_class:
    $for DDC in book.dewey_decimal_class:   
        <dcterms:subject>
            <rdf:Description>
                <dcam:memberOf rdf:resource="http://purl.org/dc/terms/DDC"/>
                <rdf:value>$DDC</rdf:value>
            </rdf:Description>
        </dcterms:subject>
    $for LCC in book.lc_classifications:
         <dcterms:subject>
            <rdf:Description>
                <dcam:memberOf rdf:resource="http://purl.org/dc/terms/LCC"/>
                <rdf:value>$LCC</rdf:value>
            </rdf:Description>
        </dcterms:subject>
    <!-- description -->
    $:display("dcterms:description", book.description)
    $:display("rdvocab:note", book.notes)
    $for lang in book.languages:
        <dcterms:language>$lang.code</dcterms:language>
    <!-- identifiers -->
    $:display("dcterms:identifier", book.key)
    $:display("bibo:oclcnum", book.oclc_numbers)
    $:display("bibo:lccn", book.lccn)
    $:display("bibo:isbn10", book.isbn_10)
    $:display("bibo:isbn13", book.isbn_13)
    <!-- administrative -->
    $:display("dcterms:modified", book.last_modified)

    </rdf:Description>



</rdf:RDF>