Skip to content

Commit

Permalink
update of evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-jettka committed Feb 22, 2024
1 parent 22ef712 commit 07db30a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 41 deletions.
16 changes: 8 additions & 8 deletions evaluation/csv/citation-types-frequencies.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Citation type, abs. frequency (n=119), rel. frequency (in %),ALL / abs. frequency (n=119),ALL / rel. frequency (in %)
Soft.Bib,1,.84,1,.84
Soft.Bib.Ref,0,.0,0,.0
Soft.Name,119,100.0,119,100.0
Soft.Agent,0,.0,0,.0
Soft.URL,9,7.56,9,7.56
Soft.PID,0,.0,0,.0
Soft.Ver,0,.0,0,.0
Citation type, abs. frequency (n=234), rel. frequency (in %),ALL / abs. frequency (n=234),ALL / rel. frequency (in %)
soft.bib,3,1.28,3,1.28
soft.bib.ref,27,11.54,27,11.54
soft.name,231,98.72,231,98.72
soft.agent,35,14.96,35,14.96
soft.url,86,36.75,86,36.75
soft.pid,0,.0,0,.0
soft.ver,4,1.71,4,1.71
38 changes: 8 additions & 30 deletions evaluation/xsl/citation-types-frequencies.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,33 @@
<xsl:output method="text" omit-xml-declaration="yes"/>


<xsl:include href="global-parameters.xsl"/>


<!-- Keys -->
<xsl:key name="rs-by-ref" match="*:rs" use="@ref"/>
<xsl:key name="ptr-by-target" match="*:ptr" use="@target"/>

<!-- Global variables -->

<!-- directories with TEI files -->
<xsl:variable name="collection-dirs" as="xs:string+" select="(
'../../data/JTEI/10_2016-19',
'../../data/JTEI/13_2020-22',
'../../data/JTEI/7_2014',
'../../data/JTEI/rolling_2019',
'../../data/JTEI/rolling_2023',
'../../data/JTEI/11_2019-20',
'../../data/JTEI/12_2019-20',
'../../data/JTEI/14_2021-23',
'../../data/JTEI/8_2014-15',
'../../data/JTEI/rolling_2021',
'../../data/JTEI/16_2023_spa',
'../../data/JTEI/9_2016-17',
'../../data/JTEI/rolling_2022'
)"/>

<!-- software types -->
<xsl:variable name="types" select="document('../../taxonomy/citation-taxonomy.xml')//*:taxonomy/*:category/@xml:id" as="xs:string+"/>
<!-- Global variables -->


<!-- additional columns for predefined filters (applied to file path, compare directory list above for examples) -->
<!-- could also be ('/deu/', '/eng/', ...) for instance -->
<!-- could also be ('/2015/', '/2016/', '/2017/', '/2018/', '/2019/', '/2020/') for instance -->
<xsl:variable name="path-filters" select="''" as="xs:string+"/>

<!-- character to be used as CSV separator -->
<xsl:variable name="csv-separator" select="','" as="xs:string"/>

<!-- newline character -->
<xsl:variable name="NEWLINE"><xsl:text>
</xsl:text></xsl:variable>

<!-- instances of one specific software in one text -->
<xsl:variable name="instances">
<xsl:for-each select="$collection-dirs">
<xsl:for-each select="$COLLECTION-DIRS">
<xsl:for-each select="collection(concat(., '?select=*.xml;recurse=yes;on-error=warning'))">
<xsl:variable name="path" select="base-uri()" as="xs:string"/>
<xsl:variable name="doc" select="/"/>
<xsl:for-each select="distinct-values($doc//*:ptr[@type='software']/@target)">
<xsl:variable name="current-software-target" select="." as="xs:string"/>
<xsl:variable name="rs-for-this-software" select="key('rs-by-ref', key('ptr-by-target', $current-software-target, $doc)/concat('#', @xml:id), $doc)"/>
<instance text="{$path}" software="{$current-software-target}">
<xsl:for-each select="$types">
<xsl:for-each select="$SOFTWARE-MENTION-TYPES">
<!-- counting frequencies -->
<!--<xsl:attribute name="{.}" select="count($rs-with-this-key[contains(lower-case(@ana), lower-case(concat('#',current())))])"/>-->
<!-- determining presence -->
Expand Down Expand Up @@ -91,7 +69,7 @@
<xsl:value-of select="$NEWLINE"/>


<xsl:for-each select="$types">
<xsl:for-each select="$SOFTWARE-MENTION-TYPES">
<xsl:variable name="citation-type" select="." as="xs:string"/>

<xsl:value-of select="concat($citation-type, ',')"/>
Expand Down
6 changes: 3 additions & 3 deletions evaluation/xsl/citation-types.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@

<xsl:for-each select="distinct-values($doc//*:rs[some $cit in $categories[position() &gt; 2] satisfies contains(@type, $cit)]/tokenize(@ref, ' '))">
<xsl:sort select="." order="ascending"/>
<xsl:variable name="current-ref" select="substring-after(., '#')" as="xs:string"/>
<xsl:variable name="software-id" select="lower-case(substring-after(key('software-target-by-id', $current-ref, $doc)[1], '#'))"/>
<xsl:variable name="current-ref" select="." as="xs:string"/>
<xsl:variable name="software-id" select="lower-case(substring-after(key('software-target-by-id', substring-after($current-ref, '#'), $doc)[1], '#'))"/>
<xsl:variable name="software-name" select="(
key('software-name-by-id', $software-id, $software-list),
error((), concat('No software name found for ID ''', $software-id, ''' / ref ''#', $current-ref ,''' (', base-uri($doc), ')')))[1]" as="xs:string"/>
error((), concat('No software name found for ID ''', $software-id, ''' / ref ''', $current-ref ,''' (', base-uri($doc), ')')))[1]" as="xs:string"/>
<xsl:variable name="rs-with-this-ref" select="key('rs-by-ref', ., $doc)"/>


Expand Down

0 comments on commit 07db30a

Please sign in to comment.