1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="788858b8-f135-481d-9e24-88459384b32d_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>CONICYT to DB</TITLE>
|
14
|
<CODE>
|
15
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
16
|
xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions">
|
17
|
|
18
|
<xsl:param name="varDataSourceId"/>
|
19
|
<xsl:variable name="namespacePrefix" select="string('conicytf____')"/>
|
20
|
|
21
|
<xsl:variable name="dateFormat" select="string('mm-DD-yyyy')"/>
|
22
|
<xsl:variable name="funderID" select="concat($namespacePrefix, '::CONICYT')"/>
|
23
|
<xsl:variable name="fundingId">
|
24
|
<xsl:value-of
|
25
|
select="concat($funderID, '::', .//column[@name = 'FUNDER STREAM LEVEL I'], '::', .//column[@name = 'FUNDER STREAM LEVEL II'])"
|
26
|
/>
|
27
|
</xsl:variable>
|
28
|
|
29
|
|
30
|
<xsl:template match="/">
|
31
|
<record>
|
32
|
|
33
|
<xsl:copy-of select=".//*[local-name() = 'header']"/>
|
34
|
|
35
|
<metadata>
|
36
|
<ROWS>
|
37
|
<xsl:variable name="projectId"
|
38
|
select="concat($namespacePrefix, '::', normalize-space(.//column[@name = 'PROJECT IDENTIFIER']))"/>
|
39
|
<xsl:variable name="startDate"
|
40
|
select="replace(.//column[@name = 'START DATE'], '/', '-')"/>
|
41
|
|
42
|
<xsl:variable name="endDate"
|
43
|
select="replace(.//column[@name = 'END DATE'], '/', '-')"/>
|
44
|
|
45
|
<ROW table="projects">
|
46
|
|
47
|
<FIELD name="_dnet_resource_identifier_">
|
48
|
<xsl:value-of select="$projectId"/>
|
49
|
</FIELD>
|
50
|
<FIELD name="id">
|
51
|
<xsl:value-of select="$projectId"/>
|
52
|
</FIELD>
|
53
|
<FIELD name="lastupdate" type="date">
|
54
|
<xsl:value-of select="current-dateTime()"/>
|
55
|
</FIELD>
|
56
|
<FIELD name="code">
|
57
|
<xsl:value-of select=".//column[@name = 'PROJECT IDENTIFIER']"/>
|
58
|
</FIELD>
|
59
|
<FIELD name="title">
|
60
|
<xsl:value-of select=".//column[@name = 'PROJECT TITLE']"/>
|
61
|
</FIELD>
|
62
|
<FIELD name="startdate" type="date" format="{$dateFormat}">
|
63
|
<xsl:value-of select="$startDate"/>
|
64
|
</FIELD>
|
65
|
|
66
|
<FIELD name="enddate" type="date" format="{$dateFormat}">
|
67
|
<xsl:value-of select="$endDate"/>
|
68
|
</FIELD>
|
69
|
<FIELD name="websiteurl">
|
70
|
<xsl:value-of select=".//column[@name = 'URL DE INFORME FINAL']"/>
|
71
|
</FIELD>
|
72
|
|
73
|
<FIELD name="contactfullname">
|
74
|
<xsl:choose>
|
75
|
<xsl:when test=".//column[@name = 'DIRECTOR Nombre'] = ''">
|
76
|
|
77
|
<xsl:value-of
|
78
|
select="concat(.//column[@name = 'DIRECTOR Apellido1'], ' ', .//column[@name = 'DIRECTOR Apellido2'])"
|
79
|
/>
|
80
|
</xsl:when>
|
81
|
<xsl:otherwise>
|
82
|
<xsl:choose>
|
83
|
<xsl:when
|
84
|
test=".//column[@name = 'DIRECTOR Apellido1'] = ''">
|
85
|
<xsl:value-of
|
86
|
select=".//column[@name = 'DIRECTOR Nombre']"/>
|
87
|
</xsl:when>
|
88
|
<xsl:otherwise>
|
89
|
<xsl:value-of
|
90
|
select="concat(normalize-space(concat(.//column[@name = 'DIRECTOR Apellido1'], ' ', .//column[@name = 'DIRECTOR Apellido2'])), ', ', .//column[@name = 'DIRECTOR Nombre'])"
|
91
|
/>
|
92
|
</xsl:otherwise>
|
93
|
</xsl:choose>
|
94
|
|
95
|
</xsl:otherwise>
|
96
|
</xsl:choose>
|
97
|
|
98
|
</FIELD>
|
99
|
<FIELD name="lastupdate" type="date">
|
100
|
<xsl:value-of select="current-dateTime()"/>
|
101
|
</FIELD>
|
102
|
<FIELD name="collectedfrom">
|
103
|
<xsl:value-of select="$varDataSourceId"/>
|
104
|
</FIELD>
|
105
|
<FIELD name="provenanceActionClass"
|
106
|
>sysimport:crosswalk:entityregistry</FIELD>
|
107
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
108
|
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
|
109
|
</ROW>
|
110
|
|
111
|
<xsl:for-each
|
112
|
select="tokenize(.//column[@name = 'PARTICIPANT INSTITUTIONS2'], ';')">
|
113
|
<xsl:variable name="organizationId"
|
114
|
select="concat($namespacePrefix, '::', utils:md5(normalize-space(.)))"/>
|
115
|
<ROW table="dsm_organizations">
|
116
|
<FIELD name="_dnet_resource_identifier_">
|
117
|
<xsl:value-of select="$organizationId"/>
|
118
|
</FIELD>
|
119
|
<FIELD name="id">
|
120
|
<xsl:value-of select="$organizationId"/>
|
121
|
</FIELD>
|
122
|
<FIELD name="lastupdate" type="date">
|
123
|
<xsl:value-of select="current-dateTime()"/>
|
124
|
</FIELD>
|
125
|
<FIELD name="legalshortname">
|
126
|
<xsl:value-of select="normalize-space(.)"/>
|
127
|
</FIELD>
|
128
|
<FIELD name="collectedfrom">
|
129
|
<xsl:value-of select="$varDataSourceId"/>
|
130
|
</FIELD>
|
131
|
<FIELD name="provenanceaction"
|
132
|
>sysimport:crosswalk:entityregistry</FIELD>
|
133
|
|
134
|
</ROW>
|
135
|
<ROW table="project_organization">
|
136
|
<FIELD name="_dnet_resource_identifier_">
|
137
|
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
|
138
|
</FIELD>
|
139
|
<FIELD name="project">
|
140
|
<xsl:value-of select="$projectId"/>
|
141
|
</FIELD>
|
142
|
<FIELD name="resporganization">
|
143
|
<xsl:value-of select="$organizationId"/>
|
144
|
</FIELD>
|
145
|
<FIELD name="semanticclass">participant</FIELD>
|
146
|
</ROW>
|
147
|
</xsl:for-each>
|
148
|
|
149
|
<ROW table="project_fundingpath">
|
150
|
<FIELD name="_dnet_resource_identifier_">
|
151
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
152
|
</FIELD>
|
153
|
<FIELD name="funding">
|
154
|
<xsl:value-of select="$fundingId"/>
|
155
|
</FIELD>
|
156
|
<FIELD name="project">
|
157
|
<xsl:value-of select="$projectId"/>
|
158
|
</FIELD>
|
159
|
<FIELD name="startdate" type="date" format="{$dateFormat}">
|
160
|
<xsl:value-of select="$startDate"/>
|
161
|
</FIELD>
|
162
|
<FIELD name="enddate" type="date" format="{$dateFormat}">
|
163
|
<xsl:value-of select="$endDate"/>
|
164
|
</FIELD>
|
165
|
</ROW>
|
166
|
</ROWS>
|
167
|
</metadata>
|
168
|
</record>
|
169
|
</xsl:template>
|
170
|
</xsl:stylesheet>
|
171
|
</CODE>
|
172
|
</SCRIPT>
|
173
|
</CONFIGURATION>
|
174
|
<STATUS/>
|
175
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
176
|
</BODY>
|
177
|
</RESOURCE_PROFILE>
|