fix base tr

This commit is contained in:
Michele Artini 2024-11-14 09:29:10 +01:00
parent ed560dacc0
commit c5b9a1592e
1 changed files with 493 additions and 424 deletions

View File

@ -1,44 +1,54 @@
<RESOURCE_PROFILE> <RESOURCE_PROFILE>
<HEADER> <HEADER>
<RESOURCE_IDENTIFIER value="2ad0cdd9-c96c-484c-8b0e-ed56d86891fe_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU=" /> <RESOURCE_IDENTIFIER
<RESOURCE_TYPE value="TransformationRuleDSResourceType" /> value="2ad0cdd9-c96c-484c-8b0e-ed56d86891fe_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
<RESOURCE_KIND value="TransformationRuleDSResources" /> <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
<RESOURCE_URI value="" /> <RESOURCE_KIND value="TransformationRuleDSResources"/>
<DATE_OF_CREATION value="2024-03-05T11:23:00+00:00" /> <RESOURCE_URI value=""/>
</HEADER> <DATE_OF_CREATION value="2024-03-05T11:23:00+00:00"/>
<BODY> </HEADER>
<CONFIGURATION> <BODY>
<SOURCE_METADATA_FORMAT interpretation="cleaned" layout="store" name="dc" /> <CONFIGURATION>
<SINK_METADATA_FORMAT name="odf_hbase" /> <SOURCE_METADATA_FORMAT interpretation="cleaned" layout="store" name="dc"/>
<IMPORTED /> <SINK_METADATA_FORMAT name="odf_hbase"/>
<SCRIPT> <IMPORTED/>
<TITLE>xslt_base2odf_hadoop</TITLE> <SCRIPT>
<CODE> <TITLE>xslt_base2odf_hadoop</TITLE>
<xsl:stylesheet xmlns:oaire="http://namespace.openaire.eu/schema/oaire/" xmlns:dateCleaner="http://eu/dnetlib/transform/dateISO" xmlns:base_dc="http://oai.base-search.net/base_dc/" <CODE>
xmlns:datacite="http://datacite.org/schema/kernel-4" xmlns:dr="http://www.driver-repository.eu/namespace/dr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <xsl:stylesheet xmlns:oaire="http://namespace.openaire.eu/schema/oaire/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:vocabulary="http://eu/dnetlib/transform/clean" xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dateCleaner="http://eu/dnetlib/transform/dateISO"
xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:base_dc="http://oai.base-search.net/base_dc/"
exclude-result-prefixes="xsl vocabulary dateCleaner base_dc" version="2.0"> xmlns:datacite="http://datacite.org/schema/kernel-4"
<xsl:param name="varOfficialName" /> xmlns:dr="http://www.driver-repository.eu/namespace/dr"
<xsl:param name="varDataSourceId" /> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<xsl:param name="varFP7" select="'corda_______::'" /> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:param name="varH2020" select="'corda__h2020::'" /> xmlns:vocabulary="http://eu/dnetlib/transform/clean"
<xsl:param name="repoCode" select="substring-before(//*[local-name() = 'header']/*[local-name()='recordIdentifier'], ':')" /> xmlns:oaf="http://namespace.openaire.eu/oaf"
<xsl:param name="index" select="0" /> xmlns:oai="http://www.openarchives.org/OAI/2.0/"
<xsl:param name="transDate" select="current-dateTime()" /> xmlns:dri="http://www.driver-repository.eu/namespace/dri"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:dc="http://purl.org/dc/elements/1.1/"
exclude-result-prefixes="xsl vocabulary dateCleaner base_dc" version="2.0">
<xsl:param name="varOfficialName"/>
<xsl:param name="varDataSourceId"/>
<xsl:param name="varFP7" select="'corda_______::'"/>
<xsl:param name="varH2020" select="'corda__h2020::'"/>
<xsl:param name="repoCode"
select="substring-before(//*[local-name() = 'header']/*[local-name()='recordIdentifier'], ':')"/>
<xsl:param name="index" select="0"/>
<xsl:param name="transDate" select="current-dateTime()"/>
<xsl:template name="terminate"> <xsl:template name="terminate">
<xsl:message terminate="yes"> <xsl:message terminate="yes"> record is not compliant, transformation is
record is not compliant, transformation is interrupted. interrupted. </xsl:message>
</xsl:message> </xsl:template>
</xsl:template>
<xsl:template match="/"> <xsl:template match="/">
<record> <record>
<xsl:apply-templates select="//*[local-name() = 'header']" /> <xsl:apply-templates select="//*[local-name() = 'header']"/>
<!-- NOT USED <!-- NOT USED
base_dc:global_id (I used oai:identifier) base_dc:global_id (I used oai:identifier)
base_dc:collection/text() base_dc:collection/text()
base_dc:continent base_dc:continent
@ -51,422 +61,481 @@
base_dc:link (I used dc:identifier) base_dc:link (I used dc:identifier)
--> -->
<metadata> <metadata>
<datacite:resource> <datacite:resource>
<xsl:for-each select="//base_dc:doi"> <xsl:for-each select="//base_dc:doi">
<datacite:identifier identifierType="DOI"> <datacite:identifier identifierType="DOI">
<xsl:value-of select="." /> <xsl:value-of select="."/>
</datacite:identifier> </datacite:identifier>
</xsl:for-each> </xsl:for-each>
<datacite:alternateIdentifiers> <datacite:alternateIdentifiers>
<xsl:for-each <xsl:for-each
select="distinct-values(//dc:identifier[starts-with(., 'http') and (not(contains(., '://dx.doi.org/') or contains(., '://doi.org/') or contains(., '://hdl.handle.net/')))])"> select="distinct-values(//dc:identifier[starts-with(., 'http') and (not(contains(., '://dx.doi.org/') or contains(., '://doi.org/') or contains(., '://hdl.handle.net/')))])">
<datacite:identifier alternateIdentifierType="url"> <datacite:identifier alternateIdentifierType="url">
<xsl:value-of select="." /> <xsl:value-of select="."/>
</datacite:identifier> </datacite:identifier>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="distinct-values(//dc:identifier[starts-with(., 'http') and contains(., '://hdl.handle.net/')]/substring-after(., 'hdl.handle.net/'))"> <xsl:for-each
<datacite:identifier alternateIdentifierType="handle"> select="distinct-values(//dc:identifier[starts-with(., 'http') and contains(., '://hdl.handle.net/')]/substring-after(., 'hdl.handle.net/'))">
<xsl:value-of select="." /> <datacite:identifier
</datacite:identifier> alternateIdentifierType="handle">
</xsl:for-each> <xsl:value-of select="."/>
</datacite:identifier>
</xsl:for-each>
<xsl:for-each select="distinct-values(//dc:identifier[starts-with(., 'urn:nbn:nl:') or starts-with(., 'URN:NBN:NL:')])"> <xsl:for-each
<datacite:identifier alternateIdentifierType='urn'> select="distinct-values(//dc:identifier[starts-with(., 'urn:nbn:nl:') or starts-with(., 'URN:NBN:NL:')])">
<xsl:value-of select="." /> <datacite:identifier alternateIdentifierType="urn">
</datacite:identifier> <xsl:value-of select="."/>
</xsl:for-each> </datacite:identifier>
</xsl:for-each>
<datacite:identifier alternateIdentifierType="oai-original"> <datacite:identifier
<xsl:value-of alternateIdentifierType="oai-original">
select="//oai:header/oai:identifier" /> <xsl:value-of select="//oai:header/oai:identifier"/>
</datacite:identifier> </datacite:identifier>
</datacite:alternateIdentifiers>
<datacite:relatedIdentifiers /> </datacite:alternateIdentifiers>
<datacite:relatedIdentifiers/>
<xsl:for-each select="//base_dc:typenorm"> <xsl:for-each select="//base_dc:typenorm">
<datacite:resourceType><xsl:value-of select="vocabulary:clean(., 'base:normalized_types')" /></datacite:resourceType> <datacite:resourceType>
</xsl:for-each> <xsl:value-of
select="vocabulary:clean(., 'base:normalized_types')"
/>
</datacite:resourceType>
</xsl:for-each>
<datacite:titles> <datacite:titles>
<xsl:for-each select="//dc:title"> <xsl:for-each select="//dc:title">
<datacite:title> <datacite:title>
<xsl:value-of select="normalize-space(.)" /> <xsl:value-of select="normalize-space(.)"/>
</datacite:title> </datacite:title>
</xsl:for-each> </xsl:for-each>
</datacite:titles> </datacite:titles>
<datacite:creators> <datacite:creators>
<xsl:for-each select="//dc:creator"> <xsl:for-each select="//dc:creator">
<xsl:variable name="author" select="normalize-space(.)" /> <xsl:variable name="author"
<datacite:creator> select="normalize-space(.)"/>
<datacite:creatorName> <datacite:creator>
<xsl:value-of select="$author" /> <datacite:creatorName>
</datacite:creatorName> <xsl:value-of select="$author"/>
<xsl:for-each select="//base_dc:authod_id[normalize-space(./base_dc:creator_name) = $author]/base_dc:creator_id "> </datacite:creatorName>
<xsl:if test="contains(.,'https://orcid.org/')"> <xsl:for-each
<nameIdentifier schemeURI="https://orcid.org/" nameIdentifierScheme="ORCID"> select="//base_dc:authod_id[normalize-space(./base_dc:creator_name) = $author]/base_dc:creator_id ">
<xsl:value-of select="substring-after(., 'https://orcid.org/')" /> <xsl:if test="contains(.,'https://orcid.org/')">
</nameIdentifier> <nameIdentifier schemeURI="https://orcid.org/"
</xsl:if> nameIdentifierScheme="ORCID">
</xsl:for-each> <xsl:value-of
</datacite:creator> select="substring-after(., 'https://orcid.org/')"
</xsl:for-each> />
</datacite:creators> </nameIdentifier>
</xsl:if>
</xsl:for-each>
</datacite:creator>
</xsl:for-each>
</datacite:creators>
<datacite:contributors> <datacite:contributors>
<xsl:for-each select="//dc:contributor"> <xsl:for-each select="//dc:contributor">
<datacite:contributor> <datacite:contributor>
<datacite:contributorName> <datacite:contributorName>
<xsl:value-of select="normalize-space(.)" /> <xsl:value-of select="normalize-space(.)"/>
</datacite:contributorName> </datacite:contributorName>
</datacite:contributor> </datacite:contributor>
</xsl:for-each> </xsl:for-each>
</datacite:contributors> </datacite:contributors>
<datacite:descriptions> <datacite:descriptions>
<xsl:for-each select="//dc:description"> <xsl:for-each select="//dc:description">
<datacite:description descriptionType="Abstract"> <datacite:description descriptionType="Abstract">
<xsl:value-of select="normalize-space(.)" /> <xsl:value-of select="normalize-space(.)"/>
</datacite:description> </datacite:description>
</xsl:for-each> </xsl:for-each>
</datacite:descriptions> </datacite:descriptions>
<datacite:subjects> <datacite:subjects>
<xsl:for-each select="//dc:subject"> <xsl:for-each select="//dc:subject">
<datacite:subject> <datacite:subject>
<xsl:value-of select="normalize-space(.)" /> <xsl:value-of select="normalize-space(.)"/>
</datacite:subject> </datacite:subject>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="//base_dc:classcode|//base_dc:autoclasscode">
<datacite:subject subjectScheme="{@type}" classificationCode="{normalize-space(.)}">
<!-- TODO the value should be obtained by the Code -->
<xsl:value-of select="normalize-space(.)" />
</datacite:subject>
</xsl:for-each>
</datacite:subjects>
<xsl:for-each select="//dc:publisher">
<datacite:publisher>
<xsl:value-of select="normalize-space(.)" />
</datacite:publisher>
</xsl:for-each>
<xsl:for-each select="//base_dc:year">
<datacite:publicationYear>
<xsl:value-of select="normalize-space(.)" />
</datacite:publicationYear>
</xsl:for-each>
<datacite:formats>
<xsl:for-each select="//dc:format">
<datacite:format>
<xsl:value-of select="normalize-space(.)" />
</datacite:format>
</xsl:for-each>
</datacite:formats>
<datacite:language>
<xsl:value-of select="vocabulary:clean( //base_dc:lang, 'dnet:languages')" />
</datacite:language>
<oaf:accessrights> <xsl:for-each
<xsl:if test="//base_dc:oa[.='0']"> select="//base_dc:classcode|//base_dc:autoclasscode">
<datacite:rights rightsURI="http://purl.org/coar/access_right/c_16ec">restricted access</datacite:rights> <datacite:subject subjectScheme="{@type}"
</xsl:if> classificationCode="{normalize-space(.)}">
<xsl:if test="//base_dc:oa[.='1']"> <!-- TODO the value should be obtained by the Code -->
<datacite:rights rightsURI="http://purl.org/coar/access_right/c_abf2">open access</datacite:rights> <xsl:value-of select="normalize-space(.)"/>
</xsl:if> </datacite:subject>
<xsl:for-each select="//dc:rights|//base_dc:rightsnorm"> </xsl:for-each>
<datacite:rights><xsl:value-of select="vocabulary:clean(., 'dnet:access_modes')" /></datacite:rights> </datacite:subjects>
</xsl:for-each>
</oaf:accessrights>
</datacite:resource> <xsl:for-each select="//dc:publisher">
<datacite:publisher>
<xsl:value-of select="normalize-space(.)"/>
</datacite:publisher>
</xsl:for-each>
<xsl:for-each select="//dc:relation"> <xsl:for-each select="//base_dc:year">
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', 'i')"> <datacite:publicationYear>
<oaf:projectid> <xsl:value-of select="normalize-space(.)"/>
<xsl:value-of select="concat($varFP7, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))" /> </datacite:publicationYear>
</oaf:projectid> </xsl:for-each>
</xsl:if>
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', 'i')">
<oaf:projectid>
<xsl:value-of select="concat($varH2020, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))" />
</oaf:projectid>
</xsl:if>
</xsl:for-each>
<xsl:choose> <datacite:formats>
<!-- I used an inline mapping because the field typenorm could be repeated and I have to specify a list of priority --> <xsl:for-each select="//dc:format">
<datacite:format>
<!-- Book part --> <xsl:value-of select="normalize-space(.)"/>
<xsl:when test="//base_dc:typenorm = '111'"> </datacite:format>
<dr:CobjCategory type="publication">0013</dr:CobjCategory> </xsl:for-each>
</xsl:when> </datacite:formats>
<!-- Book -->
<xsl:when test="//base_dc:typenorm = '11'">
<dr:CobjCategory type="publication">0002</dr:CobjCategory>
</xsl:when>
<!-- Article contribution -->
<xsl:when test="//base_dc:typenorm = '121'">
<dr:CobjCategory type="publication">0001</dr:CobjCategory>
</xsl:when>
<!-- Journal/Newspaper -->
<xsl:when test="//base_dc:typenorm = '12'">
<dr:CobjCategory type="publication">0043</dr:CobjCategory>
</xsl:when>
<!-- Report -->
<xsl:when test="//base_dc:typenorm = '14'">
<dr:CobjCategory type="publication">0017</dr:CobjCategory>
</xsl:when>
<!-- Review -->
<xsl:when test="//base_dc:typenorm = '15'">
<dr:CobjCategory type="publication">0015</dr:CobjCategory>
</xsl:when>
<!-- Lecture -->
<xsl:when test="//base_dc:typenorm = '17'">
<dr:CobjCategory type="publication">0010</dr:CobjCategory>
</xsl:when>
<!-- Bachelor's thesis -->
<xsl:when test="//base_dc:typenorm = '181'">
<dr:CobjCategory type="publication">0008</dr:CobjCategory>
</xsl:when>
<!-- Master's thesis -->
<xsl:when test="//base_dc:typenorm = '182'">
<dr:CobjCategory type="publication">0007</dr:CobjCategory>
</xsl:when>
<!-- Doctoral and postdoctoral thesis -->
<xsl:when test="//base_dc:typenorm = '183'">
<dr:CobjCategory type="publication">0006</dr:CobjCategory>
</xsl:when>
<!-- Thesis -->
<xsl:when test="//base_dc:typenorm = '18'">
<dr:CobjCategory type="publication">0044</dr:CobjCategory>
</xsl:when>
<!-- Patent -->
<xsl:when test="//base_dc:typenorm = '1A'">
<dr:CobjCategory type="publication">0019</dr:CobjCategory>
</xsl:when>
<!-- Text -->
<xsl:when test="//base_dc:typenorm = '1'">
<dr:CobjCategory type="publication">0001</dr:CobjCategory>
</xsl:when>
<!-- Software -->
<xsl:when test="//base_dc:typenorm = '6'">
<dr:CobjCategory type="software">0029</dr:CobjCategory>
</xsl:when>
<!-- Dataset -->
<xsl:when test="//base_dc:typenorm = '7'">
<dr:CobjCategory type="dataset">0021</dr:CobjCategory>
</xsl:when>
<!-- Still image -->
<xsl:when test="//base_dc:typenorm = '51'">
<dr:CobjCategory type="other">0025</dr:CobjCategory>
</xsl:when>
<!-- Moving image/Video -->
<xsl:when test="//base_dc:typenorm = '52'">
<dr:CobjCategory type="other">0024</dr:CobjCategory>
</xsl:when>
<!-- Image/Video -->
<xsl:when test="//base_dc:typenorm = '5'">
<dr:CobjCategory type="other">0033</dr:CobjCategory>
</xsl:when>
<!-- Audio --> <datacite:language>
<xsl:when test="//base_dc:typenorm = '4'"> <xsl:value-of
<dr:CobjCategory type="other">0030</dr:CobjCategory> select="vocabulary:clean( //base_dc:lang, 'dnet:languages')"
</xsl:when> />
</datacite:language>
<!-- Musical notation -->
<xsl:when test="//base_dc:typenorm = '2'">
<dr:CobjCategory type="other">0020</dr:CobjCategory>
</xsl:when>
<!-- Map -->
<xsl:when test="//base_dc:typenorm = '3'">
<dr:CobjCategory type="other">0020</dr:CobjCategory>
</xsl:when>
<!-- Other non-article -->
<xsl:when test="//base_dc:typenorm = '122'">
<dr:CobjCategory type="publication">0038</dr:CobjCategory>
</xsl:when>
<!-- Course material -->
<xsl:when test="//base_dc:typenorm = '16'">
<dr:CobjCategory type="publication">0038</dr:CobjCategory>
</xsl:when>
<!-- Manuscript -->
<xsl:when test="//base_dc:typenorm = '19'">
<dr:CobjCategory type="publication">0038</dr:CobjCategory>
</xsl:when>
<!-- Conference object -->
<xsl:when test="//base_dc:typenorm = '13'">
<dr:CobjCategory type="publication">0004</dr:CobjCategory>
</xsl:when>
<!-- Unknown --> <!--<datacite:rightsList>
<xsl:when test="//base_dc:typenorm = 'F'"> <xsl:if test="//base_dc:oa[.='0']">
<dr:CobjCategory type="other">0000</dr:CobjCategory> <datacite:rights rightsURI="http://purl.org/coar/access_right/c_16ec">restricted access</datacite:rights>
</xsl:when> </xsl:if>
<xsl:otherwise> <xsl:if test="//base_dc:oa[.='1']">
<dr:CobjCategory type="other">0000</dr:CobjCategory> <datacite:rights rightsURI="http://purl.org/coar/access_right/c_abf2">open access</datacite:rights>
</xsl:otherwise> </xsl:if>
</xsl:choose> <xsl:for-each select="//dc:rights|//base_dc:rightsnorm">
<datacite:rights>
<oaf:accessrights> <xsl:value-of select="vocabulary:clean(., 'dnet:access_modes')"/>
<xsl:choose> </datacite:rights>
<xsl:when test="//base_dc:oa[.='0']">CLOSED</xsl:when> </xsl:for-each>
<xsl:when test="//base_dc:oa[.='1']">OPEN</xsl:when> </datacite:rightsList>-->
<xsl:when test="//base_dc:oa[.='2']">UNKNOWN</xsl:when>
<xsl:when test="//base_dc:rightsnorm">
<xsl:value-of select="vocabulary:clean(//base_dc:rightsnorm, 'dnet:access_modes')" />
</xsl:when>
<xsl:when test="//dc:rights">
<xsl:value-of select="vocabulary:clean( //dc:rights, 'dnet:access_modes')" />
</xsl:when>
<xsl:otherwise>UNKNOWN</xsl:otherwise>
</xsl:choose>
</oaf:accessrights>
<xsl:for-each select="//base_dc:doi"> </datacite:resource>
<oaf:identifier identifierType="doi">
<xsl:value-of select="." />
</oaf:identifier>
</xsl:for-each>
<xsl:for-each <xsl:for-each select="//dc:relation">
select="distinct-values(//dc:identifier[starts-with(., 'http') and ( not(contains(., '://dx.doi.org/') or contains(., '://doi.org/') or contains(., '://hdl.handle.net/')))])"> <xsl:if
<oaf:identifier identifierType="url"> test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', 'i')">
<xsl:value-of select="." /> <oaf:projectid>
</oaf:identifier> <xsl:value-of
</xsl:for-each> select="concat($varFP7, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"
/>
</oaf:projectid>
</xsl:if>
<xsl:if
test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', 'i')">
<oaf:projectid>
<xsl:value-of
select="concat($varH2020, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"
/>
</oaf:projectid>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="distinct-values(//dc:identifier[starts-with(., 'http') and contains(., '://hdl.handle.net/')]/substring-after(., 'hdl.handle.net/'))"> <xsl:choose>
<oaf:identifier identifierType="handle"> <!-- I used an inline mapping because the field typenorm could be repeated and I have to specify a list of priority -->
<xsl:value-of select="." />
</oaf:identifier>
</xsl:for-each>
<xsl:for-each select="distinct-values(//dc:identifier[starts-with(., 'urn:nbn:nl:') or starts-with(., 'URN:NBN:NL:')])"> <!-- Book part -->
<oaf:identifier identifierType='urn'> <xsl:when test="//base_dc:typenorm = '111'">
<xsl:value-of select="." /> <dr:CobjCategory type="publication"
</oaf:identifier> >0013</dr:CobjCategory>
</xsl:for-each> </xsl:when>
<oaf:identifier identifierType="oai-original"> <!-- Book -->
<xsl:value-of <xsl:when test="//base_dc:typenorm = '11'">
select="//oai:header/oai:identifier" /> <dr:CobjCategory type="publication"
</oaf:identifier> >0002</dr:CobjCategory>
</xsl:when>
<oaf:hostedBy> <!-- Article contribution -->
<xsl:attribute name="name"> <xsl:when test="//base_dc:typenorm = '121'">
<xsl:value-of select="//base_dc:collname" /> <dr:CobjCategory type="publication"
</xsl:attribute> >0001</dr:CobjCategory>
<xsl:attribute name="id"> </xsl:when>
<xsl:value-of select="concat('opendoar____::', //base_dc:collection/@opendoar_id)" />
</xsl:attribute>
</oaf:hostedBy>
<oaf:collectedFrom>
<xsl:attribute name="name">
<xsl:value-of select="$varOfficialName" />
</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="$varDataSourceId" />
</xsl:attribute>
</oaf:collectedFrom>
<oaf:dateAccepted> <!-- Journal/Newspaper -->
<xsl:value-of select="dateCleaner:dateISO( //dc:date[1] )" /> <xsl:when test="//base_dc:typenorm = '12'">
</oaf:dateAccepted> <dr:CobjCategory type="publication"
>0043</dr:CobjCategory>
</xsl:when>
<xsl:if test="//base_dc:oa[.='1']"> <!-- Report -->
<xsl:for-each select="//dc:relation[starts-with(., 'http')]"> <xsl:when test="//base_dc:typenorm = '14'">
<oaf:fulltext> <dr:CobjCategory type="publication"
<xsl:value-of select="normalize-space(.)" /> >0017</dr:CobjCategory>
</oaf:fulltext> </xsl:when>
</xsl:for-each>
</xsl:if>
<xsl:for-each select="//base_dc:collection/@ror_id"> <!-- Review -->
<oaf:relation relType="resultOrganization" subRelType="affiliation" relClass="hasAuthorInstitution" targetType="organization"> <xsl:when test="//base_dc:typenorm = '15'">
<xsl:choose> <dr:CobjCategory type="publication"
<xsl:when test="contains(.,'https://ror.org/')"> >0015</dr:CobjCategory>
<xsl:value-of select="concat('ror_________::', normalize-space(.))" /> </xsl:when>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('ror_________::https://ror.org/', normalize-space(.))" />
</xsl:otherwise>
</xsl:choose>
</oaf:relation>
</xsl:for-each>
<oaf:datainfo>
<oaf:inferred>false</oaf:inferred>
<oaf:deletedbyinference>false</oaf:deletedbyinference>
<oaf:trust>0.89</oaf:trust>
<oaf:inferenceprovenance/>
<oaf:provenanceaction classid="sysimport:crosswalk:aggregator"
classname="sysimport:crosswalk:aggregator"
schemeid="dnet:provenanceActions"
schemename="dnet:provenanceActions"/>
</oaf:datainfo>
</metadata>
<xsl:copy-of select="//*[local-name() = 'about']" />
</record>
</xsl:template>
<xsl:template match="//*[local-name() = 'header']"> <!-- Lecture -->
<xsl:if test="//oai:header/@status='deleted'"> <xsl:when test="//base_dc:typenorm = '17'">
<xsl:call-template name="terminate" /> <dr:CobjCategory type="publication"
</xsl:if> >0010</dr:CobjCategory>
<xsl:copy> </xsl:when>
<xsl:apply-templates select="node()|@*" />
<xsl:element name="dr:dateOfTransformation">
<xsl:value-of select="$transDate" />
</xsl:element>
</xsl:copy>
</xsl:template>
<xsl:template match="node()|@*"> <!-- Bachelor's thesis -->
<xsl:copy> <xsl:when test="//base_dc:typenorm = '181'">
<xsl:apply-templates select="node()|@*" /> <dr:CobjCategory type="publication"
</xsl:copy> >0008</dr:CobjCategory>
</xsl:template> </xsl:when>
</xsl:stylesheet>
</CODE> <!-- Master's thesis -->
</SCRIPT> <xsl:when test="//base_dc:typenorm = '182'">
</CONFIGURATION> <dr:CobjCategory type="publication"
<STATUS /> >0007</dr:CobjCategory>
<SECURITY_PARAMETERS /> </xsl:when>
</BODY>
</RESOURCE_PROFILE> <!-- Doctoral and postdoctoral thesis -->
<xsl:when test="//base_dc:typenorm = '183'">
<dr:CobjCategory type="publication"
>0006</dr:CobjCategory>
</xsl:when>
<!-- Thesis -->
<xsl:when test="//base_dc:typenorm = '18'">
<dr:CobjCategory type="publication"
>0044</dr:CobjCategory>
</xsl:when>
<!-- Patent -->
<xsl:when test="//base_dc:typenorm = '1A'">
<dr:CobjCategory type="publication"
>0019</dr:CobjCategory>
</xsl:when>
<!-- Text -->
<xsl:when test="//base_dc:typenorm = '1'">
<dr:CobjCategory type="publication"
>0001</dr:CobjCategory>
</xsl:when>
<!-- Software -->
<xsl:when test="//base_dc:typenorm = '6'">
<dr:CobjCategory type="software">0029</dr:CobjCategory>
</xsl:when>
<!-- Dataset -->
<xsl:when test="//base_dc:typenorm = '7'">
<dr:CobjCategory type="dataset">0021</dr:CobjCategory>
</xsl:when>
<!-- Still image -->
<xsl:when test="//base_dc:typenorm = '51'">
<dr:CobjCategory type="other">0025</dr:CobjCategory>
</xsl:when>
<!-- Moving image/Video -->
<xsl:when test="//base_dc:typenorm = '52'">
<dr:CobjCategory type="other">0024</dr:CobjCategory>
</xsl:when>
<!-- Image/Video -->
<xsl:when test="//base_dc:typenorm = '5'">
<dr:CobjCategory type="other">0033</dr:CobjCategory>
</xsl:when>
<!-- Audio -->
<xsl:when test="//base_dc:typenorm = '4'">
<dr:CobjCategory type="other">0030</dr:CobjCategory>
</xsl:when>
<!-- Musical notation -->
<xsl:when test="//base_dc:typenorm = '2'">
<dr:CobjCategory type="other">0020</dr:CobjCategory>
</xsl:when>
<!-- Map -->
<xsl:when test="//base_dc:typenorm = '3'">
<dr:CobjCategory type="other">0020</dr:CobjCategory>
</xsl:when>
<!-- Other non-article -->
<xsl:when test="//base_dc:typenorm = '122'">
<dr:CobjCategory type="publication"
>0038</dr:CobjCategory>
</xsl:when>
<!-- Course material -->
<xsl:when test="//base_dc:typenorm = '16'">
<dr:CobjCategory type="publication"
>0038</dr:CobjCategory>
</xsl:when>
<!-- Manuscript -->
<xsl:when test="//base_dc:typenorm = '19'">
<dr:CobjCategory type="publication"
>0038</dr:CobjCategory>
</xsl:when>
<!-- Conference object -->
<xsl:when test="//base_dc:typenorm = '13'">
<dr:CobjCategory type="publication"
>0004</dr:CobjCategory>
</xsl:when>
<!-- Unknown -->
<xsl:when test="//base_dc:typenorm = 'F'">
<dr:CobjCategory type="other">0000</dr:CobjCategory>
</xsl:when>
<xsl:otherwise>
<dr:CobjCategory type="other">0000</dr:CobjCategory>
</xsl:otherwise>
</xsl:choose>
<oaf:accessrights>
<xsl:choose>
<xsl:when test="//base_dc:oa[.='0']">CLOSED</xsl:when>
<xsl:when test="//base_dc:oa[.='1']">OPEN</xsl:when>
<xsl:when test="//base_dc:oa[.='2']">UNKNOWN</xsl:when>
<xsl:when test="//base_dc:rightsnorm">
<xsl:value-of
select="vocabulary:clean(//base_dc:rightsnorm, 'dnet:access_modes')"
/>
</xsl:when>
<xsl:when test="//dc:rights">
<xsl:value-of
select="vocabulary:clean( //dc:rights, 'dnet:access_modes')"
/>
</xsl:when>
<xsl:otherwise>UNKNOWN</xsl:otherwise>
</xsl:choose>
</oaf:accessrights>
<xsl:if test="//base_dc:rightsnorm">
<oaf:license><xsl:value-of select="vocabulary:clean(//base_dc:rightsnorm, 'dnet:licenses')" /></oaf:license>
</xsl:if>
<xsl:for-each select="//base_dc:doi">
<oaf:identifier identifierType="doi">
<xsl:value-of select="."/>
</oaf:identifier>
</xsl:for-each>
<xsl:for-each
select="distinct-values(//dc:identifier[starts-with(., 'http') and ( not(contains(., '://dx.doi.org/') or contains(., '://doi.org/') or contains(., '://hdl.handle.net/')))])">
<oaf:identifier identifierType="url">
<xsl:value-of select="."/>
</oaf:identifier>
</xsl:for-each>
<xsl:for-each
select="distinct-values(//dc:identifier[starts-with(., 'http') and contains(., '://hdl.handle.net/')]/substring-after(., 'hdl.handle.net/'))">
<oaf:identifier identifierType="handle">
<xsl:value-of select="."/>
</oaf:identifier>
</xsl:for-each>
<xsl:for-each
select="distinct-values(//dc:identifier[starts-with(., 'urn:nbn:nl:') or starts-with(., 'URN:NBN:NL:')])">
<oaf:identifier identifierType="urn">
<xsl:value-of select="."/>
</oaf:identifier>
</xsl:for-each>
<oaf:identifier identifierType="oai-original">
<xsl:value-of select="//oai:header/oai:identifier"/>
</oaf:identifier>
<oaf:hostedBy>
<xsl:attribute name="name">
<xsl:value-of select="//base_dc:collname"/>
</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of
select="concat('opendoar____::', //base_dc:collection/@opendoar_id)"
/>
</xsl:attribute>
</oaf:hostedBy>
<oaf:collectedFrom>
<xsl:attribute name="name">
<xsl:value-of select="$varOfficialName"/>
</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="$varDataSourceId"/>
</xsl:attribute>
</oaf:collectedFrom>
<oaf:dateAccepted>
<xsl:value-of select="dateCleaner:dateISO( //dc:date[1] )"/>
</oaf:dateAccepted>
<xsl:if test="//base_dc:oa[.='1']">
<xsl:for-each select="//dc:relation[starts-with(., 'http')]">
<oaf:fulltext>
<xsl:value-of select="normalize-space(.)"/>
</oaf:fulltext>
</xsl:for-each>
</xsl:if>
<xsl:for-each select="//base_dc:collection/@ror_id">
<oaf:relation relType="resultOrganization"
subRelType="affiliation" relClass="hasAuthorInstitution"
targetType="organization">
<xsl:choose>
<xsl:when test="contains(.,'https://ror.org/')">
<xsl:value-of
select="concat('ror_________::', normalize-space(.))"
/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="concat('ror_________::https://ror.org/', normalize-space(.))"
/>
</xsl:otherwise>
</xsl:choose>
</oaf:relation>
</xsl:for-each>
<oaf:datainfo>
<oaf:inferred>false</oaf:inferred>
<oaf:deletedbyinference>false</oaf:deletedbyinference>
<oaf:trust>0.89</oaf:trust>
<oaf:inferenceprovenance/>
<oaf:provenanceaction
classid="sysimport:crosswalk:aggregator"
classname="sysimport:crosswalk:aggregator"
schemeid="dnet:provenanceActions"
schemename="dnet:provenanceActions"/>
</oaf:datainfo>
</metadata>
<xsl:copy-of select="//*[local-name() = 'about']"/>
</record>
</xsl:template>
<xsl:template match="//*[local-name() = 'header']">
<xsl:if test="//oai:header/@status='deleted'">
<xsl:call-template name="terminate"/>
</xsl:if>
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
<xsl:element name="dr:dateOfTransformation">
<xsl:value-of select="$transDate"/>
</xsl:element>
</xsl:copy>
</xsl:template>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
</CODE>
</SCRIPT>
</CONFIGURATION>
<STATUS/>
<SECURITY_PARAMETERS/>
</BODY>
</RESOURCE_PROFILE>