1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3
|
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/"
|
4
|
xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
5
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
6
|
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:fn="http://www.w3.org/2005/xpath-functions"
|
7
|
exclude-result-prefixes="xs" version="2.0">
|
8
|
|
9
|
<xsl:param name="parentDatasourceId"/>
|
10
|
<xsl:param name="namespacePrefix"/>
|
11
|
|
12
|
<xsl:variable name="invalid" select="' ,-'" />
|
13
|
<xsl:variable name="valid" select="'___'" />
|
14
|
|
15
|
<xsl:template match="/">
|
16
|
<record xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
17
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
18
|
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
19
|
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
|
20
|
|
21
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
22
|
|
23
|
<metadata>
|
24
|
<ROWS>
|
25
|
<xsl:for-each select="//project">
|
26
|
<xsl:call-template name="projectTemplate" />
|
27
|
</xsl:for-each>
|
28
|
</ROWS>
|
29
|
</metadata>
|
30
|
|
31
|
</record>
|
32
|
</xsl:template>
|
33
|
|
34
|
<xsl:template name="projectTemplate">
|
35
|
|
36
|
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', ./id)" />
|
37
|
<xsl:variable name="projectAcronym" select="./reference"/>
|
38
|
<xsl:variable name="tokens" select="tokenize(./reference,'/')"/>
|
39
|
<xsl:variable name="callID" select="concat($tokens[1], '/', $tokens[last()])"/>
|
40
|
|
41
|
<ROW table="projects">
|
42
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectId" /></FIELD>
|
43
|
<FIELD name="id"><xsl:value-of select="$projectId" /></FIELD>
|
44
|
<FIELD name="code"><xsl:value-of select="./id" /></FIELD>
|
45
|
<FIELD name="call_identifier"> <xsl:value-of select="$callID"/></FIELD>
|
46
|
<FIELD name="websiteurl"><xsl:value-of select="./refUri" /></FIELD>
|
47
|
<FIELD name="acronym"><xsl:value-of select="./reference" /></FIELD>
|
48
|
<FIELD name="title"><xsl:value-of select="./name" /></FIELD>
|
49
|
<FIELD name="startdate" type="date" format="dd/MM/yyyy"><xsl:value-of select="./startDate" /></FIELD>
|
50
|
<FIELD name="enddate" type="date" format="dd/MM/yyyy"><xsl:value-of select="./endDate" /></FIELD>
|
51
|
<FIELD name="keywords"><xsl:for-each select="./classification/elem"><xsl:if test="position() > 1">, </xsl:if><xsl:value-of select="."/></xsl:for-each></FIELD>
|
52
|
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId"/></FIELD>
|
53
|
<FIELD name="contracttypeclass">UNKNOWN</FIELD>
|
54
|
<FIELD name="contracttypescheme">fct:contractTypes</FIELD>
|
55
|
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD>
|
56
|
</ROW>
|
57
|
|
58
|
<!--
|
59
|
<xsl:for-each select="./persons/elem">
|
60
|
<xsl:if test="string-length(./name) > 0 and string-length(./researcherId) > 0">
|
61
|
|
62
|
<xsl:variable name="orgId" select="concat($projectId, '::', translate(./organization, $invalid, $valid))" />
|
63
|
<ROW table="organizations">
|
64
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$orgId" /></FIELD>
|
65
|
<FIELD name="id"><xsl:value-of select="$orgId" /></FIELD>
|
66
|
<FIELD name="legalshortname"><xsl:value-of select="./organization" /></FIELD>
|
67
|
<FIELD name="legalname"><xsl:value-of select="./organization" /></FIELD>
|
68
|
<FIELD name="countryclass"><xsl:value-of select="./country" /></FIELD>
|
69
|
<FIELD name="countryscheme">dnet:countries</FIELD>
|
70
|
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
|
71
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
72
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
73
|
</ROW>
|
74
|
<xsl:variable name="personId" select="concat($projectId, '::', ./researcherId)"/>
|
75
|
<ROW table="persons">
|
76
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$personId" /></FIELD>
|
77
|
<FIELD name="id"><xsl:value-of select="$personId" /></FIELD>
|
78
|
<FIELD name="firstname"><xsl:value-of select="./name" /></FIELD>
|
79
|
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
|
80
|
<FIELD name="nationalityClass"><xsl:value-of select="./country" /></FIELD>
|
81
|
<FIELD name="nationalityScheme">dnet:countries</FIELD>
|
82
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
83
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
84
|
<FIELD name="optional1"><xsl:value-of select="./role" /></FIELD>
|
85
|
</ROW>
|
86
|
<ROW table="project_organization">
|
87
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($orgId, '@@', $projectId)" /></FIELD>
|
88
|
<FIELD name="participantnumber" type="int"><xsl:value-of select="position()" /></FIELD>
|
89
|
<FIELD name="startdate" type="date" format="dd/MM/yyyy"><xsl:value-of select="../../startDate"/></FIELD>
|
90
|
<FIELD name="enddate" type="date" format="dd/MM/yyyy"><xsl:value-of select="../../endDate"/></FIELD>
|
91
|
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
|
92
|
<FIELD name="resporganization"><xsl:value-of select="$orgId" /></FIELD>
|
93
|
<FIELD name="contactperson"><xsl:value-of select="$personId" /></FIELD>
|
94
|
<FIELD name="semanticclass">participant</FIELD>
|
95
|
</ROW>
|
96
|
<ROW table="identities">
|
97
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="./researcherId" /></FIELD>
|
98
|
<FIELD name="pid"><xsl:value-of select="./researcherId" /></FIELD>
|
99
|
<FIELD name="issuertypeclass">fct:researcher_ids</FIELD>
|
100
|
<FIELD name="issuertypescheme">dnet:pid_types</FIELD>
|
101
|
</ROW>
|
102
|
<ROW table="personpids">
|
103
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat(./researcherId, '@@', $personId)" /></FIELD>
|
104
|
<FIELD name="pid"><xsl:value-of select="./researcherId" /></FIELD>
|
105
|
<FIELD name="person"><xsl:value-of select="$personId" /></FIELD>
|
106
|
</ROW>
|
107
|
<xsl:if test="string-length(normalize-space(./orcidId)) > 0">
|
108
|
<ROW table="identities">
|
109
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="./orcidId" /></FIELD>
|
110
|
<FIELD name="pid"><xsl:value-of select="./orcidId" /></FIELD>
|
111
|
<FIELD name="issuertypeclass">orcid</FIELD>
|
112
|
<FIELD name="issuertypescheme">dnet:pid_types</FIELD>
|
113
|
</ROW>
|
114
|
<ROW table="personpids">
|
115
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat(./orcidId, '@@', $personId)" /></FIELD>
|
116
|
<FIELD name="pid"><xsl:value-of select="./orcidId" /></FIELD>
|
117
|
<FIELD name="person"><xsl:value-of select="$personId" /></FIELD>
|
118
|
</ROW>
|
119
|
</xsl:if>
|
120
|
</xsl:if>
|
121
|
</xsl:for-each>
|
122
|
-->
|
123
|
|
124
|
<xsl:for-each select="./funding">
|
125
|
|
126
|
<xsl:variable name="fundingName" select="normalize-space(./program)" />
|
127
|
<xsl:if test="string-length($fundingName) > 0">
|
128
|
<xsl:variable name="fundingId" select="concat($namespacePrefix,'::FCT::',$fundingName)" />
|
129
|
<ROW table="project_fundingpath">
|
130
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($fundingId, '@@', $projectId)" /></FIELD>
|
131
|
<FIELD name="funding"><xsl:value-of select="$fundingId" /></FIELD>
|
132
|
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
|
133
|
<FIELD name="startdate" type="date" format="dd/MM/yyyy"><xsl:value-of select="../startDate" /></FIELD>
|
134
|
<FIELD name="enddate" type="date" format="dd/MM/yyyy"><xsl:value-of select="../endDate" /></FIELD>
|
135
|
<FIELD name="optional1"><xsl:value-of select="./amount" /></FIELD>
|
136
|
<FIELD name="optional2"><xsl:value-of select="./dateAwarded" /></FIELD>
|
137
|
</ROW>
|
138
|
</xsl:if>
|
139
|
</xsl:for-each>
|
140
|
|
141
|
</xsl:template>
|
142
|
</xsl:stylesheet>
|