webpub-manifest
webpub-manifest copied to clipboard
Metadata links (EPUB parsing)
How should we parse <link rel="cc:license" href="http://creativecommons.org/licenses/by-sa/3.0/"/> (for example).
What is the JSON Schema equivalent? https://github.com/readium/webpub-manifest/blob/master/schema/metadata.schema.json
Complete OPF example (note the <link rel="cc:license" refines="#cover" ... />):
https://github.com/IDPF/epub3-samples/blob/master/30/wasteland/EPUB/wasteland.opf
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xml:lang="en-US" prefix="cc: http://creativecommons.org/ns#">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:identifier id="uid">code.google.com.epub-samples.wasteland-basic</dc:identifier>
<dc:title>The Waste Land</dc:title>
<dc:creator>T.S. Eliot</dc:creator>
<dc:language>en-US</dc:language>
<dc:date>2011-09-01</dc:date>
<meta property="dcterms:modified">2012-01-18T12:47:00Z</meta>
<!-- rights expressions for the work as a whole -->
<dc:rights>This work is shared with the public using the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.</dc:rights>
<link rel="cc:license" href="http://creativecommons.org/licenses/by-sa/3.0/"/>
<meta property="cc:attributionURL">http://code.google.com/p/epub-samples/</meta>
<!-- rights expression for the cover image -->
<link rel="cc:license" refines="#cover" href="http://creativecommons.org/licenses/by-sa/3.0/" />
<link rel="cc:attributionURL" refines="#cover" href="http://en.wikipedia.org/wiki/Simon_Fieldhouse" />
<!-- cover meta element included for 2.0 reading system compatibility: -->
<meta name="cover" content="cover"/>
</metadata>
<manifest>
<item id="t1" href="wasteland-content.xhtml" media-type="application/xhtml+xml" />
<item id="nav" href="wasteland-nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item id="cover" href="wasteland-cover.jpg" media-type="image/jpeg" properties="cover-image" />
<item id="css" href="wasteland.css" media-type="text/css" />
<item id="css-night" href="wasteland-night.css" media-type="text/css" />
<!-- ncx included for 2.0 reading system compatibility: -->
<item id="ncx" href="wasteland.ncx" media-type="application/x-dtbncx+xml" />
</manifest>
<spine toc="ncx">
<itemref idref="t1" />
</spine>
</package>
Related issue: https://github.com/readium/r2-shared-js/issues/16
The parser doc should be updated too: https://github.com/readium/architecture/blob/master/streamer/parser/metadata.md
For <link rel="cc:license" href="http://creativecommons.org/licenses/by-sa/3.0/"/> we could do the following:
- add a Link Object in
links - extend the
relinto a full URI:http://creativecommons.org/ns#license
refines is the problematic part, we don't really have the ability to support this on every metadata or resource listed in the publication.
We can refine a contributor, a publisher, a collection or a series, but we can't do this on resources listed readingOrder or resources.