Commit e2d440c1 authored by thorsten.vitt's avatar thorsten.vitt
Browse files

Add 'Autoren/' from commit '7997d5a1'

git-subtree-dir: Autoren
git-subtree-mainline: 9b84692b
git-subtree-split: 7997d5a1
parents 9b84692b 7997d5a1
authors.xml Liste der Autoren des Literaturordners
authors+pnd.xml authors.xml angereichert mit PND-Informationen
authors-pnd.xsl Script zur Anreicherung
Statistik-PNDs.txt Ein wenig Analyse
Autoren PNDs
------- ----
69 0 viele Autorennamen mit Umlauten
432 1
99 2
28 3
19 4
4 5
6 6
7 7
3 8
3 9
4 10
2 11
1 12
2 13
2 16
2 18
1 20
2 23
1 24
1 25
1 39
1 40 Müller, Robert
1 43 Wagner, Richard
1 86 Müller, Wilhelm
1 113 Anonym
------- ----
Lies: Zu 69 Autoren wurden keine PNDs gefunden, zu 432 jeweils genau 1 etc.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:a="http://www.textgrid.info/namespace/digibib/authors"
xmlns:p="http://textgrid.info/namespaces/vocabularies/pnd" exclude-result-prefixes="xs"
version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="a:author">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:variable name="pndinfos">
<xsl:apply-templates/>
</xsl:variable>
<xsl:variable name="matching-pnds" select="$pndinfos//a:pnd[@dates-match]"/>
<xsl:choose>
<xsl:when test="count($matching-pnds) = 0">
<xsl:variable name="pnds" select="$pndinfos//a:pnd"/>
<xsl:choose>
<xsl:when test="count($pnds) = 1">
<xsl:attribute name="unique-pnd" select="$pnds/@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="found">no</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="count($matching-pnds) = 1">
<xsl:attribute name="unique-pnd" select="$matching-pnds/@id"/>
<xsl:attribute name="found">yes</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="ambiguous-matches" select="$matching-pnds/@id"/>
<xsl:attribute name="found">yes</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:attribute name="matches" select="count($matching-pnds)"/>
<xsl:copy-of select="$pndinfos"/>
</xsl:copy>
</xsl:template>
<xsl:template match="a:pndinfo">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:for-each-group select="p:person" group-by="@id">
<xsl:variable name="pnd" select="replace(current-grouping-key(), 'pnd:', '')"/>
<xsl:message>PND: <xsl:value-of select="$pnd"/></xsl:message>
<a:pnd n="{$pnd}" id="{current-grouping-key()}">
<xsl:message>Fetching <xsl:value-of
select="concat('http://textgridlab.org/pndsearch/pndquery.xql?id=', $pnd)"
/> ...</xsl:message>
<xsl:variable name="entry"
select="document(concat('http://textgridlab.org/pndsearch/pndquery.xql?id=', $pnd))//p:entry"/>
<xsl:if
test="( ancestor::a:author/@born le $entry/p:dateOfBirth ) and ( ancestor-or-self::a:author/@died ge $entry/p:dateOfDeath )">
<xsl:attribute name="dates-match">yes</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$entry"/>
</a:pnd>
</xsl:for-each-group>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:a="http://www.textgrid.info/namespace/digibib/authors"
xmlns:p="http://textgrid.info/namespaces/vocabularies/pnd"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="a:author">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:call-template name="fetchauthor">
<xsl:with-param name="name" select="@name"/>
</xsl:call-template>
</xsl:copy>
</xsl:template>
<xsl:template name="fetchauthor">
<xsl:param name="name"/>
<xsl:variable name="uri" select="concat('http://textgridlab.org/pndsearch/pndquery.xql?ln=', encode-for-uri($name))"/>
<xsl:message>Fetching <xsl:value-of select="$uri"/> ...</xsl:message>
<xsl:variable name="record">
<xsl:apply-templates mode="filter-result" select="doc($uri)/p:response/*"/>
</xsl:variable>
<a:pndinfo persons="{count($record/p:person)}" pnds="{count(distinct-values($record/p:person/@id))}" src="{$uri}">
<xsl:apply-templates select="$record"/>
</a:pndinfo>
</xsl:template>
<xsl:template match="*" mode="filter-result">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="#current"/>
</xsl:copy>
</xsl:template>
<xsl:template match="p:variant" mode="filter-result"/>
</xsl:stylesheet>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:a="http://www.textgrid.info/namespace/digibib/authors"
xmlns:tg="http://www.textgrid.de"
exclude-result-prefixes="xs a tg"
version="2.0">
<xsl:param name="dir" select="'file:///mnt/data/digibib/target/04-2-corrections+more-meta/Literatur/Text/_alles_verse-in-prosa'"/>
<xsl:output method="xml" indent="yes"/>
<xsl:include href="../Literatur/util.xsl"/>
<xsl:template match="/">
<a:authors>
<xsl:for-each select="collection($dir)">
<xsl:choose>
<xsl:when test=".//document-metadata/author/@name">
<a:author>
<xsl:attribute name="name" select=".//document-metadata/author/@name"/>
<xsl:variable name="biografie" select=".//article[matches(@location, 'Biographie$')][1]"/>
<xsl:variable name="dateFromText" select="//articlegroup[@name eq 'M']/article[1]/text[1]//h4[
matches(text(), '(^|\D+)(\d{4})\D(\d{4})($|\D+)')
or matches(text(), '(^|\D+)(\d{3})\D(\d{3})($|\D+)')
or matches(text(), '(^|\D+)((\d{4})\D(\d{2}))\D((\d{4})\D(\d{2}))($|\D+)')
or matches(text(),'(^|\D+)(\d{4})\D(\d{2})\D(\d{4})($|\D+)')
or (
matches(text(), '(^|\D+)(\d{3})\D(\d{3})($|\D+)')
and contains(normalize-space(text()), 'v. Chr.'))
or matches(text(), '(^|\D+)(\d{3})\D(\d{3})($|\D+)')
]"/>
<xsl:variable name="lifedates" select="tg:getLifedatesFromtext($dateFromText)"/>
<xsl:if test="$lifedates">
<xsl:attribute name="born" select="$lifedates/tg:birthday"/>
<xsl:attribute name="died" select="$lifedates/tg:death"/>
</xsl:if>
<!--
<xsl:if test="$biografie">
<xsl:attribute name="born" select="tg:fetchAuthorBirthday($biografie)"/>
<xsl:attribute name="died" select="tg:fetchAuthorDeath($biografie)"/>
</xsl:if>
'-->
</a:author>
</xsl:when>
<xsl:otherwise>
<xsl:comment>urgs! <xsl:value-of select="document-uri(.)"/> hat keinen Autor?</xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</a:authors>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment