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
							<ROW table="project_organization">
228
								<FIELD name="_dnet_resource_identifier_">
229
									<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
230
								</FIELD>
231
								<xsl:choose>
232
									<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0">
233
										<FIELD name="participantnumber" type="int">9999</FIELD>
234
									</xsl:when>
235
									<xsl:otherwise>
236
										<FIELD name="participantnumber" type="int">
237
											<xsl:value-of select="./ParticipantOrder"/>
238
										</FIELD>
239
									</xsl:otherwise>
240
								</xsl:choose>
241
								<FIELD name="project">
242
									<xsl:value-of select="$projectId"/>
243
								</FIELD>
244
								<FIELD name="resporganization">
245
									<xsl:value-of select="$organizationId"/>
246
								</FIELD>
247
							    <xsl:if test="number(./ParticipantRequestedEUContrib)">
248
                                    <FIELD name="contribution" type="float">
249
                                    <xsl:value-of select="./ParticipantRequestedEUContrib"/>
250
                                </FIELD>
251
                                <FIELD name="currency">
252
                                <xsl:value-of select="string('EUR')"/>
253
                           </FIELD>
254
                                </xsl:if>
255
								<xsl:choose>
256
									<xsl:when test="./ParticipantOrder = 1">
257
										<FIELD name="semanticclass">coordinator</FIELD>
258
									</xsl:when>
259
									<xsl:otherwise>
260
										<FIELD name="semanticclass">participant</FIELD>
261
									</xsl:otherwise>
262
								</xsl:choose>
263
							</ROW>
264
						</xsl:for-each>
265

    
266
						<ROW table="subjects">
267
							<FIELD name="_dnet_resource_identifier_">
268
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
269
							</FIELD>
270
							<FIELD name="id">
271
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
272
							</FIELD>
273
							<FIELD name="name">
274
								<xsl:value-of select="./ProjectTopicDescr"/>
275
							</FIELD>
276
							<FIELD name="semanticclass">ec:h2020topics</FIELD>
277
							<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD>
278
						</ROW>
279

    
280
						<ROW table="project_subject">
281
							<FIELD name="_dnet_resource_identifier_">
282
								<xsl:value-of select="concat($projectId, '@@corda__h2020::', normalize-space(./ProjectTopicCode))"/>
283
							</FIELD>
284
							<FIELD name="project">
285
								<xsl:value-of select="$projectId"/>
286
							</FIELD>
287
							<FIELD name="subject">
288
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
289
							</FIELD>
290
						</ROW>
291

    
292
						<ROW table="project_fundingpath">
293
							<FIELD name="_dnet_resource_identifier_">
294
								<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
295
							</FIELD>
296
							<FIELD name="funding">
297
								<xsl:value-of select="$fundingId"/>
298
							</FIELD>
299
							<FIELD name="project">
300
								<xsl:value-of select="$projectId"/>
301
							</FIELD>
302
							<xsl:call-template name="dateCorda">
303
								<xsl:with-param name="datename">startdate</xsl:with-param>
304
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
305
							</xsl:call-template>
306
							<xsl:call-template name="dateCorda">
307
								<xsl:with-param name="datename">enddate</xsl:with-param>
308
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
309
							</xsl:call-template>
310
							<FIELD name="semanticclass">
311
								<xsl:value-of select="./ProjectTOACode"/>
312
							</FIELD>
313
							<FIELD name="semanticscheme">ec:h2020toas</FIELD>
314
						</ROW>
315
					</xsl:for-each>
316

    
317
				</ROWS>
318
			</metadata>
319
		</record>
320
	</xsl:template>
321
</xsl:stylesheet>
322
					]]>
323
				</CODE>
324
			</SCRIPT>
325
		</CONFIGURATION>
326
		<STATUS/>
327
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
328
	</BODY>
329
</RESOURCE_PROFILE>
(6-6/27)