Project

General

Profile

1 52327 alessia.ba
<RESOURCE_PROFILE>
2
	<HEADER>
3 52416 alessia.ba
		<RESOURCE_IDENTIFIER value="e84e4409-5a82-4e16-b288-352a2a511678_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4 52327 alessia.ba
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
6
		<RESOURCE_URI value=""/>
7
		<DATE_OF_CREATION value="2018-06-04T11:15:30+00:00"/>
8
	</HEADER>
9
	<BODY>
10
		<CONFIGURATION>
11
			<IMPORTED/>
12
			<SCRIPT>
13
				<TITLE>CORDA H2020 to DB</TITLE>
14
				<CODE>
15 53143 alessia.ba
					<![CDATA[
16 52327 alessia.ba
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
17 49722 alessia.ba
18 52370 miriam.bag
	<xsl:param name="varDataSourceId"/>
19 49722 alessia.ba
20
	<xsl:template name="dateCorda">
21
		<xsl:param name="datename"/>
22
		<xsl:param name="datevalue"/>
23
		<FIELD name="{$datename}" type="date" format="dd-MMM-yyyy">
24
			<xsl:value-of select="concat(substring($datevalue, 1, 2),'-',substring($datevalue,3,3),'-',substring($datevalue,6,4))"/>
25
		</FIELD>
26
	</xsl:template>
27
28
	<xsl:variable name="namespacePrefix" select="string('ec__________')"/>
29
	<xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')"/>
30
31
	<xsl:template match="/">
32
		<record>
33
34
			<xsl:copy-of select=".//*[local-name()='header']"/>
35
36
			<metadata>
37
				<ROWS>
38
					<xsl:for-each select="//Project">
39
40
						<xsl:variable name="toaCode" select="./ProjectTOACode"/>
41
						<xsl:variable name="fundingId">
42
							<xsl:choose>
43
								<xsl:when test="$toaCode and starts-with($toaCode, 'ERC-')">
44
									<xsl:value-of select="concat($funderID, '::H2020::ERC::', $toaCode)"/>
45
								</xsl:when>
46
								<xsl:when test="$toaCode and not(starts-with($toaCode, 'ERC-'))">
47
									<xsl:value-of select="concat($funderID, '::H2020::', $toaCode)"/>
48
								</xsl:when>
49
								<xsl:otherwise>
50
									<xsl:value-of select="concat($funderID, '::H2020')"/>
51
								</xsl:otherwise>
52
							</xsl:choose>
53
						</xsl:variable>
54
						<xsl:variable name="projectId" select="concat('corda__h2020::', normalize-space(./ProjectId))"/>
55
56
						<ROW table="projects">
57
							<FIELD name="_dnet_resource_identifier_">
58
								<xsl:value-of select="$projectId"/>
59
							</FIELD>
60
							<FIELD name="id">
61
								<xsl:value-of select="$projectId"/>
62
							</FIELD>
63 52335 alessia.ba
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
64 49722 alessia.ba
							<FIELD name="code">
65
								<xsl:value-of select="./ProjectId"/>
66
							</FIELD>
67
							<FIELD name="acronym">
68
								<xsl:value-of select="./ProjectAcronym"/>
69
							</FIELD>
70
							<FIELD name="title">
71
								<xsl:value-of select="./ProjectTitle"/>
72
							</FIELD>
73
							<xsl:call-template name="dateCorda">
74
								<xsl:with-param name="datename">startdate</xsl:with-param>
75
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
76
							</xsl:call-template>
77
							<xsl:call-template name="dateCorda">
78
								<xsl:with-param name="datename">enddate</xsl:with-param>
79
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
80
							</xsl:call-template>
81
							<FIELD name="call_identifier">
82
								<xsl:value-of select="./ProjectCallIdentifier"/>
83
							</FIELD>
84
							<FIELD name="oa_mandate_for_publications" type="boolean">true</FIELD>
85
							<FIELD name="ec_article29_3" type="boolean">
86
								<xsl:value-of select="./Article29-3"/>
87
							</FIELD>
88
							<FIELD name="collectedfrom">
89 52372 miriam.bag
								<xsl:value-of select="$varDataSourceId"/>
90 49722 alessia.ba
							</FIELD>
91
							<FIELD name="contracttypeclass">
92
								<xsl:value-of select="./ProjectTOACode"/>
93
							</FIELD>
94
							<FIELD name="contracttypescheme">ec:h2020toas</FIELD>
95
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
96
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
97
							<FIELD name="websiteurl">
98
								<xsl:value-of select="./ProjectInternetAddress"/>
99
							</FIELD>
100
							<FIELD name="optional1">
101
								<xsl:value-of select="./ProjectTopicCode"/>
102
							</FIELD>
103
							<FIELD name="optional2">
104
								<xsl:value-of select="./ProjectTopicDescr"/>
105
							</FIELD>
106 57276 miriam.bag
							<FIELD name="summary">
107
                                <xsl:value-of select="./ProjectAbstract"/>
108
                            </FIELD>
109
                            <FIELD name="totalcost" type="float">
110
                                <xsl:value-of select="./ProjectTotalCosts"/>
111
                            </FIELD>
112
                            <FIELD name="fundedamount" type="float">
113
                                <xsl:value-of select="/ProjectRequestedEUContrib"/>
114
                            </FIELD>
115
                            <FIELD name="currency">
116
                                <xsl:value-of select="string('EUR')"/>
117
                            </FIELD>
118 49722 alessia.ba
							<xsl:variable name="personSurname" select="normalize-space(./CoordinatorContactPerson/PersonLastName)"/>
119
							<xsl:variable name="personFirstName" select="normalize-space(./CoordinatorContactPerson/PersonFirstName)"/>
120
							<xsl:variable name="contactfullname">
121
								<xsl:choose>
122
									<xsl:when test="string-length($personFirstName) &gt; 0 and string-length($personSurname) &gt; 0">
123
										<xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/>
124
									</xsl:when>
125
									<xsl:when test="string-length($personFirstName) &gt; 0">
126
										<xsl:value-of select="$personFirstName"/>
127
									</xsl:when>
128
									<xsl:when test="string-length($personSurname) &gt; 0">
129
										<xsl:value-of select="$personSurname"/>
130
									</xsl:when>
131
									<xsl:otherwise>
132
										<xsl:value-of select="''"/>
133
									</xsl:otherwise>
134
								</xsl:choose>
135
							</xsl:variable>
136
							<xsl:if test="string-length($contactfullname) &gt; 0">
137
								<FIELD name="contactfullname">
138
									<xsl:value-of select="$contactfullname"/>
139
								</FIELD>
140
							</xsl:if>
141
							<xsl:variable name="contactfax" select="normalize-space(./CoordinatorContactPerson/ContactFax)"/>
142
							<xsl:if test="string-length($contactfax) &gt; 0">
143
								<FIELD name="contactfax">
144
									<xsl:value-of select="$contactfax"/>
145
								</FIELD>
146
							</xsl:if>
147
							<xsl:variable name="contactphone" select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/>
148
							<xsl:if test="string-length($contactphone) &gt; 0">
149
								<FIELD name="contactphone">
150
									<xsl:value-of select="$contactphone"/>
151
								</FIELD>
152
							</xsl:if>
153
							<xsl:variable name="contactemail" select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/>
154
							<xsl:if test="string-length($contactemail) &gt; 0">
155
								<FIELD name="contactemail">
156
									<xsl:value-of select="$contactemail"/>
157
								</FIELD>
158
							</xsl:if>
159
						</ROW>
160
						<xsl:for-each select="./OrganisationParticipant">
161
							<xsl:variable name="organizationId" select="concat('corda__h2020::', ./OrganisationPIC)"/>
162
163
							<xsl:variable name="whitelist" select="'0123456789'"/>
164 52327 alessia.ba
							<ROW table="dsm_organizations">
165 49722 alessia.ba
								<FIELD name="_dnet_resource_identifier_">
166
									<xsl:value-of select="$organizationId"/>
167
								</FIELD>
168
								<FIELD name="id">
169
									<xsl:value-of select="$organizationId"/>
170
								</FIELD>
171 52335 alessia.ba
								<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
172 49722 alessia.ba
								<FIELD name="legalshortname">
173
									<xsl:value-of select="./OrganisationShortName"/>
174
								</FIELD>
175
								<FIELD name="legalname">
176
									<xsl:value-of select="./OrganisationLegalName"/>
177
								</FIELD>
178
								<FIELD name="websiteurl">
179
									<xsl:choose>
180
										<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')">
181
											<xsl:value-of select="./OrganisationWebPage"/>
182
										</xsl:when>
183
										<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) &gt; 0">
184
											<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/>
185
										</xsl:when>
186
									</xsl:choose>
187
								</FIELD>
188
								<FIELD name="ec_legalbody" type="boolean">
189
									<xsl:value-of select="./PublicBody"/>
190
								</FIELD>
191
								<FIELD name="ec_legalperson" type="boolean">
192
									<xsl:value-of select="./LegalPerson"/>
193
								</FIELD>
194
								<FIELD name="ec_nonprofit" type="boolean">
195
									<xsl:value-of select="./NonProfit"/>
196
								</FIELD>
197
								<FIELD name="ec_researchorganization" type="boolean">
198
									<xsl:value-of select="./ResearchOrganisation"/>
199
								</FIELD>
200
								<FIELD name="ec_highereducation" type="boolean">
201
									<xsl:value-of select="./HigherEducation"/>
202
								</FIELD>
203
								<FIELD name="ec_internationalorganizationeurinterests" type="boolean">
204
									<xsl:value-of select="./InternationalOrgEurInterest"/>
205
								</FIELD>
206
								<FIELD name="ec_internationalorganization" type="boolean">
207
									<xsl:value-of select="./InternationalOrgEurInterest"/>
208
								</FIELD>
209
								<FIELD name="ec_smevalidated" type="boolean">
210
									<xsl:value-of select="./SMEValidated"/>
211
								</FIELD>
212 52966 miriam.bag
								<FIELD name="country">
213 49722 alessia.ba
									<xsl:value-of select="./OrganisationCountry"/>
214
								</FIELD>
215
								<FIELD name="collectedfrom">
216 52372 miriam.bag
									<xsl:value-of select="$varDataSourceId"/>
217 49722 alessia.ba
								</FIELD>
218 52337 miriam.bag
								<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
219 49722 alessia.ba
								<FIELD name="trust" type="float">
220 50391 alessia.ba
									<xsl:value-of select="0.81"/>
221 49722 alessia.ba
								</FIELD>
222
							</ROW>
223
224
							<ROW table="project_organization">
225
								<FIELD name="_dnet_resource_identifier_">
226
									<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
227
								</FIELD>
228
								<xsl:choose>
229
									<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0">
230
										<FIELD name="participantnumber" type="int">9999</FIELD>
231
									</xsl:when>
232
									<xsl:otherwise>
233
										<FIELD name="participantnumber" type="int">
234
											<xsl:value-of select="./ParticipantOrder"/>
235
										</FIELD>
236
									</xsl:otherwise>
237
								</xsl:choose>
238 52420 alessia.ba
								<FIELD name="project">
239 49722 alessia.ba
									<xsl:value-of select="$projectId"/>
240
								</FIELD>
241 52420 alessia.ba
								<FIELD name="resporganization">
242 49722 alessia.ba
									<xsl:value-of select="$organizationId"/>
243
								</FIELD>
244 57276 miriam.bag
							<FIELD name="contribution" type="float">
245
                                    <xsl:value-of select="./ParticipantRequestedEUContrib"/>
246
                                </FIELD>
247 49722 alessia.ba
								<xsl:choose>
248
									<xsl:when test="./ParticipantOrder = 1">
249 52369 miriam.bag
										<FIELD name="semanticclass">coordinator</FIELD>
250 49722 alessia.ba
									</xsl:when>
251
									<xsl:otherwise>
252 52369 miriam.bag
										<FIELD name="semanticclass">participant</FIELD>
253 49722 alessia.ba
									</xsl:otherwise>
254
								</xsl:choose>
255
							</ROW>
256
						</xsl:for-each>
257
258
						<ROW table="subjects">
259
							<FIELD name="_dnet_resource_identifier_">
260
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
261
							</FIELD>
262
							<FIELD name="id">
263
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
264
							</FIELD>
265
							<FIELD name="name">
266
								<xsl:value-of select="./ProjectTopicDescr"/>
267
							</FIELD>
268
							<FIELD name="semanticclass">ec:h2020topics</FIELD>
269
							<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD>
270
						</ROW>
271
272
						<ROW table="project_subject">
273
							<FIELD name="_dnet_resource_identifier_">
274
								<xsl:value-of select="concat($projectId, '@@corda__h2020::', normalize-space(./ProjectTopicCode))"/>
275
							</FIELD>
276
							<FIELD name="project">
277
								<xsl:value-of select="$projectId"/>
278
							</FIELD>
279
							<FIELD name="subject">
280
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
281
							</FIELD>
282
						</ROW>
283
284
						<ROW table="project_fundingpath">
285
							<FIELD name="_dnet_resource_identifier_">
286
								<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
287
							</FIELD>
288
							<FIELD name="funding">
289
								<xsl:value-of select="$fundingId"/>
290
							</FIELD>
291
							<FIELD name="project">
292
								<xsl:value-of select="$projectId"/>
293
							</FIELD>
294
							<xsl:call-template name="dateCorda">
295
								<xsl:with-param name="datename">startdate</xsl:with-param>
296
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
297
							</xsl:call-template>
298
							<xsl:call-template name="dateCorda">
299
								<xsl:with-param name="datename">enddate</xsl:with-param>
300
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
301
							</xsl:call-template>
302
							<FIELD name="semanticclass">
303
								<xsl:value-of select="./ProjectTOACode"/>
304
							</FIELD>
305
							<FIELD name="semanticscheme">ec:h2020toas</FIELD>
306
						</ROW>
307
					</xsl:for-each>
308
309
				</ROWS>
310
			</metadata>
311
		</record>
312
	</xsl:template>
313
</xsl:stylesheet>
314 53143 alessia.ba
					]]>
315 52327 alessia.ba
				</CODE>
316
			</SCRIPT>
317
		</CONFIGURATION>
318
		<STATUS/>
319
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
320
	</BODY>
321
</RESOURCE_PROFILE>