1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="4a5e5153-7b96-4881-8dfe-afcb85db7270_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>NIH to DB</TITLE>
|
14
|
<CODE>
|
15
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
16
|
|
17
|
<xsl:param name="parentDatasourceId"/>
|
18
|
<xsl:param name="namespacePrefix"/>
|
19
|
<xsl:param name="quote">"</xsl:param>
|
20
|
|
21
|
<xsl:variable name="funderID" select="concat($namespacePrefix, '::NIH')"/>
|
22
|
<xsl:variable name="fundingName" select="upper-case(normalize-space(//IC_NAME))"/>
|
23
|
<xsl:variable name="fundingID">
|
24
|
<xsl:choose>
|
25
|
<xsl:when test="$fundingName != ''">
|
26
|
<xsl:value-of select="concat($funderID, '::', $fundingName)"/>
|
27
|
</xsl:when>
|
28
|
<xsl:otherwise>
|
29
|
<xsl:value-of select="$funderID"/>
|
30
|
</xsl:otherwise>
|
31
|
</xsl:choose>
|
32
|
</xsl:variable>
|
33
|
|
34
|
<xsl:variable name="projectID" select="concat($namespacePrefix, '::', .//FULL_PROJECT_NUM)"/>
|
35
|
<xsl:variable name="orgID" select="concat($namespacePrefix, '::', upper-case(translate(.//ORG_NAME, ' ,', '__')))"/>
|
36
|
|
37
|
<xsl:variable name="terms" select="string-join(.//PROJECT_TERMS/TERM/text(), ',')"/>
|
38
|
<xsl:variable name="termsx" select="string-join(.//PROJECT_TERMSX/TERM/text(), ',')"/>
|
39
|
|
40
|
<xsl:template name="getJson">
|
41
|
<xsl:param name="varName"/>
|
42
|
<xsl:param name="value"/>
|
43
|
<xsl:value-of select="concat($quote, $varName, $quote, ':', $quote, $value, $quote)"/>
|
44
|
</xsl:template>
|
45
|
|
46
|
<xsl:template match="/">
|
47
|
<record>
|
48
|
|
49
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
50
|
<metadata>
|
51
|
<ROWS>
|
52
|
<xsl:if test="string-length(normalize-space(.//PROJECT_TITLE)) > 0 and string-length($projectID) > 0">
|
53
|
|
54
|
<xsl:variable name="startDate" select=".//PROJECT_START"/>
|
55
|
<xsl:variable name="endDate" select=".//PROJECT_END"/>
|
56
|
|
57
|
<xsl:variable name="orgname">
|
58
|
<xsl:call-template name="getJson">
|
59
|
<xsl:with-param name="varName">orgname</xsl:with-param>
|
60
|
<xsl:with-param name="value">
|
61
|
<xsl:value-of select=".//ORG_NAME"/>
|
62
|
</xsl:with-param>
|
63
|
</xsl:call-template>
|
64
|
</xsl:variable>
|
65
|
<xsl:variable name="activity">
|
66
|
<xsl:call-template name="getJson">
|
67
|
<xsl:with-param name="varName">activity</xsl:with-param>
|
68
|
<xsl:with-param name="value">
|
69
|
<xsl:value-of select=".//ACTIVITY"/>
|
70
|
</xsl:with-param>
|
71
|
</xsl:call-template>
|
72
|
</xsl:variable>
|
73
|
<xsl:variable name="administeringic">
|
74
|
<xsl:call-template name="getJson">
|
75
|
<xsl:with-param name="varName">administeringic</xsl:with-param>
|
76
|
<xsl:with-param name="value">
|
77
|
<xsl:value-of select=".//ADMINISTERING_IC"/>
|
78
|
</xsl:with-param>
|
79
|
</xsl:call-template>
|
80
|
</xsl:variable>
|
81
|
<xsl:variable name="serialnumber">
|
82
|
<xsl:call-template name="getJson">
|
83
|
<xsl:with-param name="varName">serialnumber</xsl:with-param>
|
84
|
<xsl:with-param name="value">
|
85
|
<xsl:value-of select=".//SERIAL_NUMBER"/>
|
86
|
</xsl:with-param>
|
87
|
</xsl:call-template>
|
88
|
</xsl:variable>
|
89
|
<xsl:variable name="coreprojectnum">
|
90
|
<xsl:call-template name="getJson">
|
91
|
<xsl:with-param name="varName">coreprojectnum</xsl:with-param>
|
92
|
<xsl:with-param name="value">
|
93
|
<xsl:value-of select=".//CORE_PROJECT_NUM"/>
|
94
|
</xsl:with-param>
|
95
|
</xsl:call-template>
|
96
|
</xsl:variable>
|
97
|
|
98
|
<xsl:variable name="jsonExtra">
|
99
|
<xsl:value-of select="concat('{', $orgname, ',', $activity, ',', $administeringic ,',',$serialnumber, ',', $coreprojectnum, '}')"/>
|
100
|
</xsl:variable>
|
101
|
|
102
|
<ROW table="projects">
|
103
|
<FIELD name="_dnet_resource_identifier_">
|
104
|
<xsl:value-of select="$projectID"/>
|
105
|
</FIELD>
|
106
|
<FIELD name="id">
|
107
|
<xsl:value-of select="$projectID"/>
|
108
|
</FIELD>
|
109
|
<FIELD name="code">
|
110
|
<xsl:value-of select=".//FULL_PROJECT_NUM"/>
|
111
|
</FIELD>
|
112
|
<FIELD name="startdate" type="date" format="MM/dd/yyyy">
|
113
|
<xsl:value-of select="$startDate"/>
|
114
|
</FIELD>
|
115
|
<FIELD name="enddate" type="date" format="MM/dd/yyyy">
|
116
|
<xsl:value-of select="$endDate"/>
|
117
|
</FIELD>
|
118
|
<FIELD name="title">
|
119
|
<xsl:value-of select=".//PROJECT_TITLE"/>
|
120
|
</FIELD>
|
121
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
122
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
123
|
<FIELD name="collectedfrom">
|
124
|
<xsl:value-of select="$parentDatasourceId"/>
|
125
|
</FIELD>
|
126
|
<FIELD name="optional1">
|
127
|
<xsl:value-of select="concat(.//TOTAL_COST, ' $')"/>
|
128
|
</FIELD>
|
129
|
<FIELD name="jsonextrainfo">
|
130
|
<xsl:value-of select="$jsonExtra"/>
|
131
|
</FIELD>
|
132
|
</ROW>
|
133
|
<ROW table="project_fundingpath">
|
134
|
<FIELD name="_dnet_resource_identifier_">
|
135
|
<xsl:value-of select="concat($fundingID,'@@', $projectID)"/>
|
136
|
</FIELD>
|
137
|
<FIELD name="funding">
|
138
|
<xsl:value-of select="$fundingID"/>
|
139
|
</FIELD>
|
140
|
<FIELD name="project">
|
141
|
<xsl:value-of select="$projectID"/>
|
142
|
</FIELD>
|
143
|
<FIELD name="startdate" type="date" format="MM/dd/yyyy">
|
144
|
<xsl:value-of select="$startDate"/>
|
145
|
</FIELD>
|
146
|
<FIELD name="enddate" type="date" format="MM/dd/yyyy">
|
147
|
<xsl:value-of select="$endDate"/>
|
148
|
</FIELD>
|
149
|
</ROW>
|
150
|
<xsl:if test="string-length($orgID) > 4">
|
151
|
<ROW table="organizations">
|
152
|
<FIELD name="_dnet_resource_identifier_">
|
153
|
<xsl:value-of select="$orgID"/>
|
154
|
</FIELD>
|
155
|
<FIELD name="id">
|
156
|
<xsl:value-of select="$orgID"/>
|
157
|
</FIELD>
|
158
|
<FIELD name="legalname">
|
159
|
<xsl:value-of select=".//ORG_NAME"/>
|
160
|
</FIELD>
|
161
|
<FIELD name="collectedfrom">
|
162
|
<xsl:value-of select="$parentDatasourceId"/>
|
163
|
</FIELD>
|
164
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
165
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
166
|
<FIELD name="trust" type="float">0.8</FIELD>
|
167
|
</ROW>
|
168
|
<ROW table="project_organization">
|
169
|
<FIELD name="_dnet_resource_identifier_">
|
170
|
<xsl:value-of select="concat($projectID, '@@', $orgID)"/>
|
171
|
</FIELD>
|
172
|
<FIELD name="participantnumber" type="int">1</FIELD>
|
173
|
<FIELD name="startdate" type="date" format="MM/dd/yyyy">
|
174
|
<xsl:value-of select="$startDate"/>
|
175
|
</FIELD>
|
176
|
<FIELD name="enddate" type="date" format="MM/dd/yyyy">
|
177
|
<xsl:value-of select="$endDate"/>
|
178
|
</FIELD>
|
179
|
<FIELD name="project">
|
180
|
<xsl:value-of select="$projectID"/>
|
181
|
</FIELD>
|
182
|
<FIELD name="resporganization">
|
183
|
<xsl:value-of select="$orgID"/>
|
184
|
</FIELD>
|
185
|
<FIELD name="semanticclass">participant</FIELD>
|
186
|
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
|
187
|
</ROW>
|
188
|
</xsl:if>
|
189
|
</xsl:if>
|
190
|
</ROWS>
|
191
|
</metadata>
|
192
|
</record>
|
193
|
</xsl:template>
|
194
|
</xsl:stylesheet>
|
195
|
</CODE>
|
196
|
</SCRIPT>
|
197
|
</CONFIGURATION>
|
198
|
<STATUS/>
|
199
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
200
|
</BODY>
|
201
|
</RESOURCE_PROFILE>
|