5

couple questions about metadata in epub3:

  1. is the namespaced opf attribute (opf:file-as="", for example) deprecated?

  2. if so, does anyone know why?

  3. given that it this format is deprecated, what is the correct format for including attributes in the opf namespace?

Oreilly's epub3 best practices declares the following as the correct way to use the property attribute:

<meta refines="#creator" property="file-as">Murakami, Haruki</meta>

but, the namespace is not declared as they suggest in the following paragraph:

You can also use property values, which must include the proper prefix, from any of the reserved vocabularies or any vocabulary for which you’ve declared the prefix:
    <meta property="dcterms:dateCopyrighted">2012</meta>

wouldn't this mean that the following should be the correct implementation?:

<metadata
    xmlns:opf='http://www.idpf.org/2007/opf'
   ... >

<meta refines="#creator" property="opf:file-as">Murakami, Haruki</meta>
  1. is there a comprehensive list of values allowed for the property attribute (role, meta-auth, etc)?

thanks in advance!

2 Answers 2

5

The difference between the suggestions from the source you pointed at is how you define the target element. You should be aware that a lot of the metadata options available in an EPUB 3 can have multiple occurrences.

E.g. 1

<metadata ...>
    ...
    <dc:creator id="author">John Doe</dc:creator>
    <dc:creator id="author1">Jane Doe</dc:creator>
    <meta property="dccreator:file-as">Something</meta>
    ...
</metadata>

The above example is problematic because the meta element is trying to work on the dc:creator element, except there are two of them. Which one does it go for?

E.g 1 - Solution

<metadata ...>
    ...
    <dc:creator id="author">John Doe</dc:creator>
    <dc:creator id="author1">Jane Doe</dc:creator>
    <meta refines="#author" property="file-as">Doe, John</meta>
    <meta refines="#author1" property="file-as">Doe, Jane</meta>
    ...
</metadata>

You should use the refines attribute and the simplified version of the property attribute (e.g. 'file-as') when there is more than one occurrence of the target metadata element. The refines attribute allows you to specify by the id attribute of the target element (which according to specs must be unique).

If you do not specify a refines attribute, and the property attribute doesn't refer specifically to a reserved list of EPUB 3 spec metadata (Dublin Core), then the meta element is deemed to be working on the publication as a whole.

Other Examples

// We only have a single dc:title in our metadata so we can use the extended property attribute in the meta element
<metadata ...>
    ...
    <dc:title id="title">My Book</dc:title>
    <meta property="dctitle:file-as">Book, My</meta>
    ...
</metadata>

// This is only hypothetical, as I'm not sure whether the publication itself would require a 'Metadata Authority' definition.
<metadata ...>
    ...
    <dc:title id="title">My Book</dc:title>
    <meta property="meta-auth">Awesome EPUB Organization</meta>
    ...
</metadata>

EDIT: In regard to what meta::property values are allowed have a look here: Archived from the original on epubzone.org here Also, the latest official IDPF specifications for EPUB Open Container Format may be found here: https://www.w3.org/publishing/epub3/epub-spec.html#sec-core-media-types

2
  • hey thanks for the in-depth reply, it helps sort out some things. just to follow up, though, do you know of any resource that might explain why the change took place? i get that <i/> is deprecated in favour of <em/> in HTML, for example, because the latter is 'more semantic', but i'm not having luck finding out why the IDPF migrated from the opf to dc schema, or if the the opf schema is even still used at all
    – mzmm56
    Oct 29, 2015 at 17:22
  • 1
    @mzmm56 I guess they changed to keep inline with changes in other specs like html and so on. You can still use OPF if you encode your epub according to the 2.0.1 guidelines , and being the older spec it will be openable by more ereaders. However, IDPF have dropped support for 2.0.1 in the hope that everyone will migrate to 3.0, which is a much more versatile beast.
    – Allerion
    Oct 30, 2015 at 15:05
1

I use the following code, which passes epubcheck 4.0.1.

<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/">
    <dc:identifier id="BookId">urn:uuid:00000000-0000-0000-0000-000000000000</dc:identifier>
    <dc:title id="title">Book Title</dc:title>
    <meta refines="#title" property="title-type">main</meta>
    <dc:creator id="author">John Doe</dc:creator>
    <meta refines="#author" scheme="marc:relators" property="role">aut</meta>
    <meta refines="#author" property="file-as">Doe, John</meta>
    <dc:language>en</dc:language>
    <meta name="cover" content="cover.jpg" />
    <meta property="dcterms:modified">2015-10-29T10:10:10Z</meta>
</metadata>

For more information have a look at the official epub3 sample books.

3
  • thanks for this; do you have any insights about the questions above though? i'm not so much concerned with validating a book, rather than implementing the standards correctly
    – mzmm56
    Oct 29, 2015 at 9:56
  • Theoretically, you could use all MARC Relator Terms, however, I don't know any app that'll display roles other than author, contributor and publisher.
    – user4665
    Oct 29, 2015 at 10:11
  • thanks for that, and yeah, it's more of an academic question i guess, i realize the support for rendering metadata in readers isn't great right now
    – mzmm56
    Oct 29, 2015 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.