【问题标题】:How to calculate number of authors in EPrints (repository like DSpace)?如何计算 EPrints(像 DSpace 这样的存储库)中的作者数量?
【发布时间】:2016-01-25 15:03:10
【问题描述】:
EPrints 是一个基于 perl 的存储库,请参阅 EPrints in WP
我的图书管理员要求我按以下方式设置 EPrins(仅适用于“专着”类型的文档):
- 如果作者不超过 3 人,则在专着标题前打印“作者”;
- 如果作者超过 3 位,则打印“$title / $authors”。
例如,第一次发表 7 位作者,第二次发表 2 位作者:
-
分析俄语维基词典的引文语料库 / Smirnov A., Levashova T., Karpov A., Kipyatkova I., Ronzhin A., Krizhanovsky A., Krizhanovsky N. 计算科学研究。 2012
-
Meyer C.M., Gurevych I. 值得一提的黄金或其他资源 - 维基词典、OpenThesaurus 和 GermaNet 的比较研究。 2010 年。
【问题讨论】:
标签:
perl
repository
citations
【解决方案1】:
经过我们的几次尝试和失败尝试...最大的问题是 EPrints 不是纯 Perl,并且没有太多文档...
我们需要编辑 citations 文件 /eprints/cfg/citations/eprint/default.xml)。有以下解决方案:
<!-- Monograph: if < 4 authors then print 'authors' before title -->
<when test="type = 'monograph'">
<if test="is_set(creators_name)">
<set name='authors' expr="creators_name">
(Debug information) Number of authors:
<print expr="$authors.length()"/>.
<set name='authors_len' expr="$authors.length()">
<if test="$authors_len lt 4">
<print expr="creators_name"/>
</if>
</set>
</set>
</if>
</when>
<!-- Title -->
<cite:linkhere><xhtml:em><print expr="title"/>:</xhtml:em></cite:linkhere>
<!-- "/ authors" after Title for monography if len(authors)>3 -->
<choose>
<when test="type = 'monograph'">
<if test="is_set(creators_name)">
<set name='authors' expr="creators_name">
<set name='authors_len' expr="$authors.length()">
<if test="$authors_len gt 3">
/ <print expr="creators_name"/>
</if>
</set>
</set>
</if>
</when>
<otherwise>
</otherwise>
</choose>
它有效,但是...我计算了两次相同的变量“authors_len”。而且我不知道如何重用这个变量并只计算一次。
我尝试了 EPrints 函数“is_set(authors_len)”并尝试了“is_set($authors_len)”,但 EPrints 会抛出不同的错误消息 o_O
【解决方案2】:
我会使用以下内容,检查正在设置的 creators_name 以及有多少个创建者:
<when test="type = 'monograph'">
<choose>
<when test="is_set(creators_name) and length(creators_name) lt 4">
<print expr="creators_name" />
/
<print expr="title" />
</when>
<when test="is_set(creators_name) and length(creators_name) gt 3">
<print expr="title" />
/
<print expr="creators_name" />
</when>
<otherwise>
<print expr="title" />
</otherwise>
</choose>
</when>
在 EPrints 引文文件中使用 XML cmets 时,它们将出现在页面的 HTML 源代码中。要使引文文件中的 cmets 不出现在 html 源代码中,可以使用:
<comment>This will not appear in the html source</comment>
EPrints 引用所使用的语言记录在 EPrints Wiki 上:
一些 XML 配置文件使用不同的默认命名空间 - 因此您可能会看到以命名空间为前缀的元素,例如
<cite:citation xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://eprints.org/ep3/control" xmlns:cite="http://eprints.org/ep3/citation" >
...
<epc:comment>This is a comment</epc:comment>
...
</cite:citation>
在 EPrints 方面获得帮助的最佳地点是他们的邮件列表 - 搜索 wiki(上面链接)以获取详细信息(我没有足够的声誉来发布另一个链接!)。