Skip to content

Commit

Permalink
vocmap: add sytematikArt; lido: add new job ddd
Browse files Browse the repository at this point in the history
  • Loading branch information
mokko committed Oct 21, 2023
1 parent afbf4c8 commit 8d98ec0
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 5 deletions.
175 changes: 175 additions & 0 deletions vocmap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -965,4 +965,179 @@
<target lang="de" name="homepage">https://www.smb.museum/za</target>
</concept>
</voc>

<!-- If source term exists, return
a) extern target;
b) if extern target doesn't exist, return the source term
-->
<voc name="systematikArt">
<!-- sort source alphabetically please -->
<concept>
<source lang="de">Architekturfotografie</source>
</concept>
<concept>
<source lang="de">Architekturzeichnung</source>
<target lang="en" name="aatlabel">architectural drawings (visual works)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300034787</target>
</concept>
<concept>
<source lang="de">Baukeramik (Keramik)</source>
<target lang="de" name="extern">Baukeramik</target>
</concept>
<concept>
<source lang="de">Dokumentarfotografie</source>
<target lang="de" name="extern">Dokumentarfotografie (visuelles Werk)</target>
<target lang="en" name="aatlabel">documentary photographs</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300264341</target>
</concept>
<concept>
<source lang="de">Buchkunst</source>
<target lang="en" name="aatlabel">book art (bookworks)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300178842</target>
</concept>
<concept>
<source lang="de">Buchmalerei</source>
<target lang="de" name="extern">Buchmalerei (visuelles Werk)</target>
<target lang="en" name="aatlabel">illuminations (visual works)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300264522</target>
</concept>
<concept>
<source lang="de">Druckgrafik</source>
<source lang="de">Druckgraphik</source>
<target lang="en" name="aatlabel">prints</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/</target>
</concept>
<concept>
<source lang="de">Einblattdruck</source>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300041337</target>
</concept>
<concept>
<source lang="de">Ethnographie</source>
<target lang="en" name="aatlabel">ethnography</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300054319</target>
</concept>
<concept>
<source lang="de">Ethnologische Fotografie</source>
</concept>
<concept>
<source lang="de">Feldaufnahme</source>
<target lang="en" name="aatlabel">field recordings</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300265794</target>
</concept>
<concept>
<source lang="de">Feldfotografie</source>
</concept>
<concept>
<source lang="de">Form</source>
</concept>
<concept>
<source lang="de">Fotografie und Moderne Kunst</source>
<source lang="de">Photographie</source>
<source lang="de">Fotografie</source>
<target lang="en" name="aatlabel">photography</target>
<target lang="en" name="aaturi">http://vocab.getty.edu/aat/300054225</target>
</concept>
<concept>
<source lang="de">Gefäßkeramik (Keramik)</source>
<source lang="de">Gefäßkeramik</source>
<target lang="de" target="extern">Gefäßkeramik</target>
</concept>
<concept>
<source lang="de">Gruppenaufnahme (Personen)</source>
<target lang="de" name="extern">Aufnahme einer Gruppe von Personen</target>
</concept>
<concept>
<source lang="de">Gipsabguss</source>
<target lang="de" name="extern">Abguss</target>
<!--Verallgemeinerung-->
<target lang="en" name="aatlabel">casts (sculpture)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300047806</target>
</concept>
<concept>
<source lang="de">Glas</source>
<target lang="de" name="extern">Glas (Material)</target>
<target lang="en" name="aatlabel">glass (material)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300010797</target>
</concept>
<concept>
<source lang="de">Glaskunst</source>
<!--Verallgemeinerung-->
<target lang="en" name="aatlabel">glass (material)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300010797</target>
</concept>
<concept>
<source lang="de">Keramik</source>
<target lang="en" name="aatlabel">ceramics (objects)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300151343</target>
</concept>
<concept>
<source lang="de">Klangerzeugung</source>
</concept>
<concept>
<source lang="de">Kunstgewerbe</source>
<target lang="en" name="aatlabel">decorative arts</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300054168</target>
</concept>
<concept>
<source lang="de">Malmodell</source>
</concept>
<concept>
<source lang="de">Numismatik</source>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/</target>
</concept>
<concept>
<source lang="de">33 R - Profangraphik</source>
<target lang="de" name="extern">Profangrafik</target>
<!--Verallgemeinerung-->
<target lang="en" name="aatlabel">Grafik (grafische Darstellung)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300026848</target>
</concept>
<concept>
<source lang="de">Person (Einzelaufnahme)</source>
<target lang="de" name="extern">Person</target>
<!--Verallgemeinerung-->
<target lang="en" name="aatlabel">people (agents)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300024979</target>
</concept>
<concept>
<source lang="de">Kunstgewerbe &amp; Reliefplastik</source>
<!--Verallgemeinerung-->
<target lang="de" name="extern">Reliefplastik</target>
</concept>
<concept>
<source lang="de">Schmuck</source>
<target lang="en" name="aatlabel">jewelry</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300209286</target>
</concept>
<concept>
<source lang="de">Skulptur</source>
<target lang="en" name="aatlabel">sculpture (visual work)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300047090</target>
</concept>
<concept>
<source lang="de">Stein</source>
<target lang="en" name="aatlabel">stone (rock)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300011176</target>
</concept>
<concept>
<source lang="de">Tafelmalerei</source>
<target lang="de" name="extern">Tafelmalerei (Gemälde)</target>
<target lang="en" name="aatlabel">panel paintings (painting by form)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300033656</target>
</concept>
<concept>
<source lang="de">Textilie</source>
</concept>
<concept>
<source lang="de">Werkstattmodell</source>
</concept>
<concept>
<source lang="de">Zeichnung</source>
<target lang="en" name="aatlabel">drawings (visual works)</target>
<target lang="de" name="aaturi">http://vocab.getty.edu/aat/300033973</target>
</concept>
<concept>
<source lang="de">Zeichenkunst</source>
</concept>
</voc>
</vocmap>
33 changes: 29 additions & 4 deletions zml2lido/data/xsl/zml2lido/classificationWrap.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:z="http://www.zetcom.com/ria/ws/module"
exclude-result-prefixes="z"
xmlns:func="http://func"
exclude-result-prefixes="z func"
xsi:schemaLocation="http://www.lido-schema.org http://www.lido-schema.org/schema/v1.0/lido-v1.0.xsd">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:strip-space elements="*" />
Expand Down Expand Up @@ -392,15 +393,39 @@
</xsl:template>


<!-- systematikArt -->
<!--
systematikArt
The terms in this RIA field often don't make sense, e.g. "31 A - Christusfiguren" so we switch
to a positive list of the most often used terms
mpxvok
-->
<xsl:template name="systematikArt">
<xsl:if test="normalize-space(z:dataField[@name = 'ObjSystematicClb']/z:value) ne ''">
<xsl:variable name="sysArt" select="z:dataField[@name = 'ObjSystematicClb']/z:value"/>
<xsl:variable name="sysArtControl" select="func:vocmap-control('systematikArt',$sysArt)"/>
<xsl:variable name="aaturi" select="func:vocmap-replace-laxer('systematikArt',$sysArt, 'aaturi')"/>
<xsl:variable name="aatlabel" select="func:vocmap-replace-laxer('systematikArt',$sysArt, 'aatlabel')"/>
<xsl:if test="$sysArtControl ne ''">
<xsl:message>classification from systematikArt</xsl:message>
<lido:classification>
<lido:conceptID lido:source="RIA:SystematikArt (ObjSystematicClb)" lido:type="local"/>
<lido:term xml:lang="de">
<xsl:value-of select="normalize-space(z:dataField[@name = 'ObjSystematicClb']/z:value)"/>
<xsl:value-of select="$sysArt"/>
</lido:term>
</lido:classification>
</xsl:if>
<xsl:if test="$aaturi ne ''">
<lido:classification>
<lido:conceptID lido:source="RIA:SystematikArt (ObjSystematicClb)" lido:type="uri">
<xsl:value-of select="$aaturi"/>
</lido:conceptID>
<xsl:if test="$aatlabel ne ''">
<lido:term xml:lang="de">
<xsl:value-of select="$aatlabel"/>
</lido:term>
</xsl:if>
</lido:classification>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
32 changes: 32 additions & 0 deletions zml2lido/data/xsl/zml2lido/func.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,38 @@
] = $src-term]"/>
</xsl:function>

<!--
if source term exists, return extern source or source
if source does not exist, return empty string
-->

<xsl:function name="func:vocmap-control">
<xsl:param name="src-voc"/>
<xsl:param name="src-term"/>
<xsl:variable name="dict" select="document('file:vocmap.xml')"/>
<xsl:variable name="source" select="$dict/vocmap/voc[
@name = normalize-space($src-voc)
]/concept[
source = normalize-space($src-term)
]"/>
<xsl:choose>
<xsl:when test="$source">
<xsl:choose>
<xsl:when test="$source/target[@name eq 'extern']">
<xsl:value-of select="$source/target[@name eq 'extern']"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$source"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<!-- source term doesn't exist-->
<xsl:value-of select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>


<xsl:function name="func:weblink">
<xsl:param name="verwaltendeInstitution"/>
Expand Down
9 changes: 8 additions & 1 deletion zml2lido/lidoTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def execute(self, job: str) -> None:
if job == "dd":
# debug. Only lvl1
lido_fn = self.zml2lido(Input=self.Input)
elif job == "ddd":
# debug. Only lvl1
lido_fn = self.zml2lido(Input=self.Input)
self._valsplit(lido_fn)
elif job == "ohneLit":
# use different xslt for lvl1 conversion plus lvl2
Expand Down Expand Up @@ -231,7 +234,11 @@ def zml2lido(self, *, Input, xslt="zml2lido"):
else:
return self.zml2lidoSingle(Input=Input, xslt=xslt)

def zml2lidoSingle(self, *, Input, xslt="zml2lido"):
def zml2lidoSingle(self, *, Input:str|Path, xslt="zml2lido") -> Path:
"""
Convert a single file from zml to lido using the specified xslt.
Input is a full path.
"""
inputP = Path(Input)
lidoFn = self.outdir.joinpath(inputP.stem + ".lido.xml")
print(f"zml2lidoSingle with {xsl[xslt]}") # with file '{lidoFn}'
Expand Down

0 comments on commit 8d98ec0

Please sign in to comment.