Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DDA
dda-wizard
Commits
f1cc49a2
Commit
f1cc49a2
authored
Oct 09, 2017
by
Gerrit Hübbers
🃏
Browse files
Improve Africa Spectrum test harvesting
parent
35243226
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/gesis/dda/publishing/domain/impl/XsltTransformerOaiPmhBundlesStreamSourceTest.java
View file @
f1cc49a2
...
...
@@ -124,7 +124,13 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue
(
metadata
.
contains
(
new
SimpleMetadatum
(
"dc.description.review"
,
"1"
)
)
);
assertTrue
(
metadata
.
contains
(
new
SimpleMetadatum
(
"dc.title"
,
"en"
,
"The Ethiopian Second Republic and the Fragile “Social Contract”"
)
)
);
assertTrue
(
metadata
.
contains
(
new
SimpleMetadatum
(
"dc.title.alternative"
,
"de"
,
"Die 2. Republik in Äthiopien und der “fragile Gesellschaftsvertrag“"
)
)
);
assertTrue
(
metadata
.
stream
().
noneMatch
(
m
->
m
.
getKey
().
equals
(
"dc.source.issuetopic"
)
)
);
assertTrue
(
metadata
.
stream
().
noneMatch
(
m
->
m
.
getKey
().
equals
(
"dc.source.issuetopic"
)
)
);
assertTrue
(
metadata
.
contains
(
new
SimpleMetadatum
(
"dc.source.pageinfo"
,
"3-28"
)
)
);
bundle
=
bss
.
getBundle
(
"oai:hup.sub.uni-hamburg.de.giga:article/1054"
);
metadata
=
bundle
.
getMetadata
();
assertTrue
(
metadata
.
contains
(
new
SimpleMetadatum
(
"dc.title"
,
"en"
,
"Review: Anika Becher, Explaining Ethnic and Election Violence: Kenya and Malawi in Comparison (2016)"
)
)
);
assertTrue
(
metadata
.
stream
().
noneMatch
(
m
->
m
.
getKey
().
equals
(
"dc.source.issuetopic"
)
)
);
assertTrue
(
metadata
.
stream
().
noneMatch
(
m
->
m
.
getKey
().
equals
(
"dc.source.pageinfo"
)
)
);
}
}
src/test/resources/xslt/africaspectrum-oai_dc-2-xmlbundle.xslt
View file @
f1cc49a2
...
...
@@ -59,15 +59,15 @@
</xsl:call-template>
</xsl:if>
<!-- dc:source may contain page information ... if it exists, it is after the last '; ' occurrence -->
<!-- dc:source may contain page information ... if it exists
and follows the pattern 123(-125)
, it is after the last '; ' occurrence -->
<xsl:variable
name=
"pageinfo"
select=
"tokenize(text(),'; ')[last()]"
/>
<!-- <xsl:message terminate="no">pageinfo=<xsl:value-of select="$pageinfo"/></xsl:message> -->
<xsl:if
test=
"$pageinfo != ''"
>
<xsl:call-template
name=
"new-metadatum"
>
<xsl:with-param
name=
"key"
select=
"'dc.source.pageinfo'"
/>
<xsl:with-param
name=
"language"
select=
"''"
/>
<xsl:with-param
name=
"value"
select=
"$pageinfo"
/>
</xsl:call-template>
<xsl:if
test=
"$pageinfo != ''
and matches($pageinfo, '^\d+(-\d+)?')
"
>
<xsl:call-template
name=
"new-metadatum"
>
<xsl:with-param
name=
"key"
select=
"'dc.source.pageinfo'"
/>
<xsl:with-param
name=
"language"
select=
"''"
/>
<xsl:with-param
name=
"value"
select=
"$pageinfo"
/>
</xsl:call-template>
</xsl:if>
</xsl:template>
...
...
src/test/resources/xslt/africaspectrum-xmetadissplus-2-xmlbundle.xslt
View file @
f1cc49a2
...
...
@@ -39,18 +39,6 @@
<xsl:apply-templates
select=
"oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/xMetaDiss:xMetaDiss"
/>
<xsl:apply-templates
select=
"oai:OAI-PMH/oai:GetRecord/oai:record/oai:header"
/>
<xsl:call-template
name=
"new-metadatum"
>
<xsl:with-param
name=
"key"
select=
"'dc.publisher'"
/>
<xsl:with-param
name=
"language"
select=
"''"
/>
<xsl:with-param
name=
"value"
select=
"'XXX to be defined... GIGA or Hamburg University Press ... or both?'"
/>
</xsl:call-template>
<xsl:call-template
name=
"new-metadatum"
>
<xsl:with-param
name=
"key"
select=
"'dc.publisher.country'"
/>
<xsl:with-param
name=
"language"
select=
"''"
/>
<xsl:with-param
name=
"value"
select=
"'DEU'"
/>
</xsl:call-template>
<xsl:call-template
name=
"new-metadatum"
>
<xsl:with-param
name=
"key"
select=
"'dc.type.stock'"
/>
<xsl:with-param
name=
"language"
select=
"''"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment