Skip to content

Adding metadata

calebwaldorf edited this page Nov 26, 2019 · 6 revisions

Adding metadata

A metadata.yml file is created for each project after initializing a project with bber new. The metadata in this file is then embedded into each build. (The first time you build a project if no cover image is present, the data used in the metadata file will be used to generate one.)

Editing metadata

b-ber uses the Dublin Core Metadata Element Set (DCMES), which is used by both EPUB 2 and EPUB 3. Terms should be added to the file following the DCMI Terms specification.

A simple sample follows. Please note the duplicated output in the XML, which uses both dc:term and meta refines; this is done to provide compatibility with both EPUB 2 and EPUB 3 reading systems. The full list MARC codes can be found in the MARC Code List for Relators.

Input (YAML)

-
    term: title
    value: Sample Project
    term_property: title-type
    term_property_value: main
-
    term: creator
    value: Author Name
    term_property: role
    term_property_value: aut
-
    term: language
    value: en-US
-
    term: rights
    value: Author Name © 2018
-
    term: identifier
    value: 18106c580620cf201a21530b32e983bb8b595598

Output (XML)

<metadata>
    <dc:title id="_1724372514341b35b7e8b9d0118bbb17a7847b5b">Sample Project</dc:title>
    <meta property="dcterms:title">Sample Project</meta>
    <meta refines="#_1724372514341b35b7e8b9d0118bbb17a7847b5b" property="title-type">main</meta>

    <dc:creator id="_1eb3ad711591d242c9bc1d41482f0ba79488ae1a">Author Name</dc:creator>
    <meta property="dcterms:creator">Author Name</meta>
    <meta refines="#_1eb3ad711591d242c9bc1d41482f0ba79488ae1a" property="role">aut</meta>

    <dc:language id="_5102f04ffcfe482ecd86eac1327d9ff736e00600">en-US</dc:language>
    <meta property="dcterms:language">en-US</meta>

    <dc:rights id="_8bb6065be66629be52d71d42417a69a3817d7c5c">Author Name © 2018</dc:rights>
    <meta property="dcterms:rights">Author Name © 2017</meta>

    <dc:identifier id="uuid">18106c580620cf201a21530b32e983bb8b595598</dc:identifier>
    <meta property="dcterms:identifier">18106c580620cf201a21530b32e983bb8b595598</meta>
</metadata>

Metadata file created when creating a new project

# ==============================================================================
# Project Metadata
# Please see http://dublincore.org/documents/dcmi-terms/ for information on terms
# and usage. TK Please note that additional metadata can be entered and parsed
# if following the outline below.
# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# Title and Description
# ------------------------------------------------------------------------------
- term: title
  value: Project Title
  term_property: title-type
  term_property_value: main

- term: description
  value: Project description.

- term: abstract
  value: Abstract.

# ------------------------------------------------------------------------------
# Contributors
# ------------------------------------------------------------------------------

- term: creator
  value: Last Name, First Name
  term_property: role
  term_property_value: aut

- term: contributor
  value: b-ber
  term_property: role
  term_property_value: mrk

# ------------------------------------------------------------------------------
# Collaborators (editors, developers, designers, researchers, etc.)
# ------------------------------------------------------------------------------

- term: contributor
  value: Last Name, First Name
  term_property: role
  term_property_value: edt

- term: contributor
  value: Last Name, First Name
  term_property: role
  term_property_value: drt

- term: contributor
  value: Last Name, First Name
  term_property: role
  term_property_value: ard
- term: contributor
  value: Last Name, First Name
  term_property: role
  term_property_value: pmn
- term: contributor
  value: Last Name, First Name
  term_property: role
  term_property_value: pmn
- term: contributor
  value: Last Name, First Name
  term_property: role
  term_property_value: prg
- term: contributor
  value: Last Name, First Name
  term_property: role
  term_property_value: dsr
- term: contributor
  value: Last Name, First Name
  term_property: role
  term_property_value: mrk
- term: contributor
  value: Last Name, First Name
  term_property: role
  term_property_value: rtm

# ------------------------------------------------------------------------------
# Publication Information
# ------------------------------------------------------------------------------

- term: language
  value: en-US
- term: rights
  value: © YYYY
- term: format
  value: epub+zip
- term: date
  value: YYYY-MM-DD
- term: publisher
  value: Publisher
- term: tableOfContents
  value: 'Chapter One; Chapter Two; etc.'

# ------------------------------------------------------------------------------
# Additional Metadata
# ------------------------------------------------------------------------------

- term: temporal
  value: time
- term: spatial
  value: Project Title Location
- term: subject
  value: Project Title Subject

# ------------------------------------------------------------------------------
# Cover
# ------------------------------------------------------------------------------
- term: identifier
  value: da8d6eef26106f47c48530a795d177fbb1418552
Clone this wiki locally