Project

General

Profile

« Previous | Next » 

Revision 59000

No UNKNOWN funding streams for FP7

View differences:

modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/entityreg-contexts/xsl/corda_contexts.xsl
8 8

  
9 9
	<xsl:template match="/">
10 10
		<xsl:variable name="specificProgramName">
11
			<xsl:choose>
12
				<xsl:when test="normalize-space(.//ProjectSpecificProgram)">
13
					<xsl:value-of select="normalize-space(.//ProjectSpecificProgram)"/>
14
				</xsl:when>
15
				<xsl:otherwise>
16
					<xsl:value-of select="string('UNKNOWN')"/>
17
				</xsl:otherwise>
18
			</xsl:choose>
11
			<xsl:value-of select="normalize-space(.//ProjectSpecificProgram)"/>
19 12
		</xsl:variable>
20 13
		<xsl:variable name="programName">
21
			<xsl:choose>
22
				<xsl:when test="normalize-space(.//ProjectProgram)">
23
					<xsl:value-of select="normalize-space(.//ProjectProgram)"/>
24
				</xsl:when>
25
				<xsl:otherwise>
26
					<xsl:value-of select="string('UNKNOWN')"/>
27
				</xsl:otherwise>
28
			</xsl:choose>
14
			<xsl:value-of select="normalize-space(.//ProjectProgram)"/>
29 15
		</xsl:variable>
30 16
		<xsl:variable name="specificProgramDesc" select=".//ProjectSpecificProgramDescr"/>
31 17
		<xsl:variable name="specificProgramId"
......
43 29
				<name>European Commission</name>
44 30
				<jurisdiction>EU</jurisdiction>
45 31
			</funder>
46
			<funding_level_2>
32
			<xsl:choose>
33
				<xsl:when test="string-length($programName) > 0 and string-length($specificProgramName) > 0">
34
				<funding_level_2>
47 35
				<id>
48 36
					<xsl:value-of select="$programId"/>
49 37
				</id>
......
79 67
						</parent>
80 68
					</funding_level_1>
81 69
				</parent>
82
			</funding_level_2>
70
				</funding_level_2>
71
				</xsl:when>
72
				<xsl:otherwise>
73
					<xsl:choose>
74
						<xsl:when test="string-length($specificProgramName) > 0">
75
							<funding_level_1>
76
								<id>
77
									<xsl:value-of select="$specificProgramId"/>
78
								</id>
79
								<description>
80
									<xsl:value-of select="$specificProgramDesc"/>
81
								</description>
82
								<name>
83
									<xsl:value-of select="$specificProgramName"/>
84
								</name>
85
								<class>ec:specificprogram</class>
86
								<parent>
87
									<funding_level_0>
88
										<id>
89
											<xsl:value-of select="concat($funderID, '::FP7')"/>
90
										</id>
91
										<description>SEVENTH FRAMEWORK PROGRAMME</description>
92
										<name>FP7</name>
93
										<parent/>
94
										<class>ec:frameworkprogram</class>
95
									</funding_level_0>
96
								</parent>
97
							</funding_level_1>
98
						</xsl:when>
99
						<xsl:otherwise>
100
							<funding_level_0>
101
								<id>
102
									<xsl:value-of select="concat($funderID, '::FP7')"/>
103
								</id>
104
								<description>SEVENTH FRAMEWORK PROGRAMME</description>
105
								<name>FP7</name>
106
								<parent/>
107
								<class>ec:frameworkprogram</class>
108
							</funding_level_0>
109
						</xsl:otherwise>
110
					</xsl:choose>
111
				</xsl:otherwise>
112
			</xsl:choose>
83 113
		</fundingtree>
84 114
	</xsl:template>
85 115

  
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/patch-db/patch-fundingpaths.sql
25 25
UPDATE datasources
26 26
SET namespaceprefix = 'wt__________'
27 27
WHERE id = 'openaire____::wellcometrust';
28

  
29
delete from project_fundingpath where funding ='ec__________::EC::FP7::UNKNOWN::UNKNOWN';
30
delete from fundingpaths where id = 'ec__________::EC::FP7::UNKNOWN::UNKNOWN';
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/corda_2_db.xml
1 1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="b2f93c95-f4e7-447e-9048-1a651630670e_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 to DB</TITLE>
14
				<CODE>
15
					<![CDATA[
2
    <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[
16 17
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
18
    exclude-result-prefixes="xs">
18
    xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs">
19 19

  
20 20
    <xsl:param name="varDataSourceId"/>
21 21

  
......
23 23
        <xsl:param name="datename"/>
24 24
        <xsl:param name="datevalue"/>
25 25
        <FIELD name="{$datename}" type="date" format="dd-MMM-yyyy">
26
            <xsl:value-of select="concat(substring($datevalue, 1, 2),'-',substring($datevalue,3,3),'-',substring($datevalue,6,4))"/>
26
            <xsl:value-of
27
                select="concat(substring($datevalue, 1, 2), '-', substring($datevalue, 3, 3), '-', substring($datevalue, 6, 4))"
28
            />
27 29
        </FIELD>
28 30
    </xsl:template>
29 31

  
......
32 34

  
33 35
    <xsl:template match="/">
34 36
        <record>
35
            <xsl:copy-of select=".//*[local-name()='header']"/>
37
            <xsl:copy-of select=".//*[local-name() = 'header']"/>
36 38
            <metadata>
37 39
                <ROWS>
38 40
                    <xsl:for-each select="//Project">
39

  
40
                        <xsl:variable name="specificName">
41
                        <xsl:variable name="projectId"
42
                            select="concat('corda_______::', normalize-space(./ProjectId))"/>
43
                        <xsl:variable name="fundingpath">
41 44
                            <xsl:choose>
42 45
                                <xsl:when test="normalize-space(./ProjectSpecificProgram)">
43
                                    <xsl:value-of select="normalize-space(./ProjectSpecificProgram)"/>
46
                                    <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>
44 58
                                </xsl:when>
45 59
                                <xsl:otherwise>
46
                                    <xsl:value-of select="string('UNKNOWN')"/>
60
                                    <xsl:value-of select="concat($funderID, '::FP7')"/>
47 61
                                </xsl:otherwise>
48 62
                            </xsl:choose>
49 63
                        </xsl:variable>
50 64

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

  
54
                        <xsl:variable name="projectProgramName">
55
                            <xsl:choose>
56
                                <xsl:when test="normalize-space(./ProjectProgram)">
57
                                    <xsl:value-of select="normalize-space(./ProjectProgram)"/>
58
                                </xsl:when>
59
                                <xsl:otherwise>
60
                                    <xsl:value-of select="string('UNKNOWN')"/>
61
                                </xsl:otherwise>
62
                            </xsl:choose>
63
                        </xsl:variable>
64

  
65
                        <xsl:variable name="projectProgramDesc" select="./ProjectProgramDescr"/>
66
                        <xsl:variable name="projectProgramId" select="concat($funderID, '::FP7::', $specificName, '::', $projectProgramName)"/>
67
                        <xsl:variable name="projectId" select="concat('corda_______::', normalize-space(./ProjectId))"/>
68

  
69

  
70 65
                        <ROW table="projects">
71 66
                            <FIELD name="_dnet_resource_identifier_">
72 67
                                <xsl:value-of select="$projectId"/>
......
74 69
                            <FIELD name="id">
75 70
                                <xsl:value-of select="$projectId"/>
76 71
                            </FIELD>
77
                            <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
72
                            <FIELD name="lastupdate" type="date">
73
                                <xsl:value-of select="current-dateTime()"/>
74
                            </FIELD>
78 75
                            <FIELD name="code">
79 76
                                <xsl:value-of select="./ProjectId"/>
80 77
                            </FIELD>
......
86 83
                            </FIELD>
87 84
                            <xsl:call-template name="dateCorda">
88 85
                                <xsl:with-param name="datename">startdate</xsl:with-param>
89
                                <xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
86
                                <xsl:with-param name="datevalue" select="./ProjectStartDate"/>
90 87
                            </xsl:call-template>
91 88
                            <xsl:call-template name="dateCorda">
92 89
                                <xsl:with-param name="datename">enddate</xsl:with-param>
93
                                <xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
90
                                <xsl:with-param name="datevalue" select="./ProjectEndDate"/>
94 91
                            </xsl:call-template>
95 92
                            <FIELD name="call_identifier">
96 93
                                <xsl:value-of select="./ProjectCallIdentifier"/>
......
108 105
                                <xsl:value-of select="./ProjectFundingScheme"/>
109 106
                            </FIELD>
110 107
                            <FIELD name="contracttypescheme">ec:FP7contractTypes</FIELD>
111
							<FIELD name='contracttypename">
112
								<xsl:value-of select="./ProjectFundingSchemeDescr"/>
113
							</FIELD>
114
                            <FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
108
                            <FIELD name="contracttypename">
109
                                <xsl:value-of select="./ProjectFundingSchemeDescr"/>
110
                            </FIELD>
111
                            <FIELD name="provenanceActionClass"
112
                                >sysimport:crosswalk:entityregistry</FIELD>
115 113
                            <FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
116 114
                            <FIELD name="websiteurl">
117 115
                                <xsl:value-of select="./ProjectInternetAddress"/>
......
122 120
                            <FIELD name="optional2">
123 121
                                <xsl:value-of select="./ProjectCallWebpageUrl"/>
124 122
                            </FIELD>
125
                            <xsl:variable name="personSurname" select="normalize-space(./CoordinatorContactPerson/PersonLastName)"/>
126
                            <xsl:variable name="personFirstName" select="normalize-space(./CoordinatorContactPerson/PersonFirstName)"/>
123
                            <xsl:variable name="personSurname"
124
                                select="normalize-space(./CoordinatorContactPerson/PersonLastName)"/>
125
                            <xsl:variable name="personFirstName"
126
                                select="normalize-space(./CoordinatorContactPerson/PersonFirstName)"/>
127 127
                            <xsl:variable name="contactfullname">
128 128
                                <xsl:choose>
129
                                    <xsl:when test="string-length($personFirstName) &gt; 0 and string-length($personSurname) &gt; 0">
130
                                        <xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/>
129
                                    <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
                                        />
131 134
                                    </xsl:when>
132 135
                                    <xsl:when test="string-length($personFirstName) &gt; 0">
133 136
                                        <xsl:value-of select="$personFirstName"/>
......
145 148
                                    <xsl:value-of select="$contactfullname"/>
146 149
                                </FIELD>
147 150
                            </xsl:if>
148
                            <xsl:variable name="contactfax" select="normalize-space(./CoordinatorContactPerson/ContactFax)"/>
151
                            <xsl:variable name="contactfax"
152
                                select="normalize-space(./CoordinatorContactPerson/ContactFax)"/>
149 153
                            <xsl:if test="string-length($contactfax) &gt; 0">
150 154
                                <FIELD name="contactfax">
151 155
                                    <xsl:value-of select="$contactfax"/>
152 156
                                </FIELD>
153 157
                            </xsl:if>
154
                            <xsl:variable name="contactphone" select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/>
158
                            <xsl:variable name="contactphone"
159
                                select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/>
155 160
                            <xsl:if test="string-length($contactphone) &gt; 0">
156 161
                                <FIELD name="contactphone">
157 162
                                    <xsl:value-of select="$contactphone"/>
158 163
                                </FIELD>
159 164
                            </xsl:if>
160
                            <xsl:variable name="contactemail" select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/>
165
                            <xsl:variable name="contactemail"
166
                                select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/>
161 167
                            <xsl:if test="string-length($contactemail) &gt; 0">
162 168
                                <FIELD name="contactemail">
163 169
                                    <xsl:value-of select="$contactemail"/>
......
167 173

  
168 174
                        <ROW table="project_fundingpath">
169 175
                            <FIELD name="_dnet_resource_identifier_">
170
                                <xsl:value-of select="concat($projectProgramId, '@@', $projectId)"/>
176
                                <xsl:value-of select="concat($fundingpath, '@@', $projectId)"/>
171 177
                            </FIELD>
172 178
                            <FIELD name="funding">
173
                                <xsl:value-of select="$projectProgramId"/>
179
                                <xsl:value-of select="$fundingpath"/>
174 180
                            </FIELD>
175 181
                            <FIELD name="project">
176 182
                                <xsl:value-of select="$projectId"/>
177 183
                            </FIELD>
178 184
                            <xsl:call-template name="dateCorda">
179 185
                                <xsl:with-param name="datename">startdate</xsl:with-param>
180
                                <xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
186
                                <xsl:with-param name="datevalue" select="./ProjectStartDate"/>
181 187
                            </xsl:call-template>
182 188
                            <xsl:call-template name="dateCorda">
183 189
                                <xsl:with-param name="datename">enddate</xsl:with-param>
184
                                <xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
190
                                <xsl:with-param name="datevalue" select="./ProjectEndDate"/>
185 191
                            </xsl:call-template>
186 192
                            <FIELD name="semanticclass">
187 193
                                <xsl:value-of select="./ProjectFundingScheme"/>
......
191 197
                    </xsl:for-each>
192 198

  
193 199
                    <xsl:for-each select="//OrganisationParticipant">
194
                        <xsl:variable name="organizationId" select="concat('corda_______::', ./OrganisationPIC)"/>
195
                        <xsl:variable name="projectId" select="concat('corda_______::', normalize-space(../ProjectId))"/>
200
                        <xsl:variable name="organizationId"
201
                            select="concat('corda_______::', ./OrganisationPIC)"/>
202
                        <xsl:variable name="projectId"
203
                            select="concat('corda_______::', normalize-space(../ProjectId))"/>
196 204
                        <xsl:variable name="whitelist" select="'0123456789'"/>
197 205
                        <ROW table="dsm_organizations">
198 206
                            <FIELD name="_dnet_resource_identifier_">
......
201 209
                            <FIELD name="id">
202 210
                                <xsl:value-of select="$organizationId"/>
203 211
                            </FIELD>
204
                            <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
212
                            <FIELD name="lastupdate" type="date">
213
                                <xsl:value-of select="current-dateTime()"/>
214
                            </FIELD>
205 215
                            <FIELD name="legalshortname">
206 216
                                <xsl:value-of select="./OrganisationShortName"/>
207 217
                            </FIELD>
......
210 220
                            </FIELD>
211 221
                            <FIELD name="websiteurl">
212 222
                                <xsl:choose>
213
                                    <xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')">
223
                                    <xsl:when
224
                                        test="starts-with(normalize-space(./OrganisationWebPage), 'http')">
214 225
                                        <xsl:value-of select="./OrganisationWebPage"/>
215 226
                                    </xsl:when>
216
                                    <xsl:when test="string-length(normalize-space(./OrganisationWebPage)) &gt; 0">
217
                                        <xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/>
227
                                    <xsl:when
228
                                        test="string-length(normalize-space(./OrganisationWebPage)) &gt; 0">
229
                                        <xsl:value-of
230
                                            select="concat('http://', normalize-space(./OrganisationWebPage))"
231
                                        />
218 232
                                    </xsl:when>
219 233
                                </xsl:choose>
220 234
                            </FIELD>
......
246 260
                                <xsl:value-of select="./SMEValidated"/>
247 261
                            </FIELD>
248 262
                            <xsl:if test="./OrganisationCountry">
249
                                 <FIELD name="country">
250
                                <xsl:value-of select="./OrganisationCountry"/>
251
                            </FIELD>
263
                                <FIELD name="country">
264
                                    <xsl:value-of select="./OrganisationCountry"/>
265
                                </FIELD>
252 266

  
253 267
                            </xsl:if>
254 268

  
......
256 270
                            <FIELD name="collectedfrom">
257 271
                                <xsl:value-of select="$varDataSourceId"/>
258 272
                            </FIELD>
259
                            <FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
273
                            <FIELD name="provenanceaction"
274
                                >sysimport:crosswalk:entityregistry</FIELD>
260 275

  
261 276
                            <FIELD name="trust" type="float">
262 277
                                <xsl:value-of select="0.8"/>
......
268 283
                                <xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
269 284
                            </FIELD>
270 285
                            <xsl:choose>
271
                                <xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0">
286
                                <xsl:when
287
                                    test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0">
272 288
                                    <FIELD name="participantnumber" type="int">9999</FIELD>
273 289
                                </xsl:when>
274 290
                                <xsl:otherwise>
......
285 301
                            </FIELD>
286 302
                            <xsl:if test="string(./PartecipantOrder) castable as xs:integer">
287 303
                                <xsl:choose>
288
                                <xsl:when test="./ParticipantOrder = 1">
289
                                    <FIELD name="semanticclass">coordinator</FIELD>
290
                                </xsl:when>
291
                                <xsl:otherwise>
292
                                    <FIELD name="semanticclass">participant</FIELD>
293
                                </xsl:otherwise>
294
                            </xsl:choose>
304
                                    <xsl:when test="./ParticipantOrder = 1">
305
                                        <FIELD name="semanticclass">coordinator</FIELD>
306
                                    </xsl:when>
307
                                    <xsl:otherwise>
308
                                        <FIELD name="semanticclass">participant</FIELD>
309
                                    </xsl:otherwise>
310
                                </xsl:choose>
295 311
                            </xsl:if>
296 312
                        </ROW>
297 313
                    </xsl:for-each>
......
300 316
        </record>
301 317
    </xsl:template>
302 318
</xsl:stylesheet>
319

  
303 320
]]>
304
				</CODE>
305
			</SCRIPT>
306
		</CONFIGURATION>
307
		<STATUS/>
308
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
309
	</BODY>
321
                </CODE>
322
            </SCRIPT>
323
        </CONFIGURATION>
324
        <STATUS/>
325
        <SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
326
    </BODY>
310 327
</RESOURCE_PROFILE>

Also available in: Unified diff