1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3
|
>
|
4
|
|
5
|
<xsl:param name="parentDatasourceId"/>
|
6
|
|
7
|
<xsl:template name="dateCorda">
|
8
|
<xsl:param name="datename"/>
|
9
|
<xsl:param name="datevalue"/>
|
10
|
<FIELD name="{$datename}" type="date" format="dd-MMM-yyyy">
|
11
|
<xsl:value-of select="concat(substring($datevalue, 1, 2),'-',substring($datevalue,3,3),'-',substring($datevalue,6,4))"/>
|
12
|
</FIELD>
|
13
|
</xsl:template>
|
14
|
|
15
|
<xsl:variable name="namespacePrefix" select="string('ec__________')"/>
|
16
|
<xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')"/>
|
17
|
|
18
|
<xsl:template match="/">
|
19
|
<record>
|
20
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
21
|
<metadata>
|
22
|
<ROWS>
|
23
|
<xsl:for-each select="//Project">
|
24
|
<xsl:variable name="fundingId" select="concat($funderID, '::H2020')"/>
|
25
|
<xsl:variable name="projectId" select="concat('corda__h2020::', normalize-space(./ProjectId))"/>
|
26
|
<ROW table="projects">
|
27
|
<FIELD name="_dnet_resource_identifier_">
|
28
|
<xsl:value-of select="$projectId"/>
|
29
|
</FIELD>
|
30
|
<FIELD name="id">
|
31
|
<xsl:value-of select="$projectId"/>
|
32
|
</FIELD>
|
33
|
<FIELD name="code">
|
34
|
<xsl:value-of select="./ProjectId"/>
|
35
|
</FIELD>
|
36
|
<FIELD name="acronym">
|
37
|
<xsl:value-of select="./ProjectAcronym"/>
|
38
|
</FIELD>
|
39
|
<FIELD name="title">
|
40
|
<xsl:value-of select="./ProjectTitle"/>
|
41
|
</FIELD>
|
42
|
<xsl:call-template name="dateCorda">
|
43
|
<xsl:with-param name="datename">startdate</xsl:with-param>
|
44
|
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
|
45
|
</xsl:call-template>
|
46
|
<xsl:call-template name="dateCorda">
|
47
|
<xsl:with-param name="datename">enddate</xsl:with-param>
|
48
|
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
|
49
|
</xsl:call-template>
|
50
|
<FIELD name="call_identifier">
|
51
|
<xsl:value-of select="./ProjectCallIdentifier"/>
|
52
|
</FIELD>
|
53
|
<FIELD name="oa_mandate_for_publications" type="boolean">true</FIELD>
|
54
|
<FIELD name="ec_article29_3" type="boolean">
|
55
|
<xsl:value-of select="./Article29-3"/>
|
56
|
</FIELD>
|
57
|
<FIELD name="collectedfrom">
|
58
|
<xsl:value-of select="$parentDatasourceId"/>
|
59
|
</FIELD>
|
60
|
<FIELD name="contracttypeclass">
|
61
|
<xsl:value-of select="./ProjectTOACode"/>
|
62
|
</FIELD>
|
63
|
<FIELD name="contracttypescheme">ec:h2020toas</FIELD>
|
64
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
65
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
66
|
<FIELD name="websiteurl">
|
67
|
<xsl:value-of select="./ProjectInternetAddress"/>
|
68
|
</FIELD>
|
69
|
<FIELD name="optional1">
|
70
|
<xsl:value-of select="./ProjectTopicCode"/>
|
71
|
</FIELD>
|
72
|
<FIELD name="optional2">
|
73
|
<xsl:value-of select="./ProjectTopicDescr"/>
|
74
|
</FIELD>
|
75
|
<xsl:variable name="personSurname" select="./CoordinatorContactPerson/PersonLastName"/>
|
76
|
<xsl:variable name="personFirstName" select="./CoordinatorContactPerson/PersonFirstName"/>
|
77
|
<xsl:variable name="contactfullname">
|
78
|
<xsl:choose>
|
79
|
<xsl:when test="string-length($personFirstName) > 0 and string-length($personSurname) > 0">
|
80
|
<xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/>
|
81
|
</xsl:when>
|
82
|
<xsl:when test="string-length($personFirstName) > 0">
|
83
|
<xsl:value-of select="normalize-space($personFirstName)"/>
|
84
|
</xsl:when>
|
85
|
<xsl:when test="string-length($personSurname) > 0">
|
86
|
<xsl:value-of select="normalize-space($personSurname)"/>
|
87
|
</xsl:when>
|
88
|
<xsl:otherwise>
|
89
|
<xsl:value-of select="''"/>
|
90
|
</xsl:otherwise>
|
91
|
</xsl:choose>
|
92
|
</xsl:variable>
|
93
|
<xsl:if test="string-length($contactfullname) > 0">
|
94
|
<FIELD name="contactfullname">
|
95
|
<xsl:value-of select="$contactfullname"/>
|
96
|
</FIELD>
|
97
|
</xsl:if>
|
98
|
<xsl:variable name="contactfax" select="normalize-space(./CoordinatorContactPerson/ContactFax)"/>
|
99
|
<xsl:if test="string-length($contactfax) > 0">
|
100
|
<FIELD name="contactfax">
|
101
|
<xsl:value-of select="$contactfax"/>
|
102
|
</FIELD>
|
103
|
</xsl:if>
|
104
|
<xsl:variable name="contactphone" select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/>
|
105
|
<xsl:if test="string-length($contactphone) > 0">
|
106
|
<FIELD name="contactphone">
|
107
|
<xsl:value-of select="$contactphone"/>
|
108
|
</FIELD>
|
109
|
</xsl:if>
|
110
|
<xsl:variable name="contactemail" select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/>
|
111
|
<xsl:if test="string-length($contactemail) > 0">
|
112
|
<FIELD name="contactemail">
|
113
|
<xsl:value-of select="$contactemail"/>
|
114
|
</FIELD>
|
115
|
</xsl:if>
|
116
|
</ROW>
|
117
|
|
118
|
<xsl:for-each select="./OrganisationParticipant">
|
119
|
<xsl:variable name="organizationId" select="concat('corda__h2020::', ./OrganisationPIC)"/>
|
120
|
|
121
|
<xsl:variable name="whitelist" select="'0123456789'"/>
|
122
|
<ROW table="organizations">
|
123
|
<FIELD name="_dnet_resource_identifier_">
|
124
|
<xsl:value-of select="$organizationId"/>
|
125
|
</FIELD>
|
126
|
<FIELD name="id">
|
127
|
<xsl:value-of select="$organizationId"/>
|
128
|
</FIELD>
|
129
|
<FIELD name="legalshortname">
|
130
|
<xsl:value-of select="./OrganisationShortName"/>
|
131
|
</FIELD>
|
132
|
<FIELD name="legalname">
|
133
|
<xsl:value-of select="./OrganisationLegalName"/>
|
134
|
</FIELD>
|
135
|
<FIELD name="websiteurl">
|
136
|
<xsl:choose>
|
137
|
<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')">
|
138
|
<xsl:value-of select="./OrganisationWebPage"/>
|
139
|
</xsl:when>
|
140
|
<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) > 0">
|
141
|
<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/>
|
142
|
</xsl:when>
|
143
|
</xsl:choose>
|
144
|
</FIELD>
|
145
|
<FIELD name="ec_legalbody" type="boolean">
|
146
|
<xsl:value-of select="./PublicBody"/>
|
147
|
</FIELD>
|
148
|
<FIELD name="ec_legalperson" type="boolean">
|
149
|
<xsl:value-of select="./LegalPerson"/>
|
150
|
</FIELD>
|
151
|
<FIELD name="ec_nonprofit" type="boolean">
|
152
|
<xsl:value-of select="./NonProfit"/>
|
153
|
</FIELD>
|
154
|
<FIELD name="ec_researchorganization" type="boolean">
|
155
|
<xsl:value-of select="./ResearchOrganisation"/>
|
156
|
</FIELD>
|
157
|
<FIELD name="ec_highereducation" type="boolean">
|
158
|
<xsl:value-of select="./HigherEducation"/>
|
159
|
</FIELD>
|
160
|
<FIELD name="ec_internationalorganizationeurinterests" type="boolean">
|
161
|
<xsl:value-of select="./InternationalOrgEurInterest"/>
|
162
|
</FIELD>
|
163
|
<FIELD name="ec_internationalorganization" type="boolean">
|
164
|
<xsl:value-of select="./InternationalOrgEurInterest"/>
|
165
|
</FIELD>
|
166
|
<FIELD name="ec_smevalidated" type="boolean">
|
167
|
<xsl:value-of select="./SMEValidated"/>
|
168
|
</FIELD>
|
169
|
<FIELD name="countryclass">
|
170
|
<xsl:value-of select="./OrganisationCountry"/>
|
171
|
</FIELD>
|
172
|
<FIELD name="countryscheme">dnet:countries</FIELD>
|
173
|
<FIELD name="collectedfrom">
|
174
|
<xsl:value-of select="$parentDatasourceId"/>
|
175
|
</FIELD>
|
176
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
177
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
178
|
<FIELD name="trust" type="float">
|
179
|
<xsl:value-of select="0.92"/>
|
180
|
</FIELD>
|
181
|
</ROW>
|
182
|
|
183
|
<ROW table="project_organization">
|
184
|
<FIELD name="_dnet_resource_identifier_">
|
185
|
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
|
186
|
</FIELD>
|
187
|
<xsl:choose>
|
188
|
<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) > 0">
|
189
|
<FIELD name="participantnumber" type="int">9999</FIELD>
|
190
|
</xsl:when>
|
191
|
<xsl:otherwise>
|
192
|
<FIELD name="participantnumber" type="int">
|
193
|
<xsl:value-of select="./ParticipantOrder"/>
|
194
|
</FIELD>
|
195
|
</xsl:otherwise>
|
196
|
</xsl:choose>
|
197
|
<FIELD name="project">
|
198
|
<xsl:value-of select="$projectId"/>
|
199
|
</FIELD>
|
200
|
<FIELD name="resporganization">
|
201
|
<xsl:value-of select="$organizationId"/>
|
202
|
</FIELD>
|
203
|
<xsl:choose>
|
204
|
<xsl:when test="./ParticipantOrder = 1">
|
205
|
<FIELD name="semanticclass">coordinator</FIELD>
|
206
|
</xsl:when>
|
207
|
<xsl:otherwise>
|
208
|
<FIELD name="semanticclass">participant</FIELD>
|
209
|
</xsl:otherwise>
|
210
|
</xsl:choose>
|
211
|
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
|
212
|
</ROW>
|
213
|
</xsl:for-each>
|
214
|
|
215
|
<ROW table="subjects">
|
216
|
<FIELD name="_dnet_resource_identifier_">
|
217
|
<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
|
218
|
</FIELD>
|
219
|
<FIELD name="id">
|
220
|
<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
|
221
|
</FIELD>
|
222
|
<FIELD name="name">
|
223
|
<xsl:value-of select="./ProjectTopicDescr"/>
|
224
|
</FIELD>
|
225
|
<FIELD name="semanticclass">ec:h2020topics</FIELD>
|
226
|
<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD>
|
227
|
</ROW>
|
228
|
|
229
|
<ROW table="project_subject">
|
230
|
<FIELD name="_dnet_resource_identifier_">
|
231
|
<xsl:value-of select="concat($projectId, '@@corda__h2020::', normalize-space(./ProjectTopicCode))"/>
|
232
|
</FIELD>
|
233
|
<FIELD name="project">
|
234
|
<xsl:value-of select="$projectId"/>
|
235
|
</FIELD>
|
236
|
<FIELD name="subject">
|
237
|
<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
|
238
|
</FIELD>
|
239
|
</ROW>
|
240
|
|
241
|
<ROW table="project_fundingpath">
|
242
|
<FIELD name="_dnet_resource_identifier_">
|
243
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
244
|
</FIELD>
|
245
|
<FIELD name="funding">
|
246
|
<xsl:value-of select="$fundingId"/>
|
247
|
</FIELD>
|
248
|
<FIELD name="project">
|
249
|
<xsl:value-of select="$projectId"/>
|
250
|
</FIELD>
|
251
|
<xsl:call-template name="dateCorda">
|
252
|
<xsl:with-param name="datename">startdate</xsl:with-param>
|
253
|
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
|
254
|
</xsl:call-template>
|
255
|
<xsl:call-template name="dateCorda">
|
256
|
<xsl:with-param name="datename">enddate</xsl:with-param>
|
257
|
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
|
258
|
</xsl:call-template>
|
259
|
<FIELD name="semanticclass">
|
260
|
<xsl:value-of select="./ProjectTOACode"/>
|
261
|
</FIELD>
|
262
|
<FIELD name="semanticscheme">ec:h2020toas</FIELD>
|
263
|
</ROW>
|
264
|
</xsl:for-each>
|
265
|
|
266
|
</ROWS>
|
267
|
</metadata>
|
268
|
</record>
|
269
|
</xsl:template>
|
270
|
</xsl:stylesheet>
|