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
				xmlns:dri="http://www.driver-repository.eu/namespace/dri"
4
				xmlns:oaf="http://namespace.openaire.eu/oaf"
5
				xmlns:dc="http://purl.org/dc/elements/1.1/">
6
	<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
7
	<!-- PROJECT
8
    missing fields:
9
    1. scientific area ?
10
    2. programme ?
11
    3. cordis link ?
12
    4. publications
13
     -->
14
	<xsl:template match = "/">
15
		<result type ="result">
16
			<xsl:apply-templates select="//header"/>
17
			<xsl:apply-templates select="//oaf:project"/>
18
			<xsl:apply-templates select="//rel"/>
19
			<!--	<xsl:apply-templates select="//funding[parent[not(node())]] "/-->
20
			<xsl:apply-templates select="//funding_level_2"/>
21
			<xsl:apply-templates select="//funding_level_1"/>
22
			<xsl:apply-templates select="//funding_level_0"/>
23
			<xsl:apply-templates select="//funder"/>
24
		</result>
25
	</xsl:template>
26

    
27
	<!-- HEADER
28
    fields in header:
29
    1. dri:objIdentifier 		[objIdentifier]
30
    2. dri:repositoryId			X
31
    3. dri:dateOfCollection		X
32
    -->
33
	<xsl:template match = "header">
34
		<field name="projectId" multiplicity="false" indexId="objIdentifier" label="Object id">
35
			<xsl:attribute name="value">
36
				<xsl:value-of select='./dri:objIdentifier'/>
37
			</xsl:attribute>
38
		</field>
39
		<xsl:if test="substring(./dri:objIdentifier,1,4)='ec::'">
40
			<field name="grantagreementnumber" multiplicity="false" indexId="" label="Grant agreement number">
41
				<xsl:attribute name="value">
42
					<xsl:value-of select="substring(./dri:objIdentifier,5)"/>
43
				</xsl:attribute>
44
			</field>
45
		</xsl:if>
46

    
47
		<!--<field name="repositoryId" multiplicity="false" indexId="???" label="???">
48
            <xsl:attribute name="value">
49
                <xsl:value-of select='./dri:repositoryId'/>
50
            </xsl:attribute>
51
        </field>-->
52
		<!--<field name="dateOfCollection" multiplicity="false" indexId="???" label="???">
53
            <xsl:attribute name="value">
54
                <xsl:value-of select='./dri:dateOfCollection'/>
55
            </xsl:attribute>
56
        </field>-->
57
	</xsl:template>
58

    
59
	<xsl:template match = "oaf:project">
60

    
61
		<xsl:for-each select = "./acronym">
62
			<field name="name" indexId = "projectacronym" multiplicity="true" label="Project">
63
				<xsl:attribute name="value">
64
					<xsl:value-of select='.'/>
65
				</xsl:attribute>
66
			</field>
67
		</xsl:for-each>
68

    
69
		<xsl:for-each select = "./code">
70
			<field name="code" indexId = "projectcode" multiplicity="true" label="Project code">
71
				<xsl:attribute name="value">
72
					<xsl:value-of select='.'/>
73
				</xsl:attribute>
74
			</field>
75
		</xsl:for-each>
76

    
77
		<xsl:for-each select = "./title">
78
			<field name="title" indexId = "projecttitle" multiplicity="true" label="Title">
79
				<xsl:attribute name="value">
80
					<xsl:value-of select='.'/>
81
				</xsl:attribute>
82
			</field>
83
		</xsl:for-each>
84

    
85
		<xsl:for-each select = "./startdate">
86
			<field name="startyear" indexId = "projectstartyear" multiplicity="true" label="Start year">
87
				<xsl:attribute name="value">
88
					<xsl:value-of select='substring-before(.,"-")'/>
89
				</xsl:attribute>
90
			</field>
91
			<field name="startdate" indexId = "projectstartdate" multiplicity="true" label="Start date">
92
				<xsl:attribute name="value">
93
					<xsl:value-of select='.'/>
94
				</xsl:attribute>
95
			</field>
96
		</xsl:for-each>
97

    
98
		<xsl:for-each select = "./enddate">
99
			<field name="endyear" indexId = "projectendyear" multiplicity="true" label="End year">
100
				<xsl:attribute name="value">
101
					<xsl:value-of select="substring-before(.,'-')"/>
102
				</xsl:attribute>
103
			</field>
104
			<field name="enddate" indexId = "projectenddate" multiplicity="true" label="End date">
105
				<xsl:attribute name="value">
106
					<xsl:value-of select='.'/>
107
				</xsl:attribute>
108
			</field>
109
		</xsl:for-each>
110

    
111
		<xsl:for-each select = "./callidentifier">
112
			<field name="call_identifier" indexId = "projectcallidentifier" multiplicity="true" label="Call">
113
				<xsl:attribute name="value">
114
					<xsl:value-of select='.'/>
115
				</xsl:attribute>
116
			</field>
117
		</xsl:for-each>
118

    
119
		<xsl:for-each select = "./ecsc39">
120
			<field name="ec_sc39" indexId = "projectecsc39" multiplicity="true" label="Special clause 39">
121
				<xsl:attribute name="value">
122
					<xsl:value-of select='.'/>
123
				</xsl:attribute>
124
			</field>
125
		</xsl:for-each>
126

    
127
		<xsl:for-each select = "./oamandatepublications">
128
			<field name="oamandatepublications" indexId = "" multiplicity="false" label="OA mandate">
129
				<xsl:attribute name="value">
130
					<xsl:value-of select='.'/>
131
				</xsl:attribute>
132
			</field>
133
		</xsl:for-each>
134

    
135
		<xsl:for-each select = "./ecarticle29_3">
136
			<field name="ecarticle29_3" indexId = "" multiplicity="false" label="Data Pilot">
137
				<xsl:attribute name="value">
138
					<xsl:value-of select='.'/>
139
				</xsl:attribute>
140
			</field>
141
		</xsl:for-each>
142

    
143

    
144

    
145
		<xsl:for-each select = "./collectedfrom">
146
			<field name="collectedfrom" indexId = "projectcollectedfrom" multiplicity="true" label="Collected from">
147
				<xsl:attribute name="value">
148
					<xsl:value-of select='./@id'/>
149
				</xsl:attribute>
150
			</field>
151
			<field name="collectedfromname" indexId = "" multiplicity="true" label="Collected from name">
152
				<xsl:attribute name="value">
153
					<xsl:value-of select='./@name'/>
154
				</xsl:attribute>
155
			</field>
156
		</xsl:for-each>
157

    
158

    
159
		<xsl:for-each select = "./contracttype">
160
			<field name="contracttypeid" indexId = "projectcontracttypeid" multiplicity="true" label="Contract type id">
161
				<xsl:attribute name="value">
162
					<xsl:value-of select='./@classid'/>
163
				</xsl:attribute>
164
			</field>
165
			<field name="contracttypename" indexId = "projectcontracttypename" multiplicity="true" label="Contract type name">
166
				<xsl:attribute name="value">
167
					<xsl:value-of select='./@classname'/>
168
				</xsl:attribute>
169
			</field>
170
		</xsl:for-each>
171

    
172
		<xsl:for-each select = "./pid">
173
			<field name="pidid" indexId = "pidclassid" multiplicity="true" label="Pid">
174
				<xsl:attribute name="value">
175
					<xsl:value-of select='./@classid'/>
176
				</xsl:attribute>
177
			</field>
178
			<field name="pidname" indexId = "pidclassname" multiplicity="true" label="Pid">
179
				<xsl:attribute name="value">
180
					<xsl:value-of select='./@classname'/>
181
				</xsl:attribute>
182
			</field>
183
		</xsl:for-each>
184

    
185
		<xsl:for-each select = "./websiteurl">
186
			<field name="websiteurl" indexId = "projectwebsiteurl" multiplicity="true" label="Website url">
187
				<xsl:attribute name="value">
188
					<xsl:value-of select='.'/>
189
				</xsl:attribute>
190
			</field>
191
		</xsl:for-each>
192

    
193
		<xsl:for-each select = "./keywords">
194
			<field name="keywords" indexId = "projectkeywords" multiplicity="true" label="Keywords">
195
				<xsl:attribute name="value">
196
					<xsl:value-of select='.'/>
197
				</xsl:attribute>
198
			</field>
199
		</xsl:for-each>
200

    
201
		<xsl:for-each select = "./duration">
202
			<field name="duration" indexId = "projectduration" multiplicity="true" label="Duration">
203
				<xsl:attribute name="value">
204
					<xsl:value-of select='.'/>
205
				</xsl:attribute>
206
			</field>
207
		</xsl:for-each>
208
	</xsl:template>
209

    
210

    
211
	<!--  RELS
212
    1. person
213
    2. project
214
    3. organisation
215
    4. result
216
    5. datasource
217
    -->
218
	<xsl:template match="rel">
219
		<!--PERSON-->
220
		<xsl:if test="./to/@type='person'">
221
			<field name="author" indexId = "objIdentifier"  multiplicity="true">
222
				<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
223
				<field name = "personId" indexId ="objIdentifier" multiplicity="false" label="Person id">
224
					<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
225
				</field>
226
				<field name = "role" indexId ="" multiplicity="false" label="role">
227
					<xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
228
				</field>
229
				<field name = "fullname" indexId ="personfullname" multiplicity="false" label="Person fullname">
230
					<xsl:attribute name="value"><xsl:value-of select='./fullname'/> </xsl:attribute>
231
				</field>
232
				<field name = "ranking" indexId ="" multiplicity="false" label="ranking">
233
					<xsl:attribute name="value"><xsl:value-of select='./ranking'/> </xsl:attribute>
234
				</field>
235
			</field>
236
		</xsl:if>
237
		<!--PROJECT-->
238
		<xsl:if test="./to/@type='project'">
239
			<field name="project" indexId = "objIdentifier" multiplicity="true">
240
				<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
241
				<field name = "projectId" indexId ="objIdentifier" multiplicity="false" label="Project id">
242
					<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
243
				</field>
244
				<field name = "role" indexId ="" multiplicity="false" label="role">
245
					<xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
246
				</field>
247
				<field name = "projectcode" indexId ="projectcode" multiplicity="false" label="Project(s)">
248
					<xsl:attribute name="value"><xsl:value-of select='./code'/> </xsl:attribute>
249
				</field>
250
				<field name = "projectacronym" indexId ="projectacronym" multiplicity="false" label="Project(s)">
251
					<xsl:attribute name="value"><xsl:value-of select='./acronym'/> </xsl:attribute>
252
				</field>
253
				<field name = "projecttitle" indexId ="projecttitle" multiplicity="false" label="Project title">
254
					<xsl:attribute name="value"><xsl:value-of select='./title'/> </xsl:attribute>
255
				</field>
256
				<field name = "projectcontracttypeid" indexId ="projectcontracttypeid" multiplicity="false" label="Project contract type id">
257
					<xsl:attribute name="value"><xsl:value-of select='./contracttype/@classid'/> </xsl:attribute>
258
				</field>
259
				<field name = "projectcontracttypename" indexId ="projectcontracttypename" multiplicity="false" label="Project contract type name">
260
					<xsl:attribute name="value"><xsl:value-of select='./contracttype/@classname'/> </xsl:attribute>
261
				</field>
262
			</field>
263
		</xsl:if>
264
		<!--RESULT-->
265
		<xsl:if test="./to/@type='result'">
266
			<field name="result" indexId = "objIdentifier"  multiplicity="true">
267
				<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
268
				<field name = "resultid" indexId ="objIdentifier" multiplicity="false" label="Result id">
269
					<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
270
				</field>
271
				<field name = "title" indexId = "resulttitle" multiplicity = "false" label = "Title">
272
					<xsl:attribute name="value">
273
						<xsl:value-of select="./title"/>
274
					</xsl:attribute>
275
				</field>
276
				<field name = "dateofacceptance" indexId = "resultdateofacceptance" multiplicity = "false" label = "Date of acceptance">
277
					<xsl:attribute name="value">
278
						<xsl:value-of select="./dateofacceptance"/>
279
					</xsl:attribute>
280
				</field>
281
				<field name = "resulttypeid" indexId = "resulttypeid" multiplicity = "false" label = "type id">
282
					<xsl:attribute name="value">
283
						<xsl:value-of select="./resulttype/@classid"/>
284
					</xsl:attribute>
285
				</field>
286
				<field name = "resulttypename" indexId = "resulttypename" multiplicity = "false" label = "type name">
287
					<xsl:attribute name="value">
288
						<xsl:value-of select="./resulttype/@classname"/>
289
					</xsl:attribute>
290
				</field>
291
			</field>
292
		</xsl:if>
293
		<!--ORGANIZATION-->
294
		<xsl:if test="./to/@type='organization'">
295
			<field name="organization" indexId = "objIdentifier"  multiplicity="true">
296
				<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
297
				<field name = "organizationid" indexId ="objIdentifier" multiplicity="false" label="Organization id">
298
					<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
299
				</field>
300
				<field name = "role" indexId ="" multiplicity="false" label="role">
301
					<xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
302
				</field>
303
				<field name = "legalshortname" indexId ="organizationlegalshortname" multiplicity="false" label="Organization short name">
304
					<xsl:attribute name="value"><xsl:value-of select='./legalshortname'/> </xsl:attribute>
305
				</field>
306
				<field name = "legalname" indexId ="organizationlegalname" multiplicity="false" label="Organization name">
307
					<xsl:attribute name="value"><xsl:value-of select='./legalname'/> </xsl:attribute>
308
				</field>
309
				<field name = "websiteurl" indexId ="organizationwebsiteurl" multiplicity="false" label="Website">
310
					<xsl:attribute name="value"><xsl:value-of select='./websiteurl'/> </xsl:attribute>
311
				</field>
312
				<field name = "countryid" indexId ="organizationcountryid" multiplicity="false" label="Country code">
313
					<xsl:attribute name="value"><xsl:value-of select='./country/@classid'/> </xsl:attribute>
314
				</field>
315
				<field name = "countryname" indexId ="organizationcountryname" multiplicity="false" label="Country">
316
					<xsl:attribute name="value"><xsl:value-of select='./country/@classname'/> </xsl:attribute>
317
				</field>
318
				<field name = "participantnumber" indexId ="" multiplicity="false" label="Participant Number">
319
					<xsl:attribute name="value"><xsl:value-of select='./participantnumber'/> </xsl:attribute>
320
				</field>
321
				<field name = "contactperson" indexId ="" multiplicity="false" label="Contact Person">
322
					<xsl:attribute name="value"><xsl:value-of select='./contactperson'/> </xsl:attribute>
323
				</field>
324
			</field>
325
		</xsl:if>
326

    
327
	</xsl:template>
328

    
329

    
330
	<xsl:template match="funding_level_2">
331
		<field name="funding_level_2" multiplicity="false">
332
			<field name="fundingid" indexId="fundinglevel2_id" label="">
333
				<xsl:attribute name="value"> <xsl:value-of select="./id"/> </xsl:attribute>
334
			</field>
335
			<field name="fundingdescription" indexId="fundingprogramdescription" label="">
336
				<xsl:attribute name="value"> <xsl:value-of select="./description"/> </xsl:attribute>
337
			</field>
338
			<field name="fundingname" indexId="fundingprogramname" label="">
339
				<xsl:attribute name="value"> <xsl:value-of select="./name"/> </xsl:attribute>
340
			</field>
341
			<field name="fundingclass" indexId="" label="">
342
				<xsl:attribute name="value"> <xsl:value-of select="./class"/> </xsl:attribute>
343
			</field>
344
		</field>
345
	</xsl:template>
346

    
347
	<xsl:template match="funding_level_1">
348
		<field name="funding_level_1" multiplicity="false">
349
			<field name="fundingid" indexId="fundinglevel1_id" label="">
350
				<xsl:attribute name="value"> <xsl:value-of select="./id"/> </xsl:attribute>
351
			</field>
352
			<field name="fundingdescription" indexId="fundingstreamnamedescription" label="">
353
				<xsl:attribute name="value"> <xsl:value-of select="./description"/> </xsl:attribute>
354
			</field>
355
			<field name="fundingname" indexId="fundingstreamname" label="">
356
				<xsl:attribute name="value"> <xsl:value-of select="./name"/> </xsl:attribute>
357
			</field>
358
			<field name="fundingclass" indexId="" label="">
359
				<xsl:attribute name="value"> <xsl:value-of select="./class"/> </xsl:attribute>
360
			</field>
361
		</field>
362
	</xsl:template>
363

    
364
	<xsl:template match="funding_level_0">
365
		<field name="funding_level_0" multiplicity="false">
366
			<field name="fundingid" indexId="fundinglevel0_id" label="">
367
				<xsl:attribute name="value"> <xsl:value-of select="./id"/> </xsl:attribute>
368
			</field>
369
			<field name="fundingdescription" indexId="fundingstreamnamedescription" label="">
370
				<xsl:attribute name="value"> <xsl:value-of select="./description"/> </xsl:attribute>
371
			</field>
372
			<field name="fundingname" indexId="fundingstreamname" label="">
373
				<xsl:attribute name="value"> <xsl:value-of select="./name"/> </xsl:attribute>
374
			</field>
375
			<field name="fundingclass" indexId="" label="">
376
				<xsl:attribute name="value"> <xsl:value-of select="./class"/> </xsl:attribute>
377
			</field>
378
		</field>
379
	</xsl:template>
380

    
381

    
382
	<xsl:template match="funder">
383
		<field name="funder" multiplicity="true">
384
			<field name="funderid" indexId="funderid" label="">
385
				<xsl:attribute name="value"> <xsl:value-of select="./id"/> </xsl:attribute>
386
			</field>
387
			<field name="fundershortname" indexId="fundershortname" label="">
388
				<xsl:attribute name="value"> <xsl:value-of select="./shortname"/> </xsl:attribute>
389
			</field>
390
			<field name="fundername" indexId="fundername" label="">
391
				<xsl:attribute name="value"> <xsl:value-of select="./name"/> </xsl:attribute>
392
			</field>
393
		</field>
394
	</xsl:template>
395

    
396
</xsl:stylesheet>
(28-28/46)