Skip to content

Commit

Permalink
docu, instructions, iiif manifests, monacensia
Browse files Browse the repository at this point in the history
  • Loading branch information
pdaengeli authored Nov 2, 2024
1 parent df742ed commit b2f19e4
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 3 deletions.
61 changes: 58 additions & 3 deletions src/arbeitsschritte/IIIF-manifest-anlegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,61 @@ TBD

#### monacensia

TBD
Die Patrinum-Plattform bietet auf der Dokumentansicht einen Link zum zugehörigen IIIF Presentation Manifests an:

![alt text](image-1.png)

In diesem JSON sind die Image URLs unter `.sequences[:0].canvases[:0].images[:0].resource.service` als `@id` (abfragbar z.B. mit https://jsonpath.com/).

⚡ Eine einfache Möglichkeit, an `[md_data]` zu kommen, bietet [diese Fiddle](https://martin-honnen.github.io/xslt3fiddle/?xslt=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%0D%0A%3Cxsl%3Astylesheet+xmlns%3Axsl%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2FXSL%2FTransform%22%0D%0A++xmlns%3Amap%3D%22http%3A%2F%2Fwww.w3.org%2F2005%2Fxpath-functions%2Fmap%22%0D%0A++version%3D%223.0%22%0D%0A++xmlns%3Axs%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22%0D%0A++exclude-result-prefixes%3D%22%23all%22%0D%0A++expand-text%3D%22yes%22%3E%0D%0A++%0D%0A++%3Cxsl%3Aoutput+method%3D%22text%22%2F%3E%0D%0A%0D%0A++%3Cxsl%3Amode+on-no-match%3D%22shallow-copy%22%2F%3E%0D%0A%0D%0A++%3Cxsl%3Atemplate+match%3D%22%2Finput%22+name%3D%22xsl%3Ainitial-template%22%3E%0D%0A++++%3Cxsl%3Avariable+name%3D%22id%22+select%3D%22%40id%22%2F%3E%0D%0A++++%3Cxsl%3Avariable+name%3D%22input%22+select%3D%22%40manifest+%3D%3E+normalize-space%28%29+%3D%3E+json-doc%28%29%22%2F%3E%0D%0A++++%3Cxsl%3Atext%3E%5Bmf_data%5D%26%23xA%3B%3C%2Fxsl%3Atext%3E%0D%0A++++%3Cxsl%3Afor-each+select%3D%22%24input%3Fsequences%3F*%3Fcanvases%3F*%3Fimages%3F*%3Fresource%3Fservice%22%3E%22%7B%24id%7D_%7Bposition%28%29%3D%3Eformat-number%28%27000%27%29%7D%22+%3D+%22%7Bmap%3Afind%28.%2C%27%40id%27%29%7D%22%26%23xA%3B%3C%2Fxsl%3Afor-each%3E%0D%0A++%3C%2Fxsl%3Atemplate%3E%0D%0A++%0D%0A%3C%2Fxsl%3Astylesheet%3E&input=%3Cinput%0A++id%3D%22smallform_598%22%0A++manifest%3D%22https%3A%2F%2Fwww.monacensia-digital.de%2Fi3f%2Fv20%2F415207%2Fmanifest%22%0A++%2F%3E&input-type=XML)

Input:
```xml
<input
id="smallform_598"
manifest="https://www.monacensia-digital.de/i3f/v20/415207/manifest"
/>
```

Output:
```
"smallform_598_001" = "https://www.monacensia-digital.de/i3f/v20/415208"
"smallform_598_002" = "https://www.monacensia-digital.de/i3f/v20/415209"
"smallform_598_003" = "https://www.monacensia-digital.de/i3f/v20/415210"
"smallform_598_004" = "https://www.monacensia-digital.de/i3f/v20/415211"
"smallform_598_005" = "https://www.monacensia-digital.de/i3f/v20/415212"
"smallform_598_006" = "https://www.monacensia-digital.de/i3f/v20/415213"
"smallform_598_007" = "https://www.monacensia-digital.de/i3f/v20/415214"
"smallform_598_008" = "https://www.monacensia-digital.de/i3f/v20/415215"
"smallform_598_009" = "https://www.monacensia-digital.de/i3f/v20/415216"
```

<details><summary>Code of the fiddle</summary>

```xml
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:map="http://www.w3.org/2005/xpath-functions/map"
version="3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all"
expand-text="yes">

<xsl:output method="text"/>

<xsl:mode on-no-match="shallow-copy"/>

<xsl:template match="/input" name="xsl:initial-template">
<xsl:variable name="id" select="@id"/>
<xsl:variable name="input" select="@manifest => normalize-space() => json-doc()"/>
<xsl:text>[mf_data]&#xA;</xsl:text>
<xsl:for-each select="$input?sequences?*?canvases?*?images?*?resource?service">"{$id}_{position()=>format-number('000')}" = "{map:find(.,'@id')}"&#xA;</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
```

</details>

#### patrinum

Expand All @@ -53,12 +107,12 @@ Die Patrinum-Plattform bietet eine Schaltfläche an, mit der sich die URL des II

In diesem JSON sind die Image URLs unter `.items[:0].items[:0].items[:0].body.id` (abfragbar z.B. mit https://jsonpath.com/).

Eine einfache Möglichkeit, an `[md_data]` zu kommen, bietet [diese Fiddle](https://martin-honnen.github.io/xslt3fiddle/?xslt=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%0D%0A%3Cxsl%3Astylesheet+xmlns%3Axsl%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2FXSL%2FTransform%22%0D%0A++xmlns%3Amap%3D%22http%3A%2F%2Fwww.w3.org%2F2005%2Fxpath-functions%2Fmap%22%0D%0A++version%3D%223.0%22%0D%0A++xmlns%3Axs%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22%0D%0A++exclude-result-prefixes%3D%22%23all%22%0D%0A++expand-text%3D%22yes%22%3E%0D%0A++%0D%0A++%3Cxsl%3Aoutput+method%3D%22text%22%2F%3E%0D%0A%0D%0A++%3Cxsl%3Amode+on-no-match%3D%22shallow-copy%22%2F%3E%0D%0A%0D%0A++%3Cxsl%3Atemplate+match%3D%22%2Finput%22+name%3D%22xsl%3Ainitial-template%22%3E%0D%0A++++%3Cxsl%3Avariable+name%3D%22id%22+select%3D%22%40id%22%2F%3E%0D%0A++++%3Cxsl%3Avariable+name%3D%22input%22+select%3D%22%40manifest+%3D%3E+normalize-space%28%29+%3D%3E+json-doc%28%29%22%2F%3E%0D%0A++++%3Cxsl%3Afor-each+select%3D%22%24input%3Fitems%3F*%3Fitems%3F*%3Fitems%3F*%3Fbody%3Fid%22%3E%22%7B%24id%7D_%7Bposition%28%29%3D%3Eformat-number%28%27000%27%29%7D%22+%3D+%22%7B.%7D%22%26%23xA%3B%3C%2Fxsl%3Afor-each%3E%0D%0A++%3C%2Fxsl%3Atemplate%3E%0D%0A++%0D%0A%3C%2Fxsl%3Astylesheet%3E&input=%3Cinput%0A++id%3D%22letter_1234%22%0A++manifest%3D%22https%3A%2F%2Fpatrinum.ch%2Fnanna%2Fproxy%2Fiiif%2Fmanifest%2F587676%2F%22%0A++%2F%3E&input-type=XML).
⚡ Eine einfache Möglichkeit, an `[md_data]` zu kommen, bietet [diese Fiddle](https://martin-honnen.github.io/xslt3fiddle/?xslt=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%0D%0A%3Cxsl%3Astylesheet+xmlns%3Axsl%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2FXSL%2FTransform%22%0D%0A++xmlns%3Amap%3D%22http%3A%2F%2Fwww.w3.org%2F2005%2Fxpath-functions%2Fmap%22%0D%0A++version%3D%223.0%22%0D%0A++xmlns%3Axs%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22%0D%0A++exclude-result-prefixes%3D%22%23all%22%0D%0A++expand-text%3D%22yes%22%3E%0D%0A++%0D%0A++%3Cxsl%3Aoutput+method%3D%22text%22%2F%3E%0D%0A%0D%0A++%3Cxsl%3Amode+on-no-match%3D%22shallow-copy%22%2F%3E%0D%0A%0D%0A++%3Cxsl%3Atemplate+match%3D%22%2Finput%22+name%3D%22xsl%3Ainitial-template%22%3E%0D%0A++++%3Cxsl%3Avariable+name%3D%22id%22+select%3D%22%40id%22%2F%3E%0D%0A++++%3Cxsl%3Avariable+name%3D%22input%22+select%3D%22%40manifest+%3D%3E+normalize-space%28%29+%3D%3E+json-doc%28%29%22%2F%3E%0D%0A++++%3Cxsl%3Afor-each+select%3D%22%24input%3Fitems%3F*%3Fitems%3F*%3Fitems%3F*%3Fbody%3Fid%22%3E%22%7B%24id%7D_%7Bposition%28%29%3D%3Eformat-number%28%27000%27%29%7D%22+%3D+%22%7B.%7D%22%26%23xA%3B%3C%2Fxsl%3Afor-each%3E%0D%0A++%3C%2Fxsl%3Atemplate%3E%0D%0A++%0D%0A%3C%2Fxsl%3Astylesheet%3E&input=%3Cinput%0A++id%3D%22letter_1234%22%0A++manifest%3D%22https%3A%2F%2Fpatrinum.ch%2Fnanna%2Fproxy%2Fiiif%2Fmanifest%2F587676%2F%22%0A++%2F%3E&input-type=XML).

Hier lassen sich im Input-Panel (links) die Dokument-ID und die Patrinum-Manifest-URL angeben und über die Schaltfläche "transform" ein Output der folgenden Form erzeugen (unten rechts), der sich in die `.toml`-Datei einfügen lässt:

Input:
```
```xml
<input
id="letter_1234"
manifest="https://patrinum.ch/nanna/proxy/iiif/manifest/587676/"
Expand Down Expand Up @@ -90,6 +144,7 @@ Output:
<xsl:template match="/input" name="xsl:initial-template">
<xsl:variable name="id" select="@id"/>
<xsl:variable name="input" select="@manifest => normalize-space() => json-doc()"/>
<xsl:text>[mf_data]&#xA;</xsl:text>
<xsl:for-each select="$input?items?*?items?*?items?*?body?id">"{$id}_{position()=>format-number('000')}" = "{.}"&#xA;</xsl:for-each>
</xsl:template>

Expand Down
Binary file added src/arbeitsschritte/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b2f19e4

Please sign in to comment.