Revision 48139
Added by Alessia Bardi almost 7 years ago
nih_2_db.xsl | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr" xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:fn="http://www.w3.org/2005/xpath-functions">
|
|
2 |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|
3 | 3 |
|
4 |
<xsl:param name="parentDatasourceId" />
|
|
5 |
<xsl:param name="namespacePrefix" />
|
|
4 |
<xsl:param name="parentDatasourceId"/> |
|
5 |
<xsl:param name="namespacePrefix"/> |
|
6 | 6 |
<xsl:param name="quote">"</xsl:param> |
7 | 7 |
|
8 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::NIH')" />
|
|
8 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::NIH')"/> |
|
9 | 9 |
<xsl:variable name="fundingName" select="upper-case(normalize-space(//IC_NAME))"/> |
10 | 10 |
<xsl:variable name="fundingID"> |
11 | 11 |
<xsl:choose> |
12 | 12 |
<xsl:when test="$fundingName != ''"> |
13 |
<xsl:value-of select="concat($funderID, '::', translate($fundingName,' ','_'))"/>
|
|
13 |
<xsl:value-of select="concat($funderID, '::', $fundingName)"/>
|
|
14 | 14 |
</xsl:when> |
15 | 15 |
<xsl:otherwise> |
16 | 16 |
<xsl:value-of select="$funderID"/> |
... | ... | |
18 | 18 |
</xsl:choose> |
19 | 19 |
</xsl:variable> |
20 | 20 |
|
21 |
<xsl:variable name="projectID" select="concat($namespacePrefix, '::', .//FULL_PROJECT_NUM)" />
|
|
22 |
<xsl:variable name="orgID" select="concat($namespacePrefix, '::', upper-case(translate(.//ORG_NAME, ' ,', '__')))" />
|
|
21 |
<xsl:variable name="projectID" select="concat($namespacePrefix, '::', .//FULL_PROJECT_NUM)"/> |
|
22 |
<xsl:variable name="orgID" select="concat($namespacePrefix, '::', upper-case(translate(.//ORG_NAME, ' ,', '__')))"/> |
|
23 | 23 |
|
24 | 24 |
<xsl:variable name="terms" select="string-join(.//PROJECT_TERMS/TERM/text(), ',')"/> |
25 | 25 |
<xsl:variable name="termsx" select="string-join(.//PROJECT_TERMSX/TERM/text(), ',')"/> |
... | ... | |
31 | 31 |
</xsl:template> |
32 | 32 |
|
33 | 33 |
<xsl:template match="/"> |
34 |
<record xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
35 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" |
|
36 |
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
37 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"> |
|
34 |
<record |
|
35 |
> |
|
38 | 36 |
|
39 | 37 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
40 | 38 |
<metadata> |
... | ... | |
47 | 45 |
<xsl:variable name="orgname"> |
48 | 46 |
<xsl:call-template name="getJson"> |
49 | 47 |
<xsl:with-param name="varName">orgname</xsl:with-param> |
50 |
<xsl:with-param name="value"><xsl:value-of select=".//ORG_NAME"/></xsl:with-param> |
|
48 |
<xsl:with-param name="value"> |
|
49 |
<xsl:value-of select=".//ORG_NAME"/> |
|
50 |
</xsl:with-param> |
|
51 | 51 |
</xsl:call-template> |
52 | 52 |
</xsl:variable> |
53 | 53 |
<xsl:variable name="activity"> |
54 | 54 |
<xsl:call-template name="getJson"> |
55 | 55 |
<xsl:with-param name="varName">activity</xsl:with-param> |
56 |
<xsl:with-param name="value"><xsl:value-of select=".//ACTIVITY"/></xsl:with-param> |
|
56 |
<xsl:with-param name="value"> |
|
57 |
<xsl:value-of select=".//ACTIVITY"/> |
|
58 |
</xsl:with-param> |
|
57 | 59 |
</xsl:call-template> |
58 | 60 |
</xsl:variable> |
59 | 61 |
<xsl:variable name="administeringic"> |
60 | 62 |
<xsl:call-template name="getJson"> |
61 | 63 |
<xsl:with-param name="varName">administeringic</xsl:with-param> |
62 |
<xsl:with-param name="value"><xsl:value-of select=".//ADMINISTERING_IC"/></xsl:with-param> |
|
64 |
<xsl:with-param name="value"> |
|
65 |
<xsl:value-of select=".//ADMINISTERING_IC"/> |
|
66 |
</xsl:with-param> |
|
63 | 67 |
</xsl:call-template> |
64 | 68 |
</xsl:variable> |
65 | 69 |
<xsl:variable name="serialnumber"> |
66 | 70 |
<xsl:call-template name="getJson"> |
67 | 71 |
<xsl:with-param name="varName">serialnumber</xsl:with-param> |
68 |
<xsl:with-param name="value"><xsl:value-of select=".//SERIAL_NUMBER"/></xsl:with-param> |
|
72 |
<xsl:with-param name="value"> |
|
73 |
<xsl:value-of select=".//SERIAL_NUMBER"/> |
|
74 |
</xsl:with-param> |
|
69 | 75 |
</xsl:call-template> |
70 | 76 |
</xsl:variable> |
71 | 77 |
<xsl:variable name="coreprojectnum"> |
72 | 78 |
<xsl:call-template name="getJson"> |
73 | 79 |
<xsl:with-param name="varName">coreprojectnum</xsl:with-param> |
74 |
<xsl:with-param name="value"><xsl:value-of select=".//CORE_PROJECT_NUM"/></xsl:with-param> |
|
80 |
<xsl:with-param name="value"> |
|
81 |
<xsl:value-of select=".//CORE_PROJECT_NUM"/> |
|
82 |
</xsl:with-param> |
|
75 | 83 |
</xsl:call-template> |
76 | 84 |
</xsl:variable> |
77 | 85 |
|
... | ... | |
80 | 88 |
</xsl:variable> |
81 | 89 |
|
82 | 90 |
<ROW table="projects"> |
83 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectID" /></FIELD> |
|
84 |
<FIELD name="id"><xsl:value-of select="$projectID" /></FIELD> |
|
85 |
<FIELD name="code"><xsl:value-of select=".//FULL_PROJECT_NUM"/></FIELD> |
|
86 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$startDate" /></FIELD> |
|
87 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$endDate" /></FIELD> |
|
88 |
<FIELD name="title"><xsl:value-of select=".//PROJECT_TITLE" /></FIELD> |
|
91 |
<FIELD name="_dnet_resource_identifier_"> |
|
92 |
<xsl:value-of select="$projectID"/> |
|
93 |
</FIELD> |
|
94 |
<FIELD name="id"> |
|
95 |
<xsl:value-of select="$projectID"/> |
|
96 |
</FIELD> |
|
97 |
<FIELD name="code"> |
|
98 |
<xsl:value-of select=".//FULL_PROJECT_NUM"/> |
|
99 |
</FIELD> |
|
100 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"> |
|
101 |
<xsl:value-of select="$startDate"/> |
|
102 |
</FIELD> |
|
103 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"> |
|
104 |
<xsl:value-of select="$endDate"/> |
|
105 |
</FIELD> |
|
106 |
<FIELD name="title"> |
|
107 |
<xsl:value-of select=".//PROJECT_TITLE"/> |
|
108 |
</FIELD> |
|
89 | 109 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
90 | 110 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
91 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD> |
|
92 |
<FIELD name="optional1"><xsl:value-of select="concat(.//TOTAL_COST, ' $')" /></FIELD> |
|
93 |
<FIELD name="jsonextrainfo"><xsl:value-of select="$jsonExtra"/></FIELD> |
|
111 |
<FIELD name="collectedfrom"> |
|
112 |
<xsl:value-of select="$parentDatasourceId"/> |
|
113 |
</FIELD> |
|
114 |
<FIELD name="optional1"> |
|
115 |
<xsl:value-of select="concat(.//TOTAL_COST, ' $')"/> |
|
116 |
</FIELD> |
|
117 |
<FIELD name="jsonextrainfo"> |
|
118 |
<xsl:value-of select="$jsonExtra"/> |
|
119 |
</FIELD> |
|
94 | 120 |
</ROW> |
95 | 121 |
<ROW table="project_fundingpath"> |
96 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($fundingID,'@@', $projectID)" /></FIELD> |
|
97 |
<FIELD name="funding"><xsl:value-of select="$fundingID" /></FIELD> |
|
98 |
<FIELD name="project"><xsl:value-of select="$projectID" /></FIELD> |
|
99 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$startDate" /></FIELD> |
|
100 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$endDate" /></FIELD> |
|
122 |
<FIELD name="_dnet_resource_identifier_"> |
|
123 |
<xsl:value-of select="concat($fundingID,'@@', $projectID)"/> |
|
124 |
</FIELD> |
|
125 |
<FIELD name="funding"> |
|
126 |
<xsl:value-of select="$fundingID"/> |
|
127 |
</FIELD> |
|
128 |
<FIELD name="project"> |
|
129 |
<xsl:value-of select="$projectID"/> |
|
130 |
</FIELD> |
|
131 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"> |
|
132 |
<xsl:value-of select="$startDate"/> |
|
133 |
</FIELD> |
|
134 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"> |
|
135 |
<xsl:value-of select="$endDate"/> |
|
136 |
</FIELD> |
|
101 | 137 |
</ROW> |
102 | 138 |
|
103 | 139 |
<!-- |
... | ... | |
118 | 154 |
|
119 | 155 |
<xsl:if test="string-length($orgID) > 4"> |
120 | 156 |
<ROW table="organizations"> |
121 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$orgID" /></FIELD> |
|
122 |
<FIELD name="id"><xsl:value-of select="$orgID" /></FIELD> |
|
123 |
<FIELD name="legalname"><xsl:value-of select=".//ORG_NAME" /></FIELD> |
|
124 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD> |
|
157 |
<FIELD name="_dnet_resource_identifier_"> |
|
158 |
<xsl:value-of select="$orgID"/> |
|
159 |
</FIELD> |
|
160 |
<FIELD name="id"> |
|
161 |
<xsl:value-of select="$orgID"/> |
|
162 |
</FIELD> |
|
163 |
<FIELD name="legalname"> |
|
164 |
<xsl:value-of select=".//ORG_NAME"/> |
|
165 |
</FIELD> |
|
166 |
<FIELD name="collectedfrom"> |
|
167 |
<xsl:value-of select="$parentDatasourceId"/> |
|
168 |
</FIELD> |
|
125 | 169 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
126 | 170 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
127 | 171 |
<FIELD name="trust" type="float">0.8</FIELD> |
128 | 172 |
</ROW> |
129 | 173 |
<ROW table="project_organization"> |
130 | 174 |
<!--<xsl:variable name="contactPerson" select=".//PIS/PI[./PI_ID != ''][1]"/> --> |
131 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectID, '@@', $orgID)" /></FIELD> |
|
175 |
<FIELD name="_dnet_resource_identifier_"> |
|
176 |
<xsl:value-of select="concat($projectID, '@@', $orgID)"/> |
|
177 |
</FIELD> |
|
132 | 178 |
<FIELD name="participantnumber" type="int">1</FIELD> |
133 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$startDate" /></FIELD> |
|
134 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$endDate" /></FIELD> |
|
135 |
<FIELD name="project"><xsl:value-of select="$projectID" /></FIELD> |
|
136 |
<FIELD name="resporganization"><xsl:value-of select="$orgID" /></FIELD> |
|
179 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"> |
|
180 |
<xsl:value-of select="$startDate"/> |
|
181 |
</FIELD> |
|
182 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"> |
|
183 |
<xsl:value-of select="$endDate"/> |
|
184 |
</FIELD> |
|
185 |
<FIELD name="project"> |
|
186 |
<xsl:value-of select="$projectID"/> |
|
187 |
</FIELD> |
|
188 |
<FIELD name="resporganization"> |
|
189 |
<xsl:value-of select="$orgID"/> |
|
190 |
</FIELD> |
|
137 | 191 |
<!-- |
138 | 192 |
<xsl:if test="$contactPerson"> |
139 | 193 |
<FIELD name="contactperson"><xsl:value-of select="concat($namespacePrefix, '::', $contactPerson/PI_ID)" /></FIELD> |
Also available in: Unified diff
integrated (hopefully) all required changes from dnet40