Answers.Body: <p>The correct way to include these according to the EPUB 3.2 standard is as follows. For each of the &quot;titles&quot;, you'd include a title element along with a meta element to specify which sort of title it is. Each title element needs its own (arbitrary) unique id, and each meta element will reference that.</p>
  <pre><code>&lt;dc:title id=&quot;t1&quot;&gt;A Dribble of Event Horizon&lt;/dc:title&gt;
  &lt;meta refines=&quot;#t1&quot; property=&quot;title-type&quot;&gt;main&lt;/meta&gt;
  
  &lt;dc:title id=&quot;t2&quot;&gt;When Good Wormholes Go Bad&lt;/dc:title&gt;
  &lt;meta refines=&quot;#t2&quot; property=&quot;title-type&quot;&gt;subtitle&lt;/meta&gt;
  </code></pre>
  <p>The trouble is, of course, that there are only a few recognized <em>title-type</em>s. Those are &quot;main, subtitle, short, collection, edition and expanded&quot;.</p>
  <p><a href="https://www.w3.org/publishing/epub3/epub-packages.html#sec-title-type" rel="nofollow noreferrer">https://www.w3.org/publishing/epub3/epub-packages.html#sec-title-type</a></p>
  <p>But, one might also use &quot;series&quot; and &quot;franchise&quot; and have it be close to the formal spec.</p>
  <pre><code>&lt;dc:title id=&quot;t3&quot;&gt;The Defective Gates Trilogy&lt;/dc:title&gt;
  &lt;meta refines=&quot;#t3&quot; property=&quot;title-type&quot;&gt;series&lt;/meta&gt;
  
  &lt;dc:title id=&quot;t4&quot;&gt;Stargate SG-1&lt;/dc:title&gt;
  &lt;meta refines=&quot;#t4&quot; property=&quot;title-type&quot;&gt;franchise&lt;/meta&gt;
  </code></pre>
  <p>It is also possible to use the schema attribute to specify a new list of title-types, though I still haven't managed to make sense of that yet.</p>
  <p>Additionally, there should probably be a &quot;display-seq&quot; meta element for each title. This tells the app which order to display those titles in. Again, each will reference the title's id directly.</p>
  <pre><code>&lt;dc:title id=&quot;t1&quot;&gt;A Dribble of Event Horizon&lt;/dc:title&gt;
  &lt;meta refines=&quot;#t1&quot; property=&quot;title-type&quot;&gt;main&lt;/meta&gt;
  &lt;meta refines=&quot;#t1&quot; property=&quot;display-seq&quot;&gt;3&lt;/meta&gt;
  
  &lt;dc:title id=&quot;t2&quot;&gt;When Good Wormholes Go Bad&lt;/dc:title&gt;
  &lt;meta refines=&quot;#t2&quot; property=&quot;title-type&quot;&gt;subtitle&lt;/meta&gt;
  &lt;meta refines=&quot;#t2&quot; property=&quot;display-seq&quot;&gt;4&lt;/meta&gt;
  
  &lt;dc:title id=&quot;t3&quot;&gt;The Defective Gates Trilogy&lt;/dc:title&gt;
  &lt;meta refines=&quot;#t3&quot; property=&quot;title-type&quot;&gt;series&lt;/meta&gt;
  &lt;meta refines=&quot;#t3&quot; property=&quot;display-seq&quot;&gt;2&lt;/meta&gt;
  
  &lt;dc:title id=&quot;t4&quot;&gt;Stargate SG-1&lt;/dc:title&gt;
  &lt;meta refines=&quot;#t4&quot; property=&quot;title-type&quot;&gt;franchise&lt;/meta&gt;
  &lt;meta refines=&quot;#t4&quot; property=&quot;display-seq&quot;&gt;1&lt;/meta&gt;
  </code></pre>
  <p>This would make the app think that the full title might be something like <em>Stargate SG-1: The Defective Gates Trilogy, A Dribble of Event Horizon: When Good Wormmholes Go Bad</em>. I don't believe any apps make use of this though, so it's mostly theoretical.</p>
  <p>However, it should be noted that even this doesn't actually specify which book in the trilogy it would be, or group it together with other books that it might belong with.</p>
  <p>To do that, the metadata.opf file will also have to define a collection, and mark the book as a member of it. This is also done with another meta element. As before, the id for these can be arbitrary.</p>
  <pre><code>&lt;meta property=&quot;belongs-to-collection&quot; id=&quot;c01&quot;&gt;The Defective Gates Trilogy&lt;/meta&gt;
  &lt;meta refines=&quot;#c01&quot; property=&quot;collection-type&quot;&gt;series&lt;/meta&gt;
  </code></pre>
  <p>The only proper values for collection-type are &quot;series&quot; and &quot;set&quot;. Series is pretty much what you'd think it is, and &quot;set&quot; is for those books which would be sold all at once. Think encyclopedias, or &quot;boxed sets&quot;. I really don't see the point of the latter, since at least with ebooks, publishers seem likely to just sell them as omnibus editions where everything is in a single file. Note that these values might also be extended with a custom &quot;scheme&quot;, hypothetically. If you can figure that out.</p>
  <p>Also, such a book as the question asked might reasonably belong to two collections, the second being a &quot;franchise&quot;... but series seems incorrect for that, since such a book rarely belongs in a specific order or sequence within the greater collection of the franchise books. Agatha Christie's stuff comes to mind, where there were many Miss Marple or Poirot books, but they weren't intended to be read in any particular order.</p>
  <p>To specify which book of the trilogy, you add a <em>group-position</em>.</p>
  <pre><code>&lt;meta property=&quot;belongs-to-collection&quot; id=&quot;c01&quot;&gt;The Defective Gates Trilogy&lt;/meta&gt;
  &lt;meta refines=&quot;#c01&quot; property=&quot;collection-type&quot;&gt;series&lt;/meta&gt;
  &lt;meta refines=&quot;#c01&quot; property=&quot;group-position&quot;&gt;2&lt;/meta&gt;
  </code></pre>
  <p>Note: This is a fictitious book. I have and never will write Stargate SG-1 fan fiction, and if I did they would have better titles.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-12T16:53:38.600Z
Answers.LastActivityDate: 2021-07-12T16:53:38.600Z
Answers.UserDisplayName: John O
Answers.Body: <p>Calibre allows you to edit metadata, though I don't know if it's just that stored in Calibre's database, as opposed to that in the .epub file itself.</p>
  <p>However, there are word processors, e.g., free <a href="https://www.libreoffice.org/" rel="nofollow noreferrer">LibreOffice's <em>Writer</em></a>, that can create .epub documents and edit the metadata using an extension, such as <a href="https://extensions.libreoffice.org/en/extensions/show/writer2epub" rel="nofollow noreferrer">Writer2ePub</a>. <em>Writer</em> itself, without that extension, <a href="https://help.libreoffice.org/6.1/en-US/text/shared/01/ref_epub_export.html" rel="nofollow noreferrer">can export to .epub and can edit metadata</a>, but apparently <a href="https://oscollege.com/2018/08/06/libreoffice-new-epub-feature-a-step-in-the-right-direction/" rel="nofollow noreferrer">omits images</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-09T01:35:22.763Z
Answers.Text: I believe that Calibre stores the metadata in the `metadata.opf` file that is in the same directory as the epub.  But there is a ModifyEPub plugin that will embed the metadata into the file.
Answers.UserDisplayName: StarGeek
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-09T04:49:10.387Z
Answers.Text: @StarGeek Calibre's editor allows you to butcher the metadata.opf if you like (though do it wrong, and it's no longer a valid epub). I'm familiar with Dublin Core and other standards, but not familiar enough to answer my own question.
Answers.UserDisplayName: John O
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-09T01:01:55.333Z
Answers.LastActivityDate: 2021-07-09T01:01:55.333Z
Answers.UserDisplayName: DrMoishe Pippik
Body: <p>I'm currently building epubs by hand (ok, I do cheat and use Calibre's epub editor from time to time). And through some curse from a dying sorcerer everything I'm doing is:</p>
  <ol>
  <li>One of a series/trilogy/etc</li>
  <li>Has a subtitle</li>
  <li>Is part of a &quot;franchise&quot; (think, Star Trek or Marvel MCU or something like that)</li>
  </ol>
  <p>I cannot find anything in the epub 3 specification that details how to impart this metadata into the opf. I understand that even if I do so, it's unlikely that many apps will be able to make use of the metadata, but I was hoping to do so correctly anyway (for future-proofing).</p>
  <p>Is there no way to do any of these properly? If it were only one or the other and not all of them, I might just use colons to separate these out as in <code>Title: Subtitle</code> or <code>Franchise: Title</code> or <code>X Trilogy (1): Title</code>. But with it as it is, if you do that then it's difficult to tell which is which.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-09T01:40:20.303Z
Comments.Text: While it's Calibre specific, there is a `calibre:series` and `calibre:series_index` entries it can embed in the metadata.
Comments.UserDisplayName: StarGeek
Tags: <epub><metadata>
Title: Metadata for Epubs
UserDisplayName: John O
ThreadText: # Metadata for Epubs
  
  (Asked by: username_0 on 2021-07-08)
  
  I'm currently building epubs by hand (ok, I do cheat and use Calibre's epub editor from time to time). And through some curse from a dying sorcerer everything I'm doing is:
  
  1. One of a series/trilogy/etc
  2. Has a subtitle
  3. Is part of a "franchise" (think, Star Trek or Marvel MCU or something like that)
  
  I cannot find anything in the epub 3 specification that details how to impart this metadata into the opf. I understand that even if I do so, it's unlikely that many apps will be able to make use of the metadata, but I was hoping to do so correctly anyway (for future-proofing).
  
  Is there no way to do any of these properly? If it were only one or the other and not all of them, I might just use colons to separate these out as in `Title: Subtitle` or `Franchise: Title` or `X Trilogy (1): Title`. But with it as it is, if you do that then it's difficult to tell which is which.
  
  **Tags:** epub, metadata
  
  > **Comments:**
  > **username_1**: While it's Calibre specific, there is a `calibre:series` and `calibre:series_index` entries it can embed in the metadata.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2021-07-12. Score: 3 | Accepted answer
  
  The correct way to include these according to the EPUB 3.2 standard is as follows. For each of the "titles", you'd include a title element along with a meta element to specify which sort of title it is. Each title element needs its own (arbitrary) unique id, and each meta element will reference that.
  
  ```
  <dc:title id="t1">A Dribble of Event Horizon</dc:title>
  <meta refines="#t1" property="title-type">main</meta>
  
  <dc:title id="t2">When Good Wormholes Go Bad</dc:title>
  <meta refines="#t2" property="title-type">subtitle</meta>
  
  ```
  
  The trouble is, of course, that there are only a few recognized *title-type*s. Those are "main, subtitle, short, collection, edition and expanded".
  
  <https://www.w3.org/publishing/epub3/epub-packages.html#sec-title-type>
  
  But, one might also use "series" and "franchise" and have it be close to the formal spec.
  
  ```
  <dc:title id="t3">The Defective Gates Trilogy</dc:title>
  <meta refines="#t3" property="title-type">series</meta>
  
  <dc:title id="t4">Stargate SG-1</dc:title>
  <meta refines="#t4" property="title-type">franchise</meta>
  
  ```
  
  It is also possible to use the schema attribute to specify a new list of title-types, though I still haven't managed to make sense of that yet.
  
  Additionally, there should probably be a "display-seq" meta element for each title. This tells the app which order to display those titles in. Again, each will reference the title's id directly.
  
  ```
  <dc:title id="t1">A Dribble of Event Horizon</dc:title>
  <meta refines="#t1" property="title-type">main</meta>
  <meta refines="#t1" property="display-seq">3</meta>
  
  <dc:title id="t2">When Good Wormholes Go Bad</dc:title>
  <meta refines="#t2" property="title-type">subtitle</meta>
  <meta refines="#t2" property="display-seq">4</meta>
  
  <dc:title id="t3">The Defective Gates Trilogy</dc:title>
  <meta refines="#t3" property="title-type">series</meta>
  <meta refines="#t3" property="display-seq">2</meta>
  
  <dc:title id="t4">Stargate SG-1</dc:title>
  <meta refines="#t4" property="title-type">franchise</meta>
  <meta refines="#t4" property="display-seq">1</meta>
  
  ```
  
  This would make the app think that the full title might be something like *Stargate SG-1: The Defective Gates Trilogy, A Dribble of Event Horizon: When Good Wormmholes Go Bad*. I don't believe any apps make use of this though, so it's mostly theoretical.
  
  However, it should be noted that even this doesn't actually specify which book in the trilogy it would be, or group it together with other books that it might belong with.
  
  To do that, the metadata.opf file will also have to define a collection, and mark the book as a member of it. This is also done with another meta element. As before, the id for these can be arbitrary.
  
  ```
  <meta property="belongs-to-collection" id="c01">The Defective Gates Trilogy</meta>
  <meta refines="#c01" property="collection-type">series</meta>
  
  ```
  
  The only proper values for collection-type are "series" and "set". Series is pretty much what you'd think it is, and "set" is for those books which would be sold all at once. Think encyclopedias, or "boxed sets". I really don't see the point of the latter, since at least with ebooks, publishers seem likely to just sell them as omnibus editions where everything is in a single file. Note that these values might also be extended with a custom "scheme", hypothetically. If you can figure that out.
  
  Also, such a book as the question asked might reasonably belong to two collections, the second being a "franchise"... but series seems incorrect for that, since such a book rarely belongs in a specific order or sequence within the greater collection of the franchise books. Agatha Christie's stuff comes to mind, where there were many Miss Marple or Poirot books, but they weren't intended to be read in any particular order.
  
  To specify which book of the trilogy, you add a *group-position*.
  
  ```
  <meta property="belongs-to-collection" id="c01">The Defective Gates Trilogy</meta>
  <meta refines="#c01" property="collection-type">series</meta>
  <meta refines="#c01" property="group-position">2</meta>
  
  ```
  
  Note: This is a fictitious book. I have and never will write Stargate SG-1 fan fiction, and if I did they would have better titles.
  
  
  ---
  
  ### Answer by username_2 on 2021-07-09. Score: 1
  
  Calibre allows you to edit metadata, though I don't know if it's just that stored in Calibre's database, as opposed to that in the .epub file itself.
  
  However, there are word processors, e.g., free [LibreOffice's *Writer*](https://www.libreoffice.org/), that can create .epub documents and edit the metadata using an extension, such as [Writer2ePub](https://extensions.libreoffice.org/en/extensions/show/writer2epub). *Writer* itself, without that extension, [can export to .epub and can edit metadata](https://help.libreoffice.org/6.1/en-US/text/shared/01/ref_epub_export.html), but apparently [omits images](https://oscollege.com/2018/08/06/libreoffice-new-epub-feature-a-step-in-the-right-direction/).
  
  > **Comments:**
  > **username_1**: I believe that Calibre stores the metadata in the `metadata.opf` file that is in the same directory as the epub.  But there is a ModifyEPub plugin that will embed the metadata into the file.  
  > **username_0**: @username_1 Calibre's editor allows you to butcher the metadata.opf if you like (though do it wrong, and it's no longer a valid epub). I'm familiar with Dublin Core and other standards, but not familiar enough to answer my own question.  
  
  ---
  
  