Project

General

Profile

1 52327 alessia.ba
<RESOURCE_PROFILE>
2 59000 alessia.ba
    <HEADER>
3
        <RESOURCE_IDENTIFIER
4
                value="b2f93c95-f4e7-447e-9048-1a651630670e_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
5
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
6
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
7
        <RESOURCE_URI value=""/>
8
        <DATE_OF_CREATION value="2018-06-04T11:15:30+00:00"/>
9
    </HEADER>
10
    <BODY>
11
        <CONFIGURATION>
12
            <IMPORTED/>
13
            <SCRIPT>
14
                <TITLE>CORDA to DB</TITLE>
15
                <CODE>
16
                    <![CDATA[
17 52967 miriam.bag
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
18 59000 alessia.ba
    xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs">
19 48139 alessia.ba
20 52967 miriam.bag
    <xsl:param name="varDataSourceId"/>
21 48139 alessia.ba
22 52967 miriam.bag
    <xsl:template name="dateCorda">
23
        <xsl:param name="datename"/>
24
        <xsl:param name="datevalue"/>
25
        <FIELD name="{$datename}" type="date" format="dd-MMM-yyyy">
26 59000 alessia.ba
            <xsl:value-of
27
                select="concat(substring($datevalue, 1, 2), '-', substring($datevalue, 3, 3), '-', substring($datevalue, 6, 4))"
28
            />
29 52967 miriam.bag
        </FIELD>
30
    </xsl:template>
31 48139 alessia.ba
32 52967 miriam.bag
    <xsl:variable name="namespacePrefix" select="string('ec__________')"/>
33
    <xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')"/>
34 48139 alessia.ba
35 52967 miriam.bag
    <xsl:template match="/">
36
        <record>
37 59000 alessia.ba
            <xsl:copy-of select=".//*[local-name() = 'header']"/>
38 52967 miriam.bag
            <metadata>
39
                <ROWS>
40
                    <xsl:for-each select="//Project">
41 59000 alessia.ba
                        <xsl:variable name="projectId"
42
                            select="concat('corda_______::', normalize-space(./ProjectId))"/>
43
                        <xsl:variable name="fundingpath">
44 52967 miriam.bag
                            <xsl:choose>
45
                                <xsl:when test="normalize-space(./ProjectSpecificProgram)">
46 59000 alessia.ba
                                    <xsl:choose>
47
                                        <xsl:when test="normalize-space(./ProjectProgram)">
48
                                            <xsl:value-of
49
                                                select="concat($funderID, '::FP7::', normalize-space(./ProjectSpecificProgram), '::', normalize-space(./ProjectProgram))"
50
                                            />
51
                                        </xsl:when>
52
                                        <xsl:otherwise>
53
                                            <xsl:value-of
54
                                                select="concat($funderID, '::FP7::', normalize-space(./ProjectSpecificProgram))"
55
                                            />
56
                                        </xsl:otherwise>
57
                                    </xsl:choose>
58 52967 miriam.bag
                                </xsl:when>
59
                                <xsl:otherwise>
60 59000 alessia.ba
                                    <xsl:value-of select="concat($funderID, '::FP7')"/>
61 52967 miriam.bag
                                </xsl:otherwise>
62
                            </xsl:choose>
63
                        </xsl:variable>
64 31061 claudio.at
65 52967 miriam.bag
                        <ROW table="projects">
66
                            <FIELD name="_dnet_resource_identifier_">
67
                                <xsl:value-of select="$projectId"/>
68
                            </FIELD>
69
                            <FIELD name="id">
70
                                <xsl:value-of select="$projectId"/>
71
                            </FIELD>
72 59000 alessia.ba
                            <FIELD name="lastupdate" type="date">
73
                                <xsl:value-of select="current-dateTime()"/>
74
                            </FIELD>
75 52967 miriam.bag
                            <FIELD name="code">
76
                                <xsl:value-of select="./ProjectId"/>
77
                            </FIELD>
78
                            <FIELD name="acronym">
79
                                <xsl:value-of select="./ProjectAcronym"/>
80
                            </FIELD>
81
                            <FIELD name="title">
82
                                <xsl:value-of select="./ProjectTitle"/>
83
                            </FIELD>
84
                            <xsl:call-template name="dateCorda">
85
                                <xsl:with-param name="datename">startdate</xsl:with-param>
86 59000 alessia.ba
                                <xsl:with-param name="datevalue" select="./ProjectStartDate"/>
87 52967 miriam.bag
                            </xsl:call-template>
88
                            <xsl:call-template name="dateCorda">
89
                                <xsl:with-param name="datename">enddate</xsl:with-param>
90 59000 alessia.ba
                                <xsl:with-param name="datevalue" select="./ProjectEndDate"/>
91 52967 miriam.bag
                            </xsl:call-template>
92
                            <FIELD name="call_identifier">
93
                                <xsl:value-of select="./ProjectCallIdentifier"/>
94
                            </FIELD>
95
                            <FIELD name="ec_sc39" type="boolean">
96
                                <xsl:value-of select="./SpecialClause39"/>
97
                            </FIELD>
98
                            <FIELD name="oa_mandate_for_publications" type="boolean">
99
                                <xsl:value-of select="./SpecialClause39"/>
100
                            </FIELD>
101
                            <FIELD name="collectedfrom">
102
                                <xsl:value-of select="$varDataSourceId"/>
103
                            </FIELD>
104 57309 miriam.bag
                            <FIELD name="contracttype">
105 52967 miriam.bag
                                <xsl:value-of select="./ProjectFundingScheme"/>
106
                            </FIELD>
107
                            <FIELD name="contracttypescheme">ec:FP7contractTypes</FIELD>
108 59000 alessia.ba
                            <FIELD name="contracttypename">
109
                                <xsl:value-of select="./ProjectFundingSchemeDescr"/>
110
                            </FIELD>
111
                            <FIELD name="provenanceActionClass"
112
                                >sysimport:crosswalk:entityregistry</FIELD>
113 52967 miriam.bag
                            <FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
114
                            <FIELD name="websiteurl">
115
                                <xsl:value-of select="./ProjectInternetAddress"/>
116
                            </FIELD>
117
                            <FIELD name="optional1">
118
                                <xsl:value-of select="./ProjectSubFundingScheme"/>
119
                            </FIELD>
120
                            <FIELD name="optional2">
121
                                <xsl:value-of select="./ProjectCallWebpageUrl"/>
122
                            </FIELD>
123 59000 alessia.ba
                            <xsl:variable name="personSurname"
124
                                select="normalize-space(./CoordinatorContactPerson/PersonLastName)"/>
125
                            <xsl:variable name="personFirstName"
126
                                select="normalize-space(./CoordinatorContactPerson/PersonFirstName)"/>
127 52967 miriam.bag
                            <xsl:variable name="contactfullname">
128
                                <xsl:choose>
129 59000 alessia.ba
                                    <xsl:when
130
                                        test="string-length($personFirstName) &gt; 0 and string-length($personSurname) &gt; 0">
131
                                        <xsl:value-of
132
                                            select="normalize-space(concat($personSurname, ', ', $personFirstName))"
133
                                        />
134 52967 miriam.bag
                                    </xsl:when>
135
                                    <xsl:when test="string-length($personFirstName) &gt; 0">
136
                                        <xsl:value-of select="$personFirstName"/>
137
                                    </xsl:when>
138
                                    <xsl:when test="string-length($personSurname) &gt; 0">
139
                                        <xsl:value-of select="$personSurname"/>
140
                                    </xsl:when>
141
                                    <xsl:otherwise>
142
                                        <xsl:value-of select="''"/>
143
                                    </xsl:otherwise>
144
                                </xsl:choose>
145
                            </xsl:variable>
146
                            <xsl:if test="string-length($contactfullname) &gt; 0">
147
                                <FIELD name="contactfullname">
148
                                    <xsl:value-of select="$contactfullname"/>
149
                                </FIELD>
150
                            </xsl:if>
151 59000 alessia.ba
                            <xsl:variable name="contactfax"
152
                                select="normalize-space(./CoordinatorContactPerson/ContactFax)"/>
153 52967 miriam.bag
                            <xsl:if test="string-length($contactfax) &gt; 0">
154
                                <FIELD name="contactfax">
155
                                    <xsl:value-of select="$contactfax"/>
156
                                </FIELD>
157
                            </xsl:if>
158 59000 alessia.ba
                            <xsl:variable name="contactphone"
159
                                select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/>
160 52967 miriam.bag
                            <xsl:if test="string-length($contactphone) &gt; 0">
161
                                <FIELD name="contactphone">
162
                                    <xsl:value-of select="$contactphone"/>
163
                                </FIELD>
164
                            </xsl:if>
165 59000 alessia.ba
                            <xsl:variable name="contactemail"
166
                                select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/>
167 52967 miriam.bag
                            <xsl:if test="string-length($contactemail) &gt; 0">
168
                                <FIELD name="contactemail">
169
                                    <xsl:value-of select="$contactemail"/>
170
                                </FIELD>
171
                            </xsl:if>
172
                        </ROW>
173 48139 alessia.ba
174 52967 miriam.bag
                        <ROW table="project_fundingpath">
175
                            <FIELD name="_dnet_resource_identifier_">
176 59000 alessia.ba
                                <xsl:value-of select="concat($fundingpath, '@@', $projectId)"/>
177 52967 miriam.bag
                            </FIELD>
178
                            <FIELD name="funding">
179 59000 alessia.ba
                                <xsl:value-of select="$fundingpath"/>
180 52967 miriam.bag
                            </FIELD>
181
                            <FIELD name="project">
182
                                <xsl:value-of select="$projectId"/>
183
                            </FIELD>
184
                            <xsl:call-template name="dateCorda">
185
                                <xsl:with-param name="datename">startdate</xsl:with-param>
186 59000 alessia.ba
                                <xsl:with-param name="datevalue" select="./ProjectStartDate"/>
187 52967 miriam.bag
                            </xsl:call-template>
188
                            <xsl:call-template name="dateCorda">
189
                                <xsl:with-param name="datename">enddate</xsl:with-param>
190 59000 alessia.ba
                                <xsl:with-param name="datevalue" select="./ProjectEndDate"/>
191 52967 miriam.bag
                            </xsl:call-template>
192
                            <FIELD name="semanticclass">
193
                                <xsl:value-of select="./ProjectFundingScheme"/>
194
                            </FIELD>
195
                            <FIELD name="semanticscheme">ec:FP7contractTypes</FIELD>
196
                        </ROW>
197
                    </xsl:for-each>
198 48139 alessia.ba
199 52967 miriam.bag
                    <xsl:for-each select="//OrganisationParticipant">
200 59000 alessia.ba
                        <xsl:variable name="organizationId"
201
                            select="concat('corda_______::', ./OrganisationPIC)"/>
202
                        <xsl:variable name="projectId"
203
                            select="concat('corda_______::', normalize-space(../ProjectId))"/>
204 52967 miriam.bag
                        <xsl:variable name="whitelist" select="'0123456789'"/>
205
                        <ROW table="dsm_organizations">
206
                            <FIELD name="_dnet_resource_identifier_">
207
                                <xsl:value-of select="$organizationId"/>
208
                            </FIELD>
209
                            <FIELD name="id">
210
                                <xsl:value-of select="$organizationId"/>
211
                            </FIELD>
212 59000 alessia.ba
                            <FIELD name="lastupdate" type="date">
213
                                <xsl:value-of select="current-dateTime()"/>
214
                            </FIELD>
215 52967 miriam.bag
                            <FIELD name="legalshortname">
216
                                <xsl:value-of select="./OrganisationShortName"/>
217
                            </FIELD>
218
                            <FIELD name="legalname">
219
                                <xsl:value-of select="./OrganisationLegalName"/>
220
                            </FIELD>
221
                            <FIELD name="websiteurl">
222
                                <xsl:choose>
223 59000 alessia.ba
                                    <xsl:when
224
                                        test="starts-with(normalize-space(./OrganisationWebPage), 'http')">
225 52967 miriam.bag
                                        <xsl:value-of select="./OrganisationWebPage"/>
226
                                    </xsl:when>
227 59000 alessia.ba
                                    <xsl:when
228
                                        test="string-length(normalize-space(./OrganisationWebPage)) &gt; 0">
229
                                        <xsl:value-of
230
                                            select="concat('http://', normalize-space(./OrganisationWebPage))"
231
                                        />
232 52967 miriam.bag
                                    </xsl:when>
233
                                </xsl:choose>
234
                            </FIELD>
235
                            <FIELD name="ec_legalbody" type="boolean">
236
                                <xsl:value-of select="./PublicBody"/>
237
                            </FIELD>
238
                            <FIELD name="ec_legalperson" type="boolean">
239
                                <xsl:value-of select="./LegalPerson"/>
240
                            </FIELD>
241
                            <FIELD name="ec_nonprofit" type="boolean">
242
                                <xsl:value-of select="./NonProfit"/>
243
                            </FIELD>
244
                            <FIELD name="ec_researchorganization" type="boolean">
245
                                <xsl:value-of select="./ResearchOrganisation"/>
246
                            </FIELD>
247
                            <FIELD name="ec_highereducation" type="boolean">
248
                                <xsl:value-of select="./HigherEducation"/>
249
                            </FIELD>
250
                            <FIELD name="ec_internationalorganizationeurinterests" type="boolean">
251
                                <xsl:value-of select="./InternationalOrgEurInterest"/>
252
                            </FIELD>
253
                            <FIELD name="ec_internationalorganization" type="boolean">
254
                                <xsl:value-of select="./InternationalOrgEurInterest"/>
255
                            </FIELD>
256
                            <FIELD name="ec_enterprise" type="boolean">
257
                                <xsl:value-of select="./Enterprise"/>
258
                            </FIELD>
259
                            <FIELD name="ec_smevalidated" type="boolean">
260
                                <xsl:value-of select="./SMEValidated"/>
261
                            </FIELD>
262
                            <xsl:if test="./OrganisationCountry">
263 59000 alessia.ba
                                <FIELD name="country">
264
                                    <xsl:value-of select="./OrganisationCountry"/>
265
                                </FIELD>
266 52337 miriam.bag
267 52967 miriam.bag
                            </xsl:if>
268 48139 alessia.ba
269 52967 miriam.bag
270
                            <FIELD name="collectedfrom">
271
                                <xsl:value-of select="$varDataSourceId"/>
272
                            </FIELD>
273 59000 alessia.ba
                            <FIELD name="provenanceaction"
274
                                >sysimport:crosswalk:entityregistry</FIELD>
275 52967 miriam.bag
276
                            <FIELD name="trust" type="float">
277
                                <xsl:value-of select="0.8"/>
278
                            </FIELD>
279
                        </ROW>
280 61029 alessia.ba
                        <xsl:variable name="organizationPIC" select="./OrganisationPIC"/>
281 60698 alessia.ba
                         <ROW table="dsm_identities">
282
                            <FIELD name="_dnet_resource_identifier_">
283
                                <xsl:value-of
284 61029 alessia.ba
                                        select="concat($organizationPIC, '@@PIC')"/>
285 60698 alessia.ba
                            </FIELD>
286
                            <FIELD name="pid">
287
                                <xsl:value-of select="$organizationPIC"/>
288
                            </FIELD>
289
                            <FIELD name="issuertype">PIC</FIELD>
290
                        </ROW>
291
                        <ROW table="dsm_organizationpids">
292
                            <FIELD name="_dnet_resource_identifier_">
293
                                <xsl:value-of select="concat($organizationPIC, '@@', $organizationId)"/>
294
                            </FIELD>
295
                            <FIELD name="pid">
296
                                <xsl:value-of select="$organizationPIC"/>
297
                            </FIELD>
298
                            <FIELD name="organization">
299
                                <xsl:value-of select="$organizationId"/>
300
                            </FIELD>
301
                        </ROW>
302 52967 miriam.bag
303
                        <ROW table="project_organization">
304
                            <FIELD name="_dnet_resource_identifier_">
305
                                <xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
306
                            </FIELD>
307
                            <xsl:choose>
308 59000 alessia.ba
                                <xsl:when
309
                                    test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0">
310 52967 miriam.bag
                                    <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:if test="string(./PartecipantOrder) castable as xs:integer">
325
                                <xsl:choose>
326 59000 alessia.ba
                                    <xsl:when test="./ParticipantOrder = 1">
327
                                        <FIELD name="semanticclass">coordinator</FIELD>
328
                                    </xsl:when>
329
                                    <xsl:otherwise>
330
                                        <FIELD name="semanticclass">participant</FIELD>
331
                                    </xsl:otherwise>
332
                                </xsl:choose>
333 52967 miriam.bag
                            </xsl:if>
334
                        </ROW>
335
                    </xsl:for-each>
336
                </ROWS>
337
            </metadata>
338
        </record>
339
    </xsl:template>
340 26600 sandro.lab
</xsl:stylesheet>
341 59000 alessia.ba
342 53143 alessia.ba
]]>
343 59000 alessia.ba
                </CODE>
344
            </SCRIPT>
345
        </CONFIGURATION>
346
        <STATUS/>
347
        <SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
348
    </BODY>
349 53143 alessia.ba
</RESOURCE_PROFILE>