Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="e84e4409-5a82-4e16-b288-352a2a511678_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
		<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
					<![CDATA[
16
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
17

    
18
	<xsl:param name="varDataSourceId"/>
19

    
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
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
64
							<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
								<xsl:value-of select="$varDataSourceId"/>
90
							</FIELD>
91
							<FIELD name="contracttypeclass">
92
								<xsl:value-of select="./ProjectTOACode"/>
93
							</FIELD>
94
							<FIELD name="contracttypescheme">ec:h2020toas</FIELD>
95
<!--							<FIELD name="contracttypename">-->
96
<!--								<xsl:value-of select="./ProjectTOADescr"/>-->
97
<!--							</FIELD>-->
98
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
99
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
100
							<FIELD name="websiteurl">
101
								<xsl:value-of select="./ProjectInternetAddress"/>
102
							</FIELD>
103
							<FIELD name="optional1">
104
								<xsl:value-of select="./ProjectTopicCode"/>
105
							</FIELD>
106
							<FIELD name="optional2">
107
								<xsl:value-of select="./ProjectTopicDescr"/>
108
							</FIELD>
109
							<FIELD name="summary">
110
                                <xsl:value-of select="./ProjectAbstract"/>
111
                            </FIELD>
112
                            <FIELD name="totalcost" type="float">
113
                                <xsl:value-of select="./ProjectTotalCosts"/>
114
                            </FIELD>
115
                            <FIELD name="fundedamount" type="float">
116
                                <xsl:value-of select="./ProjectRequestedEUContrib"/>
117
                            </FIELD>
118
                            <FIELD name="currency">
119
                                <xsl:value-of select="string('EUR')"/>
120
                            </FIELD>
121
							<xsl:variable name="personSurname" select="normalize-space(./CoordinatorContactPerson/PersonLastName)"/>
122
							<xsl:variable name="personFirstName" select="normalize-space(./CoordinatorContactPerson/PersonFirstName)"/>
123
							<xsl:variable name="contactfullname">
124
								<xsl:choose>
125
									<xsl:when test="string-length($personFirstName) &gt; 0 and string-length($personSurname) &gt; 0">
126
										<xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/>
127
									</xsl:when>
128
									<xsl:when test="string-length($personFirstName) &gt; 0">
129
										<xsl:value-of select="$personFirstName"/>
130
									</xsl:when>
131
									<xsl:when test="string-length($personSurname) &gt; 0">
132
										<xsl:value-of select="$personSurname"/>
133
									</xsl:when>
134
									<xsl:otherwise>
135
										<xsl:value-of select="''"/>
136
									</xsl:otherwise>
137
								</xsl:choose>
138
							</xsl:variable>
139
							<xsl:if test="string-length($contactfullname) &gt; 0">
140
								<FIELD name="contactfullname">
141
									<xsl:value-of select="$contactfullname"/>
142
								</FIELD>
143
							</xsl:if>
144
							<xsl:variable name="contactfax" select="normalize-space(./CoordinatorContactPerson/ContactFax)"/>
145
							<xsl:if test="string-length($contactfax) &gt; 0">
146
								<FIELD name="contactfax">
147
									<xsl:value-of select="$contactfax"/>
148
								</FIELD>
149
							</xsl:if>
150
							<xsl:variable name="contactphone" select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/>
151
							<xsl:if test="string-length($contactphone) &gt; 0">
152
								<FIELD name="contactphone">
153
									<xsl:value-of select="$contactphone"/>
154
								</FIELD>
155
							</xsl:if>
156
							<xsl:variable name="contactemail" select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/>
157
							<xsl:if test="string-length($contactemail) &gt; 0">
158
								<FIELD name="contactemail">
159
									<xsl:value-of select="$contactemail"/>
160
								</FIELD>
161
							</xsl:if>
162
						</ROW>
163
						<xsl:for-each select="./OrganisationParticipant">
164
							<xsl:variable name="organizationId" select="concat('corda__h2020::', ./OrganisationPIC)"/>
165

    
166
							<xsl:variable name="whitelist" select="'0123456789'"/>
167
							<ROW table="dsm_organizations">
168
								<FIELD name="_dnet_resource_identifier_">
169
									<xsl:value-of select="$organizationId"/>
170
								</FIELD>
171
								<FIELD name="id">
172
									<xsl:value-of select="$organizationId"/>
173
								</FIELD>
174
								<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
175
								<FIELD name="legalshortname">
176
									<xsl:value-of select="./OrganisationShortName"/>
177
								</FIELD>
178
								<FIELD name="legalname">
179
									<xsl:value-of select="./OrganisationLegalName"/>
180
								</FIELD>
181
								<FIELD name="websiteurl">
182
									<xsl:choose>
183
										<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')">
184
											<xsl:value-of select="./OrganisationWebPage"/>
185
										</xsl:when>
186
										<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) &gt; 0">
187
											<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/>
188
										</xsl:when>
189
									</xsl:choose>
190
								</FIELD>
191
								<FIELD name="ec_legalbody" type="boolean">
192
									<xsl:value-of select="./PublicBody"/>
193
								</FIELD>
194
								<FIELD name="ec_legalperson" type="boolean">
195
									<xsl:value-of select="./LegalPerson"/>
196
								</FIELD>
197
								<FIELD name="ec_nonprofit" type="boolean">
198
									<xsl:value-of select="./NonProfit"/>
199
								</FIELD>
200
								<FIELD name="ec_researchorganization" type="boolean">
201
									<xsl:value-of select="./ResearchOrganisation"/>
202
								</FIELD>
203
								<FIELD name="ec_highereducation" type="boolean">
204
									<xsl:value-of select="./HigherEducation"/>
205
								</FIELD>
206
								<FIELD name="ec_internationalorganizationeurinterests" type="boolean">
207
									<xsl:value-of select="./InternationalOrgEurInterest"/>
208
								</FIELD>
209
								<FIELD name="ec_internationalorganization" type="boolean">
210
									<xsl:value-of select="./InternationalOrgEurInterest"/>
211
								</FIELD>
212
								<FIELD name="ec_smevalidated" type="boolean">
213
									<xsl:value-of select="./SMEValidated"/>
214
								</FIELD>
215
								<FIELD name="country">
216
									<xsl:value-of select="./OrganisationCountry"/>
217
								</FIELD>
218
								<FIELD name="collectedfrom">
219
									<xsl:value-of select="$varDataSourceId"/>
220
								</FIELD>
221
								<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
222
								<FIELD name="trust" type="float">
223
									<xsl:value-of select="0.81"/>
224
								</FIELD>
225
							</ROW>
226

    
227
						 <xsl:variable name="organizationPIC" select="./OrganisationPIC"/>
228
                         <ROW table="dsm_identities">
229
                            <FIELD name="_dnet_resource_identifier_">
230
                                <xsl:value-of
231
                                        select="concat(./OrganisationPIC, '@@PIC')"/>
232
                            </FIELD>
233
                            <FIELD name="pid">
234
                                <xsl:value-of select="$organizationPIC"/>
235
                            </FIELD>
236
                            <FIELD name="issuertype">PIC</FIELD>
237
                        </ROW>
238
                        <ROW table="dsm_organizationpids">
239
                            <FIELD name="_dnet_resource_identifier_">
240
                                <xsl:value-of select="concat($organizationPIC, '@@', $organizationId)"/>
241
                            </FIELD>
242
                            <FIELD name="pid">
243
                                <xsl:value-of select="$organizationPIC"/>
244
                            </FIELD>
245
                            <FIELD name="organization">
246
                                <xsl:value-of select="$organizationId"/>
247
                            </FIELD>
248
                        </ROW>
249

    
250

    
251
							<ROW table="project_organization">
252
								<FIELD name="_dnet_resource_identifier_">
253
									<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
254
								</FIELD>
255
								<xsl:choose>
256
									<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0">
257
										<FIELD name="participantnumber" type="int">9999</FIELD>
258
									</xsl:when>
259
									<xsl:otherwise>
260
										<FIELD name="participantnumber" type="int">
261
											<xsl:value-of select="./ParticipantOrder"/>
262
										</FIELD>
263
									</xsl:otherwise>
264
								</xsl:choose>
265
								<FIELD name="project">
266
									<xsl:value-of select="$projectId"/>
267
								</FIELD>
268
								<FIELD name="resporganization">
269
									<xsl:value-of select="$organizationId"/>
270
								</FIELD>
271
							    <xsl:if test="number(./ParticipantRequestedEUContrib)">
272
                                    <FIELD name="contribution" type="float">
273
                                    <xsl:value-of select="./ParticipantRequestedEUContrib"/>
274
                                </FIELD>
275
                                <FIELD name="currency">
276
                                <xsl:value-of select="string('EUR')"/>
277
                           </FIELD>
278
                                </xsl:if>
279
								<xsl:choose>
280
									<xsl:when test="./ParticipantOrder = 1">
281
										<FIELD name="semanticclass">coordinator</FIELD>
282
									</xsl:when>
283
									<xsl:otherwise>
284
										<FIELD name="semanticclass">participant</FIELD>
285
									</xsl:otherwise>
286
								</xsl:choose>
287
							</ROW>
288
						</xsl:for-each>
289

    
290
						<ROW table="subjects">
291
							<FIELD name="_dnet_resource_identifier_">
292
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
293
							</FIELD>
294
							<FIELD name="id">
295
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
296
							</FIELD>
297
							<FIELD name="name">
298
								<xsl:value-of select="./ProjectTopicDescr"/>
299
							</FIELD>
300
							<FIELD name="semanticclass">ec:h2020topics</FIELD>
301
							<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD>
302
						</ROW>
303

    
304
						<ROW table="project_subject">
305
							<FIELD name="_dnet_resource_identifier_">
306
								<xsl:value-of select="concat($projectId, '@@corda__h2020::', normalize-space(./ProjectTopicCode))"/>
307
							</FIELD>
308
							<FIELD name="project">
309
								<xsl:value-of select="$projectId"/>
310
							</FIELD>
311
							<FIELD name="subject">
312
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
313
							</FIELD>
314
						</ROW>
315

    
316
						<ROW table="project_fundingpath">
317
							<FIELD name="_dnet_resource_identifier_">
318
								<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
319
							</FIELD>
320
							<FIELD name="funding">
321
								<xsl:value-of select="$fundingId"/>
322
							</FIELD>
323
							<FIELD name="project">
324
								<xsl:value-of select="$projectId"/>
325
							</FIELD>
326
							<xsl:call-template name="dateCorda">
327
								<xsl:with-param name="datename">startdate</xsl:with-param>
328
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
329
							</xsl:call-template>
330
							<xsl:call-template name="dateCorda">
331
								<xsl:with-param name="datename">enddate</xsl:with-param>
332
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
333
							</xsl:call-template>
334
							<FIELD name="semanticclass">
335
								<xsl:value-of select="./ProjectTOACode"/>
336
							</FIELD>
337
							<FIELD name="semanticscheme">ec:h2020toas</FIELD>
338
						</ROW>
339
					</xsl:for-each>
340

    
341
				</ROWS>
342
			</metadata>
343
		</record>
344
	</xsl:template>
345
</xsl:stylesheet>
346
					]]>
347
				</CODE>
348
			</SCRIPT>
349
		</CONFIGURATION>
350
		<STATUS/>
351
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
352
	</BODY>
353
</RESOURCE_PROFILE>
(7-7/32)