1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="637baddc-8c95-479d-8763-9847718d79f5_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>SNSF to DB</TITLE>
|
14
|
<CODE>
|
15
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
16
|
|
17
|
<xsl:param name="varDataSourceId"/>
|
18
|
<xsl:param name="namespacePrefix" select="string('snsf_________')"/>
|
19
|
<xsl:param name="quote">"</xsl:param>
|
20
|
|
21
|
<xsl:template match="/">
|
22
|
<record>
|
23
|
|
24
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
25
|
<metadata>
|
26
|
<ROWS>
|
27
|
<xsl:if test="string-length(normalize-space(.//column[@name='Project Title'])) > 0 and string-length(normalize-space(.//column[@name='Project Number'])) > 0">
|
28
|
|
29
|
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Project Number']))"/>
|
30
|
|
31
|
<xsl:variable name="orgId" select="concat($namespacePrefix, '::', translate(normalize-space(.//column[@name='Institution']), ' ,.', '___'))"/>
|
32
|
|
33
|
<xsl:variable name="startDate" select=".//column[@name='Start Date']"/>
|
34
|
<xsl:variable name="endDate" select=".//column[@name='End Date']"/>
|
35
|
|
36
|
<ROW table="projects">
|
37
|
<FIELD name="_dnet_resource_identifier_">
|
38
|
<xsl:value-of select="$projectId"/>
|
39
|
</FIELD>
|
40
|
<FIELD name="id">
|
41
|
<xsl:value-of select="$projectId"/>
|
42
|
</FIELD>
|
43
|
<FIELD name="code">
|
44
|
<xsl:value-of select="normalize-space(.//column[@name='Project Number String'])"/>
|
45
|
</FIELD>
|
46
|
<FIELD name="startdate" type="date" format="dd.MM.yyyy">
|
47
|
<xsl:value-of select="$startDate"/>
|
48
|
</FIELD>
|
49
|
<FIELD name="enddate" type="date" format="dd.MM.yyyy">
|
50
|
<xsl:value-of select="$endDate"/>
|
51
|
</FIELD>
|
52
|
<FIELD name="title">
|
53
|
<xsl:value-of select=".//column[@name='Project Title']"/>
|
54
|
</FIELD>
|
55
|
<FIELD name="acronym"></FIELD>
|
56
|
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD>
|
57
|
<FIELD name="provenanceactionscheme">dnet:provenanceActions</FIELD>
|
58
|
<FIELD name="collectedfrom">
|
59
|
<xsl:value-of select="$varDataSourceId"/>
|
60
|
</FIELD>
|
61
|
<!-- <FIELD name="???"><xsl:value-of select=".//AbstractNarration" /></FIELD> -->
|
62
|
<xsl:variable name="personName" select="normalize-space(.//column[@name='Responsible Applicant'])"/>
|
63
|
<xsl:if test="string-length($personName) > 0">
|
64
|
<FIELD name="contactfullname">
|
65
|
<xsl:value-of select="$personName"/>
|
66
|
</FIELD>
|
67
|
</xsl:if>
|
68
|
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
|
69
|
</ROW>
|
70
|
|
71
|
<ROW table="dsm_organizations">
|
72
|
<FIELD name="_dnet_resource_identifier_">
|
73
|
<xsl:value-of select="$orgId"/>
|
74
|
</FIELD>
|
75
|
<FIELD name="id">
|
76
|
<xsl:value-of select="$orgId"/>
|
77
|
</FIELD>
|
78
|
<FIELD name="legalname">
|
79
|
<xsl:value-of select=".//column[@name='Institution']"/>
|
80
|
</FIELD>
|
81
|
<FIELD name="collectedfrom">
|
82
|
<xsl:value-of select="$varDataSourceId"/>
|
83
|
</FIELD>
|
84
|
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
|
85
|
|
86
|
<FIELD name="optional1">
|
87
|
<xsl:value-of select=".//column[@name='University']"/>
|
88
|
</FIELD>
|
89
|
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
|
90
|
</ROW>
|
91
|
|
92
|
<ROW table="project_organization">
|
93
|
<FIELD name="_dnet_resource_identifier_">
|
94
|
<xsl:value-of select="concat($projectId, '@@', $orgId)"/>
|
95
|
</FIELD>
|
96
|
|
97
|
<FIELD name="project">
|
98
|
<xsl:value-of select="$projectId"/>
|
99
|
</FIELD>
|
100
|
<FIELD name="resporganization">
|
101
|
<xsl:value-of select="$orgId"/>
|
102
|
</FIELD>
|
103
|
<FIELD name="semanticclass">coordinator</FIELD>
|
104
|
</ROW>
|
105
|
|
106
|
<xsl:variable name="p0" select="normalize-space(.//column[@name='Funding Instrument Hierarchy'])"/>
|
107
|
<xsl:variable name="p1" select="normalize-space(.//column[@name='Funding Instrument'])"/>
|
108
|
|
109
|
<xsl:variable name="fundingId">
|
110
|
<xsl:choose>
|
111
|
<xsl:when test="(string-length($p0) > 0) and (string-length($p1) > 0)">
|
112
|
<xsl:value-of select="concat($namespacePrefix, '::SNSF::', $p0, '::', $p1)"/>
|
113
|
</xsl:when>
|
114
|
<xsl:when test="string-length($p0) > 0">
|
115
|
<xsl:value-of select="concat($namespacePrefix, '::SNSF::', $p0)"/>
|
116
|
</xsl:when>
|
117
|
<xsl:when test="string-length($p1) > 0">
|
118
|
<xsl:value-of select="concat($namespacePrefix, '::SNSF::', $p1)"/>
|
119
|
</xsl:when>
|
120
|
</xsl:choose>
|
121
|
</xsl:variable>
|
122
|
|
123
|
<ROW table="project_fundingpath">
|
124
|
<FIELD name="_dnet_resource_identifier_">
|
125
|
<xsl:value-of select="concat(normalize-space($fundingId),'@@', $projectId)"/>
|
126
|
</FIELD>
|
127
|
<FIELD name="funding">
|
128
|
<xsl:value-of select="normalize-space($fundingId)"/>
|
129
|
</FIELD>
|
130
|
<FIELD name="project">
|
131
|
<xsl:value-of select="$projectId"/>
|
132
|
</FIELD>
|
133
|
<FIELD name="startdate" type="date" format="dd.MM.yyyy">
|
134
|
<xsl:value-of select="$startDate"/>
|
135
|
</FIELD>
|
136
|
<FIELD name="enddate" type="date" format="dd.MM.yyyy">
|
137
|
<xsl:value-of select="$endDate"/>
|
138
|
</FIELD>
|
139
|
</ROW>
|
140
|
|
141
|
</xsl:if>
|
142
|
</ROWS>
|
143
|
</metadata>
|
144
|
</record>
|
145
|
</xsl:template>
|
146
|
|
147
|
</xsl:stylesheet>
|
148
|
</CODE>
|
149
|
</SCRIPT>
|
150
|
</CONFIGURATION>
|
151
|
<STATUS/>
|
152
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
153
|
</BODY>
|
154
|
</RESOURCE_PROFILE>
|