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" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr"
3
	xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oaa="http://namespace.openaire.eu/oaa" xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:fn="http://www.w3.org/2005/xpath-functions">
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"><xsl:value-of select="concat(substring($datevalue, 1, 2),'-',substring($datevalue,3,3),'-',substring($datevalue,6,4))" /></FIELD>
11
	</xsl:template>
12
	
13
	<xsl:template match="/">
14
		<record xmlns:dr="http://www.driver-repository.eu/namespace/dr"
15
			xmlns:dri="http://www.driver-repository.eu/namespace/dri"
16
			xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17
			xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
18
			
19
			<xsl:copy-of select=".//*[local-name()='header']"/>
20
			
21
			<metadata>
22
				<ROWS>
23
					<xsl:for-each select="//CoordinatorContactPerson">
24
						<xsl:if test="string-length(./PersonFirstName) &gt; 0 and string-length(./PersonLastName) &gt; 0">
25
							<xsl:variable name="personId" select="concat('corda_______::', ../ProjectId, '::', ./PersonFirstName, '_', ./PersonLastName)"></xsl:variable>
26
							<ROW table="persons">
27
								<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$personId" /></FIELD>
28
								<FIELD name="id"><xsl:value-of select="$personId" /></FIELD>
29
								<FIELD name="firstname"><xsl:value-of select="./PersonFirstName" /></FIELD>
30
								<FIELD name="secondnames"><xsl:value-of select="./PersonLastName" /></FIELD>
31
								<FIELD name="fax"><xsl:value-of select="./ContactFax" /></FIELD>
32
								<FIELD name="email"><xsl:value-of select="./ContactEmail" /></FIELD>
33
								<FIELD name="phone"><xsl:value-of select="./ContactPhone" /></FIELD>
34
								<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
35
								<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
36
								<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
37
							</ROW>
38
						</xsl:if>
39
					</xsl:for-each>
40
					
41
					<xsl:for-each select="//Project">
42

    
43
						<xsl:variable name="specificName">
44
							<xsl:choose>
45
								<xsl:when test="normalize-space(./ProjectSpecificProgram)">
46
									<xsl:value-of select="normalize-space(./ProjectSpecificProgram)"/>
47
								</xsl:when>
48
								<xsl:otherwise>
49
									<xsl:value-of select="string('UNKNOWN')"/>
50
								</xsl:otherwise>
51
							</xsl:choose>
52
						</xsl:variable>
53
						
54
						<xsl:variable name="specificDesc" select="./ProjectSpecificProgramDescr" />
55
						<xsl:variable name="specificId" select="normalize-space(concat('corda_______::FP7::', $specificName))"/>		
56

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

    
68
						<xsl:variable name="projectProgramDesc" select="./ProjectProgramDescr" />
69
						<xsl:variable name="projectProgramId" select="concat('corda_______::FP7::', $specificName, '::', $projectProgramName)"/>
70
						<xsl:variable name="projectId" select="concat('corda_______::', normalize-space(./ProjectId))"/>
71
						
72
						<!-- 
73
						<ROW table="fundings">
74
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$specificId" /></FIELD>
75
							<FIELD name="id"><xsl:value-of select="$specificId" /></FIELD>
76
							<FIELD name="name"><xsl:value-of select="$specificName" /></FIELD>
77
							<FIELD name="description"><xsl:value-of select="$specificDesc" /></FIELD>
78
							<FIELD name="semanticclass">ec:specificprogram</FIELD>
79
							<FIELD name="semanticscheme">ec:funding_typologies</FIELD>
80
						</ROW>
81
						
82
						<ROW table="fundings">
83
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectProgramId" /></FIELD>
84
							<FIELD name="id"><xsl:value-of select="$projectProgramId" /></FIELD>
85
							<FIELD name="name"><xsl:value-of select="$projectProgramName" /></FIELD>
86
							<FIELD name="description"><xsl:value-of select="$projectProgramDesc" /></FIELD>
87
							<FIELD name="semanticclass">ec:program</FIELD>
88
							<FIELD name="semanticscheme">ec:funding_typologies</FIELD>
89
						</ROW>
90
						
91
						<ROW table="funding_funding">
92
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($specificId, '@@corda_______::FP7')" /></FIELD>
93
							<FIELD name="funding1"><xsl:value-of select="$specificId" /></FIELD>
94
							<FIELD name="funding2">corda_______::FP7</FIELD>
95
							<FIELD name="semanticclass">ec:hasframeworkprogram</FIELD>
96
							<FIELD name="semanticscheme">ec:funding_relations</FIELD>
97
						</ROW>
98
						
99
						<ROW table="funding_funding">
100
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectProgramId, '@@', $specificId)" /></FIELD>
101
							<FIELD name="funding1"><xsl:value-of select="$projectProgramId" /></FIELD>
102
							<FIELD name="funding2"><xsl:value-of select="$specificId" /></FIELD>
103
							<FIELD name="semanticclass">ec:hasspecificprogram</FIELD>
104
							<FIELD name="semanticscheme">ec:funding_relations</FIELD>
105
						</ROW>
106
						-->
107
						
108
						<ROW table="projects">
109
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectId" /></FIELD>
110
							<FIELD name="id"><xsl:value-of select="$projectId" /></FIELD>
111
							<FIELD name="code"><xsl:value-of select="./ProjectId" /></FIELD>
112
							<FIELD name="acronym"><xsl:value-of select="./ProjectAcronym" /></FIELD>
113
							<FIELD name="title"><xsl:value-of select="./ProjectTitle" /></FIELD>
114
							<xsl:call-template name="dateCorda">
115
								<xsl:with-param name="datename">startdate</xsl:with-param>
116
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
117
							</xsl:call-template>
118
							<xsl:call-template name="dateCorda">
119
								<xsl:with-param name="datename">enddate</xsl:with-param>
120
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
121
							</xsl:call-template> 
122
							<FIELD name="call_identifier"><xsl:value-of select="./ProjectCallIdentifier" /></FIELD>
123
							<FIELD name="ec_sc39" type="boolean"><xsl:value-of select="./SpecialClause39" /></FIELD>
124
							<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
125
							<FIELD name="contracttypeclass"><xsl:value-of select="./ProjectFundingScheme" /></FIELD>
126
							<FIELD name="contracttypescheme">ec:FP7contractTypes</FIELD>
127
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
128
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
129
							<FIELD name="websiteurl"><xsl:value-of select="./ProjectInternetAddress" /></FIELD>
130
							<FIELD name="optional1"><xsl:value-of select="./ProjectSubFundingScheme" /></FIELD>
131
							<FIELD name="optional2"><xsl:value-of select="./ProjectCallWebpageUrl" /></FIELD>
132
						</ROW>
133
						
134
						<!-- 
135
						<ROW table="project_funding">
136
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectProgramId, '@@', $projectId)" /></FIELD>
137
							<FIELD name="funding"><xsl:value-of select="$projectProgramId" /></FIELD>
138
							<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
139
							<xsl:call-template name="dateCorda">
140
								<xsl:with-param name="datename">startdate</xsl:with-param>
141
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
142
							</xsl:call-template>
143
							<xsl:call-template name="dateCorda">
144
								<xsl:with-param name="datename">enddate</xsl:with-param>
145
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
146
							</xsl:call-template> 
147
							<FIELD name="semanticclass"><xsl:value-of select="./ProjectFundingScheme" /></FIELD>
148
							<FIELD name="semanticscheme">ec:FP7contractTypes</FIELD>
149
						</ROW>
150
						-->
151
						
152
						<ROW table="project_fundingpath">
153
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectProgramId, '@@', $projectId)" /></FIELD>
154
							<FIELD name="funding"><xsl:value-of select="$projectProgramId" /></FIELD>
155
							<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
156
							<xsl:call-template name="dateCorda">
157
								<xsl:with-param name="datename">startdate</xsl:with-param>
158
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
159
							</xsl:call-template>
160
							<xsl:call-template name="dateCorda">
161
								<xsl:with-param name="datename">enddate</xsl:with-param>
162
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
163
							</xsl:call-template> 
164
							<FIELD name="semanticclass"><xsl:value-of select="./ProjectFundingScheme" /></FIELD>
165
							<FIELD name="semanticscheme">ec:FP7contractTypes</FIELD>
166
						</ROW>
167
					</xsl:for-each>
168
					
169
					<xsl:for-each select="//OrganisationParticipant">
170
						<xsl:variable name="organizationId" select="concat('corda_______::', ./OrganisationPIC)" />
171
						<xsl:variable name="projectId" select="concat('corda_______::', normalize-space(../ProjectId))" />
172
						<xsl:variable name="whitelist" select="'0123456789'"/>
173
						<ROW table="organizations">
174
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$organizationId" /></FIELD>
175
							<FIELD name="id"><xsl:value-of select="$organizationId" /></FIELD>
176
							<FIELD name="legalshortname"><xsl:value-of select="./OrganisationShortName" /></FIELD>
177
							<FIELD name="legalname"><xsl:value-of select="./OrganisationLegalName" /></FIELD>
178
							<FIELD name="websiteurl"><xsl:value-of select="./OrganisationWebPage" /></FIELD>
179
							<FIELD name="ec_legalbody" type="boolean"><xsl:value-of select="./PublicBody" /></FIELD>
180
							<FIELD name="ec_legalperson" type="boolean"><xsl:value-of select="./LegalPerson" /></FIELD>
181
							<FIELD name="ec_nonprofit" type="boolean"><xsl:value-of select="./NonProfit" /></FIELD>
182
							<FIELD name="ec_researchorganization" type="boolean"><xsl:value-of select="./ResearchOrganisation" /></FIELD>
183
							<FIELD name="ec_highereducation" type="boolean"><xsl:value-of select="./HigherEducation" /></FIELD>
184
							<FIELD name="ec_internationalorganizationeurinterests" type="boolean"><xsl:value-of select="./InternationalOrgEurInterest" /></FIELD>
185
							<FIELD name="ec_internationalorganization" type="boolean"><xsl:value-of select="./InternationalOrgEurInterest" /></FIELD>
186
							<FIELD name="ec_enterprise" type="boolean"><xsl:value-of select="./Enterprise" /></FIELD>
187
							<FIELD name="ec_smevalidated" type="boolean"><xsl:value-of select="./SMEValidated" /></FIELD>
188
							<FIELD name="countryclass"><xsl:value-of select="./OrganisationCountry" /></FIELD>
189
							<FIELD name="countryscheme">dnet:countries</FIELD>
190
							<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
191
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
192
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
193
						</ROW>
194
						
195
						<ROW table="project_organization">
196
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select='concat($projectId, "@@", $organizationId)' /></FIELD>
197
							<xsl:choose>
198
								<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0" > 
199
									<FIELD name="participantnumber" type="int">9999</FIELD>
200
								</xsl:when>
201
								<xsl:otherwise>
202
									<FIELD name="participantnumber" type="int"><xsl:value-of select="./ParticipantOrder" /></FIELD>
203
								</xsl:otherwise>
204
							</xsl:choose>
205
							<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
206
							<FIELD name="resporganization"><xsl:value-of select="$organizationId" /></FIELD>
207
							<xsl:choose>
208
								<xsl:when test="./ParticipantOrder = 1">
209
									<FIELD name="contactperson"><xsl:value-of select="concat($projectId, '::', ..//CoordinatorContactPerson/PersonFirstName, '_', ../CoordinatorContactPerson/PersonLastName)"></xsl:value-of></FIELD>
210
									<FIELD name="semanticclass">coordinator</FIELD>
211
								</xsl:when>
212
								<xsl:otherwise>
213
									<FIELD name="contactperson"></FIELD>
214
									<FIELD name="semanticclass">participant</FIELD>
215
								</xsl:otherwise>
216
							</xsl:choose>
217
							<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
218
						</ROW>
219
					</xsl:for-each>		
220
				</ROWS>
221
			</metadata>
222
		</record>
223
	</xsl:template>
224
</xsl:stylesheet>
(3-3/13)