-
Notifications
You must be signed in to change notification settings - Fork 1
/
cvn-to-cerif.xslt
362 lines (355 loc) · 16.7 KB
/
cvn-to-cerif.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<?xml version="1.0"?>
<!DOCTYPE stylesheet [
<!ENTITY nbsp "<xsl:text> </xsl:text>">
]>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:vivo="http://vivoweb.org/ontology/core#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:owl2="http://www.w3.org/2006/12/owl2-xml#"
xmlns:iuvivo="http://vivo.iu.edu/ontology/iuvivo#"
xmlns:bibo="http://purl.org/ontology/bibo/"
version="2.0">
<xsl:output
method="xml"
indent="yes"
omit-xml-declaration="no"
encoding="utf-8"/>
<xsl:template match="/">
<CERIF
xmlns="urn:xmlns:org:eurocris:cerif-1.5-1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
release="1.5" date="2012-10-17"
sourceDatabase="Project Profile">
<xsl:for-each select="//Agent">
<cfPers>
<xsl:if test="Identification/PersonalIdentification/OfficialId/DNI[@code='000.010.000.100']">
<cfPersId><xsl:value-of select="Identification/PersonalIdentification/OfficialId/DNI[@code='000.010.000.100']/Item"/></cfPersId>
<!-- ID dependiente de campo no obligatorio (Pendiente de respuesta) -->
</xsl:if>
<cfGender>
<xsl:if test="Identification/PersonalIdentification/Gender[@code='000.010.000.030']/Item='000'"><xsl:value-of select="'m'"/></xsl:if>
<xsl:if test="Identification/PersonalIdentification/Gender[@code='000.010.000.030']/Item='010'"><xsl:value-of select="'f'"/></xsl:if>
</cfGender>
<cfBirthDate><xsl:value-of select="Identification/PersonalIdentification/BirthDate[@code='000.010.000.050']/Item"/>T00:00:00</cfBirthDate>
<cfPersName>
<cfFirstNames><xsl:value-of select="Identification/PersonalIdentification/GivenName[@code='000.010.000.020']/Item"/></cfFirstNames>
<cfFamilyNames><xsl:value-of select="Identification/PersonalIdentification/FirstFamilyName[@code='000.010.000.010']/Item"/> <xsl:value-of select="//Identification/PersonalIdentification/SecondFamilyName[@code='000.010.000.010']/Item"/></cfFamilyNames>
</cfPersName>
<xsl:if test="Identification/PersonalIdentification/Contact/Telephone[@Type='000']/Number[@code='000.010.000.210']">
<cfUri>
<cfClassId>341b4fcc-9fe4-4760-a9c8-0f36ffa4d614</cfClassId>
<!-- Phone -->
<cfClassSchemeId>6e0d9af0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
<xsl:value-of select="//Identification/PersonalIdentification/Contact/Telephone[@Type='000']/Number[@code='000.010.000.210']/Item"/>
</cfUri>
</xsl:if>
<xsl:if test="Identification/PersonalIdentification/Contact/Telephone[@Type='010']/Number[@code='000.010.000.240']">
<cfUri>
<cfClassId>44651010-00b1-4543-ae6f-b5983b704742</cfClassId>
<!-- Mobile Phone -->
<cfClassSchemeId>6e0d9af0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
<xsl:value-of select="//Identification/PersonalIdentification/Contact/Telephone[@Type='010']/Number[@code='000.010.000.240']/Item"/>
</cfUri>
</xsl:if>
<xsl:if test="Identification/PersonalIdentification/Contact/Fax[@Type='000']/Number[@code='000.010.000.220']">
<cfUri>
<cfClassId>9931ac41-3864-11e1-b86c-0800200c9a66</cfClassId>
<!-- Fax -->
<cfClassSchemeId>6e0d9af0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
<xsl:value-of select="//Identification/PersonalIdentification/Contact/Fax[@Type='000']/Number[@code='000.010.000.220']/Item"/>
</cfUri>
</xsl:if>
<xsl:if test="Identification/PersonalIdentification/Contact/InternetEmailAddress[@code='000.010.000.230']">
<cfUri>
<cfClassId>4523402a-0bae-4716-a5d7-77411b74d5f6</cfClassId>
<!-- Electronic Address -->
<cfClassSchemeId>6e0d9af0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
<xsl:value-of select="//Identification/PersonalIdentification/Contact/InternetEmailAddress[@code='000.010.000.230']/Item"/>
</cfUri>
</xsl:if>
<xsl:if test="Identification/PersonalIdentification/Contact/PersonalWeb[@code='000.010.000.250']">
<cfUri>
<cfClassId>7f65458e-00de-4eaf-8109-01e517790a2c</cfClassId>
<!-- Personal Web -->
<cfClassSchemeId>6e0d9af0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
<xsl:value-of select="//Identification/PersonalIdentification/Contact/PersonalWeb[@code='000.010.000.250']/Item"/>
</cfUri>
</xsl:if>
<cfPers_Country>
<!-- Hacer función conversión país --><xsl:value-of select="Identification/PersonalIdentification/BirthCountry[@code='000.010.000.060']/Item"/>
</cfPers_Country>
<xsl:if test="Entity/EntityName[@code='010.010.000.020']/Item='010'">
<cfClassId></cfClassId>
<!-- Academic Institute -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='010.010.000.020']/Item='000'">
<cfClassId></cfClassId>
<!-- University -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='010.010.000.020']/Item='120'">
<cfClassId></cfClassId>
<!-- Research Institute -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='010.010.000.020']/Item='080'">
<cfClassId></cfClassId>
<!-- Company -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='010.010.000.020']/Item='010'">
<cfClassId></cfClassId>
<!-- Academic Institute -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='010.010.000.020']/Item='000'">
<cfClassId></cfClassId>
<!-- University -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='010.010.000.020']/Item='120'">
<cfClassId></cfClassId>
<!-- Research Institute -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='010.010.000.020']/Item='080'">
<cfClassId></cfClassId>
<!-- Company -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="//Date/StartDate/DayMonthYear[@code='010.010.000.180']">
<xsl:for-each select="//Date/StartDate/DayMonthYear[@code='010.010.000.180']">
<cfPers_OrgUnit>
<cfStartDate><xsl:value-of select="Item"/>T00:00:00</cfStartDate>
<xsl:if test="//Dedication/Item='020'">
<cfFraction>
<xsl:value-of select="1"/>
</cfFraction>
</xsl:if>
</cfPers_OrgUnit>
</xsl:for-each>
</xsl:if>
</cfPers>
<xsl:if test="Address">
<cfPAddr>
<xsl:if test="Address/City[@code='000.010.000.170']">
<cfCityTown><xsl:value-of select="//Address/City[@code='000.010.000.170']/Item"/></cfCityTown>
</xsl:if>
<xsl:if test="Address/Streets[@code='000.010.000.140']">
<cfAddrLine1><xsl:value-of select="//Address/Streets[@code='000.010.000.140']/Item"/></cfAddrLine1>
</xsl:if>
<xsl:if test="Address/OtherInformation[@code='000.010.000.150']">
<cfAddrLine2><xsl:value-of select="//Address/OtherInformation[@code='000.010.000.150']/Item"/></cfAddrLine2>
</xsl:if>
<xsl:if test="Address/PostalCode[@code='000.010.000.160']">
<cfPostCode><xsl:value-of select="//Address/PostalCode[@code='000.010.000.160']/Item"/></cfPostCode>
</xsl:if>
<xsl:if test="Address/Region/Name[@code='000.010.000.190']">
<cfStateOfCountry><xsl:value-of select="//Address/Region/Name[@code='000.010.000.190']/Item"/></cfStateOfCountry>
</xsl:if>
<xsl:if test="Address/CountryCode[@code='000.010.000.180']">
<cfCountryCode><xsl:value-of select="//Address/CountryCode[@code='000.010.000.180']/Item"/></cfCountryCode>
</xsl:if>
</cfPAddr>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="//CvnItem">
<!-- Project Entity -->
<xsl:if test="CvnItemID/CVNPK/Item = '050.020.010.000'">
<cfProj>
<cfStartDate><xsl:value-of select="Date/StartDate/DayMonthYear[@code='050.020.010.270']/Item"/>T00:00:00</cfStartDate>
<cfEndDate><xsl:value-of select="Date/EndDate/DayMonthYear[@code='050.020.010.410']/Item"/>T00:00:00</cfEndDate>
<cfProjTitle>
<cfTitle><xsl:value-of select="Title/Name[@code='050.020.010.010']/Item"/></cfTitle>
</cfProjTitle>
<xsl:if test="Title/Name[@code='050.020.010.250']">
<cfFund>
<cfName><xsl:value-of select="Title/Name[@code='050.020.010.250']/Item"/></cfName>
<cfKeyw>
<xsl:for-each select="Subject/*[@code='050.020.010.020']">
<xsl:value-of select="Item"/>
</xsl:for-each>
</cfKeyw>
</cfFund>
</xsl:if>
<xsl:if test="Filter/Value[@code='050.020.010.230']/Item='260'">
<cfProjClass>
<cfClassId>ddc3dd10-1cfd-11e1-8bc2-0800200c9a66</cfClassId>
<!-- Coordinator -->
<cfClassSchemeId>94fefd50-1d00-11e1-8bc2-0800200c9a66</cfClassSchemeId>
</cfProjClass>
</xsl:if>
<xsl:if test="Filter/Value[@code='050.020.010.230']/Item='210'">
<cfProjClass>
<cfClassId>ddc3dd10-1cfd-11e1-8bc2-0800200c9a66</cfClassId>
<!-- Participant -->
<cfClassSchemeId>94fefd50-1d00-11e1-8bc2-0800200c9a66</cfClassSchemeId>
</cfProjClass>
</xsl:if>
<cfProj_Fund>
<cfFundId><xsl:value-of select="ExternalPK/Code[@code='050.020.010.260']/Item"/></cfFundId>
<xsl:if test="Entity/EntityName[@code='050.020.010.190']">
<cfOrgUnitId><xsl:value-of select="Entity/EntityName[@code='050.020.010.190']/Item"/></cfOrgUnitId>
</xsl:if>
<cfAmount><xsl:value-of select="EconomicDimension/Value[@code='050.020.010.290']/Item"/></cfAmount>
<cfCurrCode><xsl:value-of select="EconomicDimension/CurrencyType[@code='050.020.010.290']/Item"/></cfCurrCode>
</cfProj_Fund>
<xsl:if test="Link/Entity/EntityID/CVNPK[@code='050.020.010.190']">
<xsl:for-each select="Link/Entity/EntityID/CVNPK[@code='050.020.010.190']">
<cfProj_OrgUnit>
<cfProjId><xsl:value-of select="Item"/></cfProjId>
<cfOrgUnitId><xsl:value-of select="Item"/></cfOrgUnitId>
</cfProj_OrgUnit>
</xsl:for-each>
</xsl:if>
<cfProj_OrgUnit>
<xsl:if test="Entity/EntityName[@code='050.020.010.120']/Item='010'">
<cfClassId></cfClassId>
<!-- Academic Institute -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='050.020.010.120']/Item='000'">
<cfClassId></cfClassId>
<!-- University -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='050.020.010.120']/Item='120'">
<cfClassId></cfClassId>
<!-- Research Institute -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='050.020.010.120']/Item='080'">
<cfClassId></cfClassId>
<!-- Company -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='050.020.010.210']/Item='010'">
<cfClassId></cfClassId>
<!-- Academic Institute -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='050.020.010.210']/Item='000'">
<cfClassId></cfClassId>
<!-- University -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='050.020.010.210']/Item='120'">
<cfClassId></cfClassId>
<!-- Research Institute -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="Entity/EntityName[@code='050.020.010.210']/Item='080'">
<cfClassId></cfClassId>
<!-- Company -->
<cfClassSchemeId>eda2b2ed-34c5-11e1-b86c-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:for-each select="Entity/EntityID/CVNPK[@code='050.020.010.400']">
<cfOrgUnitId>
<xsl:value-of select="Item"/>
</cfOrgUnitId>
</xsl:for-each>
<xsl:if test="Dedication[@code='050.020.010.430']">
<cfFraction>
<xsl:for-each select="Dedication[@code='050.020.010.430']">
<xsl:if test="'020'" /><xsl:value-of select="1" />
</xsl:for-each>
</cfFraction>
</xsl:if>
</cfProj_OrgUnit>
</cfProj>
<xsl:if test="Roll/Value[@code='050.020.010.170']">
<cfFundClass>
<xsl:if test="//Roll/Value[@code='050.020.010.170']/Item='280'">
<cfClassId>c31d3380-1cfd-11e1-8bc2-0800200c9a66</cfClassId>
<!-- Coordinator -->
<cfClassSchemeId>994069a0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="//Roll/Value[@code='050.020.010.170']/Item='290'">
<cfClassId>79a2e340-1cfc-11e1-8bc2-0800200c9a66</cfClassId>
<!-- Manager -->
<cfClassSchemeId>994069a0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="//Roll/Value[@code='050.020.010.170']/Item='490'">
<cfClassId>ebd55ab0-1cfc-11e1-8bc2-0800200c9a66</cfClassId>
<!-- Resarcher -->
<cfClassSchemeId>994069a0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="//Roll/Value[@code='000.010.000.250']/Item='870'">
<cfClassId>8adcdf20-1cfd-11e1-8bc2-0800200c9a66</cfClassId>
<!-- Technician -->
<cfClassSchemeId>994069a0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
</xsl:if>
<xsl:if test="//Roll/Value[@code='000.010.000.250']/Item='890'">
<cfClassId>94d55210-1cfc-11e1-8bc2-0800200c9a66</cfClassId>
<!-- Fellow -->
<cfClassSchemeId>994069a0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
</xsl:if>
</cfFundClass>
</xsl:if>
<cfOrgUnit>
<cfName>
<xsl:value-of select="Entity/EntityName[@code='050.020.010.100']/Item"/>
</cfName>
</cfOrgUnit>
</xsl:if>
<!-- Organization -->
<xsl:if test="CvnItemID/CVNPK/Item = '010.010.000.000'">
<cfOrgUnit>
<cfOrgUnitId><xsl:value-of select="Entity/EntityID/CVNPK[@code='010.010.000.020']/Item"/></cfOrgUnitId>
<cfName><xsl:value-of select="Entity/EntityName[@code='010.010.000.020']/Item"/></cfName>
<xsl:if test="Identification/PersonalIdentification/Contact/Telephone/Number[@code='010.010.000.140']">
<cfUri>
<cfClassId>341b4fcc-9fe4-4760-a9c8-0f36ffa4d614</cfClassId>
<!-- Phone -->
<cfClassSchemeId>6e0d9af0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
<xsl:value-of select="//Identification/PersonalIdentification/Contact/Telephone/Number[@code='010.010.000.140']/Item"/>
</cfUri>
</xsl:if>
<xsl:if test="Identification/PersonalIdentification/Contact/Fax/Number[@code='010.010.000.150']">
<cfUri>
<cfClassId>9931ac41-3864-11e1-b86c-0800200c9a66</cfClassId>
<!-- Fax -->
<cfClassSchemeId>6e0d9af0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
<xsl:value-of select="//Identification/PersonalIdentification/Contact/Fax/Number[@code='010.010.000.150']/Item"/>
</cfUri>
</xsl:if>
<xsl:if test="Identification/PersonalIdentification/Contact/InternetEmailAddress[@code='010.010.000.160']">
<cfUri>
<cfClassId>4523402a-0bae-4716-a5d7-77411b74d5f6</cfClassId>
<!-- Electronic Address -->
<cfClassSchemeId>6e0d9af0-1cd6-11e1-8bc2-0800200c9a66</cfClassSchemeId>
<xsl:value-of select="//Identification/PersonalIdentification/Contact/InternetEmailAddress[@code='010.010.000.160']/Item"/>
</cfUri>
</xsl:if>
</cfOrgUnit>
<xsl:if test="Entity/EntityID/CVNPK[@code='010.010.000.080']">
<cfOrgUnit>
<cfOrgUnitId><xsl:value-of select="Entity/EntityID/CVNPK[@code='010.010.000.080']/Item"/></cfOrgUnitId>
<cfName><xsl:value-of select="Entity/EntityName[@code='010.010.000.080']/Item"/></cfName>
</cfOrgUnit>
</xsl:if>
<xsl:if test="Entity/EntityID/CVNPK[@code='010.010.000.060']">
<cfOrgUnit>
<cfOrgUnitId><xsl:value-of select="Entity/EntityID/CVNPK[@code='010.010.000.060']/Item"/></cfOrgUnitId>
<cfName><xsl:value-of select="Entity/EntityName[@code='010.010.000.060']/Item"/></cfName>
</cfOrgUnit>
</xsl:if>
<xsl:if test="//Place/City[@code='010.010.000.100']">
<cfPAddr>
<xsl:if test="//Place/City[@code='010.010.000.100']">
<cfCityTown><xsl:value-of select="//Place/City[@code='010.010.000.100']/Item"/></cfCityTown>
</xsl:if>
<xsl:if test="//Place/Region/Name[@code='010.010.000.120']">
<cfStateOfCountry><xsl:value-of select="//Place/Region/Name[@code='010.010.000.120']/Item"/></cfStateOfCountry>
</xsl:if>
<xsl:if test="//Place/CountryCode[@code='010.010.000.110']/Item='004'"><cfCountryCode><xsl:value-of select="'AF'"/></cfCountryCode></xsl:if>
</cfPAddr>
</xsl:if>
</xsl:if>
</xsl:for-each>
</CERIF>
</xsl:template>
</xsl:stylesheet>