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="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
							<xsl:variable name="personSurname" select="normalize-space(./CoordinatorContactPerson/PersonLastName)"/>
107
							<xsl:variable name="personFirstName" select="normalize-space(./CoordinatorContactPerson/PersonFirstName)"/>
108
							<xsl:variable name="contactfullname">
109
								<xsl:choose>
110
									<xsl:when test="string-length($personFirstName) &gt; 0 and string-length($personSurname) &gt; 0">
111
										<xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/>
112
									</xsl:when>
113
									<xsl:when test="string-length($personFirstName) &gt; 0">
114
										<xsl:value-of select="$personFirstName"/>
115
									</xsl:when>
116
									<xsl:when test="string-length($personSurname) &gt; 0">
117
										<xsl:value-of select="$personSurname"/>
118
									</xsl:when>
119
									<xsl:otherwise>
120
										<xsl:value-of select="''"/>
121
									</xsl:otherwise>
122
								</xsl:choose>
123
							</xsl:variable>
124
							<xsl:if test="string-length($contactfullname) &gt; 0">
125
								<FIELD name="contactfullname">
126
									<xsl:value-of select="$contactfullname"/>
127
								</FIELD>
128
							</xsl:if>
129
							<xsl:variable name="contactfax" select="normalize-space(./CoordinatorContactPerson/ContactFax)"/>
130
							<xsl:if test="string-length($contactfax) &gt; 0">
131
								<FIELD name="contactfax">
132
									<xsl:value-of select="$contactfax"/>
133
								</FIELD>
134
							</xsl:if>
135
							<xsl:variable name="contactphone" select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/>
136
							<xsl:if test="string-length($contactphone) &gt; 0">
137
								<FIELD name="contactphone">
138
									<xsl:value-of select="$contactphone"/>
139
								</FIELD>
140
							</xsl:if>
141
							<xsl:variable name="contactemail" select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/>
142
							<xsl:if test="string-length($contactemail) &gt; 0">
143
								<FIELD name="contactemail">
144
									<xsl:value-of select="$contactemail"/>
145
								</FIELD>
146
							</xsl:if>
147
						</ROW>
148
						<xsl:for-each select="./OrganisationParticipant">
149
							<xsl:variable name="organizationId" select="concat('corda__h2020::', ./OrganisationPIC)"/>
150

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

    
212
							<ROW table="project_organization">
213
								<FIELD name="_dnet_resource_identifier_">
214
									<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
215
								</FIELD>
216
								<xsl:choose>
217
									<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0">
218
										<FIELD name="participantnumber" type="int">9999</FIELD>
219
									</xsl:when>
220
									<xsl:otherwise>
221
										<FIELD name="participantnumber" type="int">
222
											<xsl:value-of select="./ParticipantOrder"/>
223
										</FIELD>
224
									</xsl:otherwise>
225
								</xsl:choose>
226
								<FIELD name="project">
227
									<xsl:value-of select="$projectId"/>
228
								</FIELD>
229
								<FIELD name="resporganization">
230
									<xsl:value-of select="$organizationId"/>
231
								</FIELD>
232
								<xsl:choose>
233
									<xsl:when test="./ParticipantOrder = 1">
234
										<FIELD name="semanticclass">coordinator</FIELD>
235
									</xsl:when>
236
									<xsl:otherwise>
237
										<FIELD name="semanticclass">participant</FIELD>
238
									</xsl:otherwise>
239
								</xsl:choose>
240
							</ROW>
241
						</xsl:for-each>
242

    
243
						<ROW table="subjects">
244
							<FIELD name="_dnet_resource_identifier_">
245
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
246
							</FIELD>
247
							<FIELD name="id">
248
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
249
							</FIELD>
250
							<FIELD name="name">
251
								<xsl:value-of select="./ProjectTopicDescr"/>
252
							</FIELD>
253
							<FIELD name="semanticclass">ec:h2020topics</FIELD>
254
							<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD>
255
						</ROW>
256

    
257
						<ROW table="project_subject">
258
							<FIELD name="_dnet_resource_identifier_">
259
								<xsl:value-of select="concat($projectId, '@@corda__h2020::', normalize-space(./ProjectTopicCode))"/>
260
							</FIELD>
261
							<FIELD name="project">
262
								<xsl:value-of select="$projectId"/>
263
							</FIELD>
264
							<FIELD name="subject">
265
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
266
							</FIELD>
267
						</ROW>
268

    
269
						<ROW table="project_fundingpath">
270
							<FIELD name="_dnet_resource_identifier_">
271
								<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
272
							</FIELD>
273
							<FIELD name="funding">
274
								<xsl:value-of select="$fundingId"/>
275
							</FIELD>
276
							<FIELD name="project">
277
								<xsl:value-of select="$projectId"/>
278
							</FIELD>
279
							<xsl:call-template name="dateCorda">
280
								<xsl:with-param name="datename">startdate</xsl:with-param>
281
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
282
							</xsl:call-template>
283
							<xsl:call-template name="dateCorda">
284
								<xsl:with-param name="datename">enddate</xsl:with-param>
285
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
286
							</xsl:call-template>
287
							<FIELD name="semanticclass">
288
								<xsl:value-of select="./ProjectTOACode"/>
289
							</FIELD>
290
							<FIELD name="semanticscheme">ec:h2020toas</FIELD>
291
						</ROW>
292
					</xsl:for-each>
293

    
294
				</ROWS>
295
			</metadata>
296
		</record>
297
	</xsl:template>
298
</xsl:stylesheet>
299
					]]>
300
				</CODE>
301
			</SCRIPT>
302
		</CONFIGURATION>
303
		<STATUS/>
304
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
305
	</BODY>
306
</RESOURCE_PROFILE>
(5-5/22)