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="fundingId" select="concat($funderID, '::H2020')"/>
29
						<xsl:variable name="projectId" select="concat('corda__h2020::', normalize-space(./ProjectId))"/>
30

    
31
						<ROW table="projects">
32
							<FIELD name="_dnet_resource_identifier_">
33
								<xsl:value-of select="$projectId"/>
34
							</FIELD>
35
							<FIELD name="id">
36
								<xsl:value-of select="$projectId"/>
37
							</FIELD>
38
							<FIELD name="code">
39
								<xsl:value-of select="./ProjectId"/>
40
							</FIELD>
41
							<FIELD name="acronym">
42
								<xsl:value-of select="./ProjectAcronym"/>
43
							</FIELD>
44
							<FIELD name="title">
45
								<xsl:value-of select="./ProjectTitle"/>
46
							</FIELD>
47
							<xsl:call-template name="dateCorda">
48
								<xsl:with-param name="datename">startdate</xsl:with-param>
49
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
50
							</xsl:call-template>
51
							<xsl:call-template name="dateCorda">
52
								<xsl:with-param name="datename">enddate</xsl:with-param>
53
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
54
							</xsl:call-template>
55
							<FIELD name="call_identifier">
56
								<xsl:value-of select="./ProjectCallIdentifier"/>
57
							</FIELD>
58
							<FIELD name="oa_mandate_for_publications" type="boolean">true</FIELD>
59
							<FIELD name="ec_article29_3" type="boolean">
60
								<xsl:value-of select="./Article29-3"/>
61
							</FIELD>
62
							<FIELD name="collectedfrom">
63
								<xsl:value-of select="$parentDatasourceId"/>
64
							</FIELD>
65
							<FIELD name="contracttypeclass">
66
								<xsl:value-of select="./ProjectTOACode"/>
67
							</FIELD>
68
							<FIELD name="contracttypescheme">ec:h2020toas</FIELD>
69
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
70
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
71
							<FIELD name="websiteurl">
72
								<xsl:value-of select="./ProjectInternetAddress"/>
73
							</FIELD>
74
							<FIELD name="optional1">
75
								<xsl:value-of select="./ProjectTopicCode"/>
76
							</FIELD>
77
							<FIELD name="optional2">
78
								<xsl:value-of select="./ProjectTopicDescr"/>
79
							</FIELD>
80
						</ROW>
81

    
82
						<xsl:for-each select="./CoordinatorContactPerson">
83
							<xsl:if test="string-length(./PersonFirstName) &gt; 0 and string-length(./PersonLastName) &gt; 0">
84
								<xsl:variable name="personId" select="concat('corda__h2020::', ../ProjectId, '::', ./PersonFirstName, '_', ./PersonLastName)"></xsl:variable>
85
								<ROW table="persons">
86
									<FIELD name="_dnet_resource_identifier_">
87
										<xsl:value-of select="$personId"/>
88
									</FIELD>
89
									<FIELD name="id">
90
										<xsl:value-of select="$personId"/>
91
									</FIELD>
92
									<FIELD name="firstname">
93
										<xsl:value-of select="./PersonFirstName"/>
94
									</FIELD>
95
									<FIELD name="secondnames">
96
										<xsl:value-of select="./PersonLastName"/>
97
									</FIELD>
98
									<FIELD name="email">
99
										<xsl:value-of select="./ContactEmail"/>
100
									</FIELD>
101
									<FIELD name="collectedfrom">
102
										<xsl:value-of select="$parentDatasourceId"/>
103
									</FIELD>
104
									<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
105
									<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
106
								</ROW>
107
							</xsl:if>
108
						</xsl:for-each>
109

    
110
						<xsl:for-each select="./OrganisationParticipant">
111
							<xsl:variable name="organizationId" select="concat('corda__h2020::', ./OrganisationPIC)"/>
112

    
113
							<xsl:variable name="whitelist" select="'0123456789'"/>
114
							<ROW table="organizations">
115
								<FIELD name="_dnet_resource_identifier_">
116
									<xsl:value-of select="$organizationId"/>
117
								</FIELD>
118
								<FIELD name="id">
119
									<xsl:value-of select="$organizationId"/>
120
								</FIELD>
121
								<FIELD name="legalshortname">
122
									<xsl:value-of select="./OrganisationShortName"/>
123
								</FIELD>
124
								<FIELD name="legalname">
125
									<xsl:value-of select="./OrganisationLegalName"/>
126
								</FIELD>
127
								<FIELD name="websiteurl">
128
									<xsl:choose>
129
										<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')">
130
											<xsl:value-of select="./OrganisationWebPage"/>
131
										</xsl:when>
132
										<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) &gt; 0">
133
											<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/>
134
										</xsl:when>
135
									</xsl:choose>
136
								</FIELD>
137
								<FIELD name="ec_legalbody" type="boolean">
138
									<xsl:value-of select="./PublicBody"/>
139
								</FIELD>
140
								<FIELD name="ec_legalperson" type="boolean">
141
									<xsl:value-of select="./LegalPerson"/>
142
								</FIELD>
143
								<FIELD name="ec_nonprofit" type="boolean">
144
									<xsl:value-of select="./NonProfit"/>
145
								</FIELD>
146
								<FIELD name="ec_researchorganization" type="boolean">
147
									<xsl:value-of select="./ResearchOrganisation"/>
148
								</FIELD>
149
								<FIELD name="ec_highereducation" type="boolean">
150
									<xsl:value-of select="./HigherEducation"/>
151
								</FIELD>
152
								<FIELD name="ec_internationalorganizationeurinterests" type="boolean">
153
									<xsl:value-of select="./InternationalOrgEurInterest"/>
154
								</FIELD>
155
								<FIELD name="ec_internationalorganization" type="boolean">
156
									<xsl:value-of select="./InternationalOrgEurInterest"/>
157
								</FIELD>
158
								<FIELD name="ec_smevalidated" type="boolean">
159
									<xsl:value-of select="./SMEValidated"/>
160
								</FIELD>
161
								<FIELD name="countryclass">
162
									<xsl:value-of select="./OrganisationCountry"/>
163
								</FIELD>
164
								<FIELD name="countryscheme">dnet:countries</FIELD>
165
								<FIELD name="collectedfrom">
166
									<xsl:value-of select="$parentDatasourceId"/>
167
								</FIELD>
168
								<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
169
								<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
170
								<FIELD name="trust" type="float">
171
									<xsl:value-of select="0.92"/>
172
								</FIELD>
173
							</ROW>
174

    
175
							<ROW table="project_organization">
176
								<FIELD name="_dnet_resource_identifier_">
177
									<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
178
								</FIELD>
179
								<xsl:choose>
180
									<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0">
181
										<FIELD name="participantnumber" type="int">9999</FIELD>
182
									</xsl:when>
183
									<xsl:otherwise>
184
										<FIELD name="participantnumber" type="int">
185
											<xsl:value-of select="./ParticipantOrder"/>
186
										</FIELD>
187
									</xsl:otherwise>
188
								</xsl:choose>
189
								<FIELD name="project">
190
									<xsl:value-of select="$projectId"/>
191
								</FIELD>
192
								<FIELD name="resporganization">
193
									<xsl:value-of select="$organizationId"/>
194
								</FIELD>
195
								<xsl:choose>
196
									<xsl:when test="./ParticipantOrder = 1">
197
										<FIELD name="contactperson">
198
											<xsl:value-of select="concat($projectId, '::', ..//CoordinatorContactPerson/PersonFirstName, '_', ../CoordinatorContactPerson/PersonLastName)"></xsl:value-of>
199
										</FIELD>
200
										<FIELD name="semanticclass">coordinator</FIELD>
201
									</xsl:when>
202
									<xsl:otherwise>
203
										<FIELD name="contactperson"></FIELD>
204
										<FIELD name="semanticclass">participant</FIELD>
205
									</xsl:otherwise>
206
								</xsl:choose>
207
								<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
208
							</ROW>
209
						</xsl:for-each>
210

    
211
						<ROW table="subjects">
212
							<FIELD name="_dnet_resource_identifier_">
213
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
214
							</FIELD>
215
							<FIELD name="id">
216
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
217
							</FIELD>
218
							<FIELD name="name">
219
								<xsl:value-of select="./ProjectTopicDescr"/>
220
							</FIELD>
221
							<FIELD name="semanticclass">ec:h2020topics</FIELD>
222
							<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD>
223
						</ROW>
224

    
225
						<ROW table="project_subject">
226
							<FIELD name="_dnet_resource_identifier_">
227
								<xsl:value-of select="concat($projectId, '@@corda__h2020::', normalize-space(./ProjectTopicCode))"/>
228
							</FIELD>
229
							<FIELD name="project">
230
								<xsl:value-of select="$projectId"/>
231
							</FIELD>
232
							<FIELD name="subject">
233
								<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/>
234
							</FIELD>
235
						</ROW>
236

    
237
						<ROW table="project_fundingpath">
238
							<FIELD name="_dnet_resource_identifier_">
239
								<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
240
							</FIELD>
241
							<FIELD name="funding">
242
								<xsl:value-of select="$fundingId"/>
243
							</FIELD>
244
							<FIELD name="project">
245
								<xsl:value-of select="$projectId"/>
246
							</FIELD>
247
							<xsl:call-template name="dateCorda">
248
								<xsl:with-param name="datename">startdate</xsl:with-param>
249
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
250
							</xsl:call-template>
251
							<xsl:call-template name="dateCorda">
252
								<xsl:with-param name="datename">enddate</xsl:with-param>
253
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
254
							</xsl:call-template>
255
							<FIELD name="semanticclass">
256
								<xsl:value-of select="./ProjectTOACode"/>
257
							</FIELD>
258
							<FIELD name="semanticscheme">ec:h2020toas</FIELD>
259
						</ROW>
260
					</xsl:for-each>
261

    
262
				</ROWS>
263
			</metadata>
264
		</record>
265
	</xsl:template>
266
</xsl:stylesheet>
(3-3/25)