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
			<xsl:copy-of select=".//*[local-name()='header']"/>
21
			<metadata>
22
				<ROWS>
23
					<xsl:for-each select="//Project">
24

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

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

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

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

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

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

    
184
						<!-- 
185
						<ROW table="project_funding">
186
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectProgramId, '@@', $projectId)" /></FIELD>
187
							<FIELD name="funding"><xsl:value-of select="$projectProgramId" /></FIELD>
188
							<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
189
							<xsl:call-template name="dateCorda">
190
								<xsl:with-param name="datename">startdate</xsl:with-param>
191
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
192
							</xsl:call-template>
193
							<xsl:call-template name="dateCorda">
194
								<xsl:with-param name="datename">enddate</xsl:with-param>
195
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
196
							</xsl:call-template> 
197
							<FIELD name="semanticclass"><xsl:value-of select="./ProjectFundingScheme" /></FIELD>
198
							<FIELD name="semanticscheme">ec:FP7contractTypes</FIELD>
199
						</ROW>
200
						-->
201

    
202
						<ROW table="project_fundingpath">
203
							<FIELD name="_dnet_resource_identifier_">
204
								<xsl:value-of select="concat($projectProgramId, '@@', $projectId)"/>
205
							</FIELD>
206
							<FIELD name="funding">
207
								<xsl:value-of select="$projectProgramId"/>
208
							</FIELD>
209
							<FIELD name="project">
210
								<xsl:value-of select="$projectId"/>
211
							</FIELD>
212
							<xsl:call-template name="dateCorda">
213
								<xsl:with-param name="datename">startdate</xsl:with-param>
214
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
215
							</xsl:call-template>
216
							<xsl:call-template name="dateCorda">
217
								<xsl:with-param name="datename">enddate</xsl:with-param>
218
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
219
							</xsl:call-template>
220
							<FIELD name="semanticclass">
221
								<xsl:value-of select="./ProjectFundingScheme"/>
222
							</FIELD>
223
							<FIELD name="semanticscheme">ec:FP7contractTypes</FIELD>
224
						</ROW>
225
					</xsl:for-each>
226

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

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