Project

General

Profile

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
		>
21

    
22
			<xsl:copy-of select=".//*[local-name()='header']"/>
23

    
24
			<metadata>
25
				<ROWS>
26
					<xsl:for-each select="//Project">
27

    
28
						<xsl:variable name="specificName">
29
							<xsl:choose>
30
								<xsl:when test="normalize-space(./ProjectSpecificProgram)">
31
									<xsl:value-of select="normalize-space(./ProjectSpecificProgram)"/>
32
								</xsl:when>
33
								<xsl:otherwise>
34
									<xsl:value-of select="string('UNKNOWN')"/>
35
								</xsl:otherwise>
36
							</xsl:choose>
37
						</xsl:variable>
38

    
39
						<xsl:variable name="specificDesc" select="./ProjectSpecificProgramDescr"/>
40
						<xsl:variable name="specificId" select="normalize-space(concat($funderID, '::FP7::', $specificName))"/>
41

    
42
						<xsl:variable name="projectProgramName">
43
							<xsl:choose>
44
								<xsl:when test="normalize-space(./ProjectProgram)">
45
									<xsl:value-of select="normalize-space(./ProjectProgram)"/>
46
								</xsl:when>
47
								<xsl:otherwise>
48
									<xsl:value-of select="string('UNKNOWN')"/>
49
								</xsl:otherwise>
50
							</xsl:choose>
51
						</xsl:variable>
52

    
53
						<xsl:variable name="projectProgramDesc" select="./ProjectProgramDescr"/>
54
						<xsl:variable name="projectProgramId" select="concat($funderID, '::FP7::', $specificName, '::', $projectProgramName)"/>
55
						<xsl:variable name="projectId" select="concat('corda_______::', normalize-space(./ProjectId))"/>
56

    
57
						<FIELD name="collectedfrom">
58
							<xsl:value-of select="$parentDatasourceId"/>
59
						</FIELD>
60
						<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
61
						<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
62

    
63
						<!-- 
64
						<ROW table="fundings">
65
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$specificId" /></FIELD>
66
							<FIELD name="id"><xsl:value-of select="$specificId" /></FIELD>
67
							<FIELD name="name"><xsl:value-of select="$specificName" /></FIELD>
68
							<FIELD name="description"><xsl:value-of select="$specificDesc" /></FIELD>
69
							<FIELD name="semanticclass">ec:specificprogram</FIELD>
70
							<FIELD name="semanticscheme">ec:funding_typologies</FIELD>
71
						</ROW>
72
						
73
						<ROW table="fundings">
74
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectProgramId" /></FIELD>
75
							<FIELD name="id"><xsl:value-of select="$projectProgramId" /></FIELD>
76
							<FIELD name="name"><xsl:value-of select="$projectProgramName" /></FIELD>
77
							<FIELD name="description"><xsl:value-of select="$projectProgramDesc" /></FIELD>
78
							<FIELD name="semanticclass">ec:program</FIELD>
79
							<FIELD name="semanticscheme">ec:funding_typologies</FIELD>
80
						</ROW>
81
						
82
						<ROW table="funding_funding">
83
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($specificId, '@@corda_______::FP7')" /></FIELD>
84
							<FIELD name="funding1"><xsl:value-of select="$specificId" /></FIELD>
85
							<FIELD name="funding2">corda_______::FP7</FIELD>
86
							<FIELD name="semanticclass">ec:hasframeworkprogram</FIELD>
87
							<FIELD name="semanticscheme">ec:funding_relations</FIELD>
88
						</ROW>
89
						
90
						<ROW table="funding_funding">
91
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectProgramId, '@@', $specificId)" /></FIELD>
92
							<FIELD name="funding1"><xsl:value-of select="$projectProgramId" /></FIELD>
93
							<FIELD name="funding2"><xsl:value-of select="$specificId" /></FIELD>
94
							<FIELD name="semanticclass">ec:hasspecificprogram</FIELD>
95
							<FIELD name="semanticscheme">ec:funding_relations</FIELD>
96
						</ROW>
97
						-->
98

    
99
						<ROW table="projects">
100
							<FIELD name="_dnet_resource_identifier_">
101
								<xsl:value-of select="$projectId"/>
102
							</FIELD>
103
							<FIELD name="id">
104
								<xsl:value-of select="$projectId"/>
105
							</FIELD>
106
							<FIELD name="code">
107
								<xsl:value-of select="./ProjectId"/>
108
							</FIELD>
109
							<FIELD name="acronym">
110
								<xsl:value-of select="./ProjectAcronym"/>
111
							</FIELD>
112
							<FIELD name="title">
113
								<xsl:value-of select="./ProjectTitle"/>
114
							</FIELD>
115
							<xsl:call-template name="dateCorda">
116
								<xsl:with-param name="datename">startdate</xsl:with-param>
117
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
118
							</xsl:call-template>
119
							<xsl:call-template name="dateCorda">
120
								<xsl:with-param name="datename">enddate</xsl:with-param>
121
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
122
							</xsl:call-template>
123
							<FIELD name="call_identifier">
124
								<xsl:value-of select="./ProjectCallIdentifier"/>
125
							</FIELD>
126
							<FIELD name="ec_sc39" type="boolean">
127
								<xsl:value-of select="./SpecialClause39"/>
128
							</FIELD>
129
							<FIELD name="oa_mandate_for_publications" type="boolean">
130
								<xsl:value-of select="./SpecialClause39"/>
131
							</FIELD>
132
							<FIELD name="collectedfrom">
133
								<xsl:value-of select="$parentDatasourceId"/>
134
							</FIELD>
135
							<FIELD name="contracttypeclass">
136
								<xsl:value-of select="./ProjectFundingScheme"/>
137
							</FIELD>
138
							<FIELD name="contracttypescheme">ec:FP7contractTypes</FIELD>
139
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
140
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
141
							<FIELD name="websiteurl">
142
								<xsl:value-of select="./ProjectInternetAddress"/>
143
							</FIELD>
144
							<FIELD name="optional1">
145
								<xsl:value-of select="./ProjectSubFundingScheme"/>
146
							</FIELD>
147
							<FIELD name="optional2">
148
								<xsl:value-of select="./ProjectCallWebpageUrl"/>
149
							</FIELD>
150
							<xsl:variable name="personSurname" select="./CoordinatorContactPerson/PersonLastName"/>
151
							<xsl:variable name="personFirstName" select="./CoordinatorContactPerson/PersonFirstName"/>
152
							<xsl:variable name="contactfullname">
153
								<xsl:choose>
154
									<xsl:when test="string-length($personFirstName) &gt; 0 and string-length($personSurname) &gt; 0">
155
										<xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/>
156
									</xsl:when>
157
									<xsl:when test="string-length($personFirstName) &gt; 0">
158
										<xsl:value-of select="normalize-space($personFirstName)"/>
159
									</xsl:when>
160
									<xsl:when test="string-length($personSurname) &gt; 0">
161
										<xsl:value-of select="normalize-space($personSurname)"/>
162
									</xsl:when>
163
									<xsl:otherwise>
164
										<xsl:value-of select="''"/>
165
									</xsl:otherwise>
166
								</xsl:choose>
167
							</xsl:variable>
168
							<xsl:if test="string-length($contactfullname) &gt; 0">
169
								<FIELD name="contactfullname">
170
									<xsl:value-of select="$contactfullname"/>
171
								</FIELD>
172
							</xsl:if>
173
							<xsl:variable name="contactfax" select="normalize-space(./CoordinatorContactPerson/ContactFax)"/>
174
							<xsl:if test="string-length($contactfax) &gt; 0">
175
								<FIELD name="contactfax">
176
									<xsl:value-of select="$contactfax"/>
177
								</FIELD>
178
							</xsl:if>
179
							<xsl:variable name="contactphone" select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/>
180
							<xsl:if test="string-length($contactphone) &gt; 0">
181
								<FIELD name="contactphone">
182
									<xsl:value-of select="$contactphone"/>
183
								</FIELD>
184
							</xsl:if>
185
							<xsl:variable name="contactemail" select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/>
186
							<xsl:if test="string-length($contactemail) &gt; 0">
187
								<FIELD name="contactemail">
188
									<xsl:value-of select="$contactemail"/>
189
								</FIELD>
190
							</xsl:if>
191
						</ROW>
192

    
193
						<!-- 
194
						<ROW table="project_funding">
195
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectProgramId, '@@', $projectId)" /></FIELD>
196
							<FIELD name="funding"><xsl:value-of select="$projectProgramId" /></FIELD>
197
							<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
198
							<xsl:call-template name="dateCorda">
199
								<xsl:with-param name="datename">startdate</xsl:with-param>
200
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
201
							</xsl:call-template>
202
							<xsl:call-template name="dateCorda">
203
								<xsl:with-param name="datename">enddate</xsl:with-param>
204
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
205
							</xsl:call-template> 
206
							<FIELD name="semanticclass"><xsl:value-of select="./ProjectFundingScheme" /></FIELD>
207
							<FIELD name="semanticscheme">ec:FP7contractTypes</FIELD>
208
						</ROW>
209
						-->
210

    
211
						<ROW table="project_fundingpath">
212
							<FIELD name="_dnet_resource_identifier_">
213
								<xsl:value-of select="concat($projectProgramId, '@@', $projectId)"/>
214
							</FIELD>
215
							<FIELD name="funding">
216
								<xsl:value-of select="$projectProgramId"/>
217
							</FIELD>
218
							<FIELD name="project">
219
								<xsl:value-of select="$projectId"/>
220
							</FIELD>
221
							<xsl:call-template name="dateCorda">
222
								<xsl:with-param name="datename">startdate</xsl:with-param>
223
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
224
							</xsl:call-template>
225
							<xsl:call-template name="dateCorda">
226
								<xsl:with-param name="datename">enddate</xsl:with-param>
227
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
228
							</xsl:call-template>
229
							<FIELD name="semanticclass">
230
								<xsl:value-of select="./ProjectFundingScheme"/>
231
							</FIELD>
232
							<FIELD name="semanticscheme">ec:FP7contractTypes</FIELD>
233
						</ROW>
234
					</xsl:for-each>
235

    
236
					<xsl:for-each select="//OrganisationParticipant">
237
						<xsl:variable name="organizationId" select="concat('corda_______::', ./OrganisationPIC)"/>
238
						<xsl:variable name="projectId" select="concat('corda_______::', normalize-space(../ProjectId))"/>
239
						<xsl:variable name="whitelist" select="'0123456789'"/>
240
						<ROW table="organizations">
241
							<FIELD name="_dnet_resource_identifier_">
242
								<xsl:value-of select="$organizationId"/>
243
							</FIELD>
244
							<FIELD name="id">
245
								<xsl:value-of select="$organizationId"/>
246
							</FIELD>
247
							<FIELD name="legalshortname">
248
								<xsl:value-of select="./OrganisationShortName"/>
249
							</FIELD>
250
							<FIELD name="legalname">
251
								<xsl:value-of select="./OrganisationLegalName"/>
252
							</FIELD>
253
							<FIELD name="websiteurl">
254
								<xsl:choose>
255
									<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')">
256
										<xsl:value-of select="./OrganisationWebPage"/>
257
									</xsl:when>
258
									<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) &gt; 0">
259
										<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/>
260
									</xsl:when>
261
								</xsl:choose>
262
							</FIELD>
263
							<FIELD name="ec_legalbody" type="boolean">
264
								<xsl:value-of select="./PublicBody"/>
265
							</FIELD>
266
							<FIELD name="ec_legalperson" type="boolean">
267
								<xsl:value-of select="./LegalPerson"/>
268
							</FIELD>
269
							<FIELD name="ec_nonprofit" type="boolean">
270
								<xsl:value-of select="./NonProfit"/>
271
							</FIELD>
272
							<FIELD name="ec_researchorganization" type="boolean">
273
								<xsl:value-of select="./ResearchOrganisation"/>
274
							</FIELD>
275
							<FIELD name="ec_highereducation" type="boolean">
276
								<xsl:value-of select="./HigherEducation"/>
277
							</FIELD>
278
							<FIELD name="ec_internationalorganizationeurinterests" type="boolean">
279
								<xsl:value-of select="./InternationalOrgEurInterest"/>
280
							</FIELD>
281
							<FIELD name="ec_internationalorganization" type="boolean">
282
								<xsl:value-of select="./InternationalOrgEurInterest"/>
283
							</FIELD>
284
							<FIELD name="ec_enterprise" type="boolean">
285
								<xsl:value-of select="./Enterprise"/>
286
							</FIELD>
287
							<FIELD name="ec_smevalidated" type="boolean">
288
								<xsl:value-of select="./SMEValidated"/>
289
							</FIELD>
290
							<FIELD name="countryclass">
291
								<xsl:value-of select="./OrganisationCountry"/>
292
							</FIELD>
293
							<FIELD name="countryscheme">dnet:countries</FIELD>
294
							<FIELD name="collectedfrom">
295
								<xsl:value-of select="$parentDatasourceId"/>
296
							</FIELD>
297
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
298
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
299
							<FIELD name="trust" type="float">
300
								<xsl:value-of select="0.91"/>
301
							</FIELD>
302
						</ROW>
303

    
304
						<ROW table="project_organization">
305
							<FIELD name="_dnet_resource_identifier_">
306
								<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
307
							</FIELD>
308
							<xsl:choose>
309
								<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0">
310
									<FIELD name="participantnumber" type="int">9999</FIELD>
311
								</xsl:when>
312
								<xsl:otherwise>
313
									<FIELD name="participantnumber" type="int">
314
										<xsl:value-of select="./ParticipantOrder"/>
315
									</FIELD>
316
								</xsl:otherwise>
317
							</xsl:choose>
318
							<FIELD name="project">
319
								<xsl:value-of select="$projectId"/>
320
							</FIELD>
321
							<FIELD name="resporganization">
322
								<xsl:value-of select="$organizationId"/>
323
							</FIELD>
324
							<xsl:choose>
325
								<xsl:when test="./ParticipantOrder = 1">
326
									<FIELD name="semanticclass">coordinator</FIELD>
327
								</xsl:when>
328
								<xsl:otherwise>
329
									<FIELD name="semanticclass">participant</FIELD>
330
								</xsl:otherwise>
331
							</xsl:choose>
332
							<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
333
						</ROW>
334
					</xsl:for-each>
335
				</ROWS>
336
			</metadata>
337
		</record>
338
	</xsl:template>
339
</xsl:stylesheet>
(3-3/27)