Revision 48139
Added by Alessia Bardi over 6 years ago
nsf_2_db.xsl | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 | 2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
3 | 3 |
|
4 |
<xsl:param name="parentDatasourceId" />
|
|
5 |
<xsl:param name="namespacePrefix" select="string('nsf_________')" />
|
|
6 |
|
|
4 |
<xsl:param name="parentDatasourceId"/> |
|
5 |
<xsl:param name="namespacePrefix" select="string('nsf_________')"/> |
|
6 |
|
|
7 | 7 |
<xsl:template match="/"> |
8 | 8 |
<record> |
9 | 9 |
|
... | ... | |
11 | 11 |
<metadata> |
12 | 12 |
<ROWS> |
13 | 13 |
<xsl:if test="string-length(normalize-space(.//AwardTitle)) > 0 and string-length(normalize-space(.//AwardID)) > 0"> |
14 |
|
|
15 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//AwardID))" />
|
|
16 |
<xsl:variable name="orgId" select="concat($namespacePrefix, '::', translate(normalize-space(.//Institution/Name), ' ,.', '___'))" />
|
|
14 |
|
|
15 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//AwardID))"/> |
|
16 |
<xsl:variable name="orgId" select="concat($namespacePrefix, '::', translate(normalize-space(.//Institution/Name), ' ,.', '___'))"/> |
|
17 | 17 |
<xsl:variable name="startDate" select=".//AwardEffectiveDate"/> |
18 | 18 |
<xsl:variable name="endDate" select=".//AwardExpirationDate"/> |
19 |
|
|
19 |
|
|
20 | 20 |
<ROW table="projects"> |
21 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectId" /></FIELD> |
|
22 |
<FIELD name="id"><xsl:value-of select="$projectId" /></FIELD> |
|
23 |
<FIELD name="code"><xsl:value-of select=".//AwardID"/></FIELD> |
|
24 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$startDate" /></FIELD> |
|
25 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$endDate"/></FIELD> |
|
26 |
<FIELD name="title"><xsl:value-of select=".//AwardTitle" /></FIELD> |
|
27 |
<FIELD name="contracttypeclass"><xsl:value-of select=".//AwardInstrument/Value"/></FIELD> |
|
21 |
<FIELD name="_dnet_resource_identifier_"> |
|
22 |
<xsl:value-of select="$projectId"/> |
|
23 |
</FIELD> |
|
24 |
<FIELD name="id"> |
|
25 |
<xsl:value-of select="$projectId"/> |
|
26 |
</FIELD> |
|
27 |
<FIELD name="code"> |
|
28 |
<xsl:value-of select=".//AwardID"/> |
|
29 |
</FIELD> |
|
30 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"> |
|
31 |
<xsl:value-of select="$startDate"/> |
|
32 |
</FIELD> |
|
33 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"> |
|
34 |
<xsl:value-of select="$endDate"/> |
|
35 |
</FIELD> |
|
36 |
<FIELD name="title"> |
|
37 |
<xsl:value-of select=".//AwardTitle"/> |
|
38 |
</FIELD> |
|
39 |
<FIELD name="contracttypeclass"> |
|
40 |
<xsl:value-of select=".//AwardInstrument/Value"/> |
|
41 |
</FIELD> |
|
28 | 42 |
<FIELD name="contracttypescheme">nsf:contractTypes</FIELD> |
29 |
<FIELD name="acronym"> </FIELD>
|
|
43 |
<FIELD name="acronym"></FIELD> |
|
30 | 44 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
31 | 45 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
32 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD> |
|
46 |
<FIELD name="collectedfrom"> |
|
47 |
<xsl:value-of select="$parentDatasourceId"/> |
|
48 |
</FIELD> |
|
33 | 49 |
<!-- <FIELD name="???"><xsl:value-of select=".//AbstractNarration" /></FIELD> --> |
34 | 50 |
</ROW> |
35 |
|
|
51 |
|
|
36 | 52 |
<ROW table="organizations"> |
37 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$orgId" /></FIELD> |
|
38 |
<FIELD name="id"><xsl:value-of select="$orgId" /></FIELD> |
|
39 |
<FIELD name="legalname"><xsl:value-of select=".//Institution/Name" /></FIELD> |
|
40 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD> |
|
53 |
<FIELD name="_dnet_resource_identifier_"> |
|
54 |
<xsl:value-of select="$orgId"/> |
|
55 |
</FIELD> |
|
56 |
<FIELD name="id"> |
|
57 |
<xsl:value-of select="$orgId"/> |
|
58 |
</FIELD> |
|
59 |
<FIELD name="legalname"> |
|
60 |
<xsl:value-of select=".//Institution/Name"/> |
|
61 |
</FIELD> |
|
62 |
<FIELD name="collectedfrom"> |
|
63 |
<xsl:value-of select="$parentDatasourceId"/> |
|
64 |
</FIELD> |
|
41 | 65 |
<xsl:if test="string-length(normalize-space(.//Institution/CountryName)) > 0"> |
42 |
<FIELD name="countryclass"><xsl:value-of select=".//Institution/CountryName" /></FIELD> |
|
66 |
<FIELD name="countryclass"> |
|
67 |
<xsl:value-of select=".//Institution/CountryName"/> |
|
68 |
</FIELD> |
|
43 | 69 |
</xsl:if> |
44 | 70 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
45 | 71 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
46 |
<FIELD name="optional1"><xsl:value-of select=".//Institution/CityName" /></FIELD> |
|
47 |
<FIELD name="optional2"><xsl:value-of select=".//Institution/StreetAddress" /></FIELD> |
|
48 |
</ROW> |
|
72 |
<FIELD name="optional1"> |
|
73 |
<xsl:value-of select=".//Institution/CityName"/> |
|
74 |
</FIELD> |
|
75 |
<FIELD name="optional2"> |
|
76 |
<xsl:value-of select=".//Institution/StreetAddress"/> |
|
77 |
</FIELD> |
|
78 |
</ROW> |
|
49 | 79 |
|
50 | 80 |
<xsl:for-each select=".//Investigator[./RoleCode='Principal Investigator'] | .//Investigator[./RoleCode='Co-Principal Investigator'] | .//Investigator[./RoleCode='Former Principal Investigator'] | .//Investigator[./RoleCode='Former Co-Principal Investigator']"> |
51 | 81 |
<xsl:if test="position() = 1"> |
52 | 82 |
<xsl:variable name="personName" select="normalize-space(./FirstName)"/> |
53 | 83 |
<xsl:variable name="personSurname" select="normalize-space(./LastName)"></xsl:variable> |
54 | 84 |
<xsl:if test="$personName != '' and $personSurname != '' and $personName != 'NO DATA AVAILABLE' and $personSurname != 'NO DATA AVAILABLE'"> |
55 |
<xsl:variable name="personId" select="concat($projectId, '::', translate(concat($personName, ' ', $personSurname), ' ,.', '___'))" />
|
|
85 |
<xsl:variable name="personId" select="concat($projectId, '::', translate(concat($personName, ' ', $personSurname), ' ,.', '___'))"/> |
|
56 | 86 |
<ROW table="persons"> |
57 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$personId" /></FIELD> |
|
58 |
<FIELD name="id"><xsl:value-of select="$personId" /></FIELD> |
|
59 |
<FIELD name="firstname"><xsl:value-of select="./FirstName" /></FIELD> |
|
60 |
<FIELD name="secondnames"><xsl:value-of select="./LastName" /></FIELD> |
|
61 |
<FIELD name="email"><xsl:value-of select="./EmailAddress" /></FIELD> |
|
62 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD> |
|
87 |
<FIELD name="_dnet_resource_identifier_"> |
|
88 |
<xsl:value-of select="$personId"/> |
|
89 |
</FIELD> |
|
90 |
<FIELD name="id"> |
|
91 |
<xsl:value-of select="$personId"/> |
|
92 |
</FIELD> |
|
93 |
<FIELD name="firstname"> |
|
94 |
<xsl:value-of select="./FirstName"/> |
|
95 |
</FIELD> |
|
96 |
<FIELD name="secondnames"> |
|
97 |
<xsl:value-of select="./LastName"/> |
|
98 |
</FIELD> |
|
99 |
<FIELD name="email"> |
|
100 |
<xsl:value-of select="./EmailAddress"/> |
|
101 |
</FIELD> |
|
102 |
<FIELD name="collectedfrom"> |
|
103 |
<xsl:value-of select="$parentDatasourceId"/> |
|
104 |
</FIELD> |
|
63 | 105 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
64 | 106 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
65 |
<FIELD name="optional1"><xsl:value-of select="./RoleCode" /></FIELD> |
|
107 |
<FIELD name="optional1"> |
|
108 |
<xsl:value-of select="./RoleCode"/> |
|
109 |
</FIELD> |
|
66 | 110 |
</ROW> |
67 | 111 |
</xsl:if> |
68 | 112 |
</xsl:if> |
69 | 113 |
</xsl:for-each> |
70 |
|
|
114 |
|
|
71 | 115 |
<ROW table="project_organization"> |
72 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectId, '@@', $orgId)" /></FIELD> |
|
116 |
<FIELD name="_dnet_resource_identifier_"> |
|
117 |
<xsl:value-of select="concat($projectId, '@@', $orgId)"/> |
|
118 |
</FIELD> |
|
73 | 119 |
<FIELD name="participantnumber" type="int">1</FIELD> |
74 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$startDate" /></FIELD> |
|
75 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$endDate" /></FIELD> |
|
76 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD> |
|
77 |
<FIELD name="resporganization"><xsl:value-of select="$orgId" /></FIELD> |
|
120 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"> |
|
121 |
<xsl:value-of select="$startDate"/> |
|
122 |
</FIELD> |
|
123 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"> |
|
124 |
<xsl:value-of select="$endDate"/> |
|
125 |
</FIELD> |
|
126 |
<FIELD name="project"> |
|
127 |
<xsl:value-of select="$projectId"/> |
|
128 |
</FIELD> |
|
129 |
<FIELD name="resporganization"> |
|
130 |
<xsl:value-of select="$orgId"/> |
|
131 |
</FIELD> |
|
78 | 132 |
<xsl:for-each select=".//Investigator[./RoleCode='Principal Investigator'] | .//Investigator[./RoleCode='Co-Principal Investigator'] | .//Investigator[./RoleCode='Former Principal Investigator'] | .//Investigator[./RoleCode='Former Co-Principal Investigator']"> |
79 | 133 |
<xsl:if test="position() = 1"> |
80 | 134 |
<xsl:variable name="personName" select="normalize-space(./FirstName)"/> |
81 | 135 |
<xsl:variable name="personSurname" select="normalize-space(./LastName)"></xsl:variable> |
82 | 136 |
<xsl:if test="$personName != '' and $personSurname != '' and $personName != 'NO DATA AVAILABLE' and $personSurname != 'NO DATA AVAILABLE'"> |
83 |
<FIELD name="contactperson"><xsl:value-of select="concat($projectId, '::', translate(concat($personName, ' ', $personSurname), ' ,.', '___'))" /></FIELD> |
|
137 |
<FIELD name="contactperson"> |
|
138 |
<xsl:value-of select="concat($projectId, '::', translate(concat($personName, ' ', $personSurname), ' ,.', '___'))"/> |
|
139 |
</FIELD> |
|
84 | 140 |
</xsl:if> |
85 | 141 |
</xsl:if> |
86 | 142 |
</xsl:for-each> |
... | ... | |
88 | 144 |
<FIELD name="semanticclass">coordinator</FIELD> |
89 | 145 |
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD> |
90 | 146 |
</ROW> |
91 |
|
|
147 |
|
|
92 | 148 |
<xsl:for-each select=".//FoaInformation"> |
93 | 149 |
<xsl:variable name="subjectId" select="concat($namespacePrefix, '::', normalize-space(./Code))"/> |
94 |
|
|
150 |
|
|
95 | 151 |
<ROW table="subjects"> |
96 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$subjectId" /></FIELD> |
|
97 |
<FIELD name="id"><xsl:value-of select="$subjectId" /></FIELD> |
|
98 |
<FIELD name="name"><xsl:value-of select="./Name" /></FIELD> |
|
152 |
<FIELD name="_dnet_resource_identifier_"> |
|
153 |
<xsl:value-of select="$subjectId"/> |
|
154 |
</FIELD> |
|
155 |
<FIELD name="id"> |
|
156 |
<xsl:value-of select="$subjectId"/> |
|
157 |
</FIELD> |
|
158 |
<FIELD name="name"> |
|
159 |
<xsl:value-of select="./Name"/> |
|
160 |
</FIELD> |
|
99 | 161 |
<FIELD name="semanticclass">nsf:fieldOfApplication</FIELD> |
100 | 162 |
<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD> |
101 | 163 |
</ROW> |
102 |
|
|
164 |
|
|
103 | 165 |
<ROW table="project_subject"> |
104 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectId, '@@', $subjectId)" /></FIELD> |
|
105 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD> |
|
106 |
<FIELD name="subject"><xsl:value-of select="$subjectId" /></FIELD> |
|
166 |
<FIELD name="_dnet_resource_identifier_"> |
|
167 |
<xsl:value-of select="concat($projectId, '@@', $subjectId)"/> |
|
168 |
</FIELD> |
|
169 |
<FIELD name="project"> |
|
170 |
<xsl:value-of select="$projectId"/> |
|
171 |
</FIELD> |
|
172 |
<FIELD name="subject"> |
|
173 |
<xsl:value-of select="$subjectId"/> |
|
174 |
</FIELD> |
|
107 | 175 |
</ROW> |
108 | 176 |
</xsl:for-each> |
109 | 177 |
<!-- |
... | ... | |
134 | 202 |
</xsl:for-each> |
135 | 203 |
--> |
136 | 204 |
|
137 |
|
|
205 |
|
|
138 | 206 |
<xsl:for-each select="//funding"> |
139 | 207 |
<xsl:variable name="directorate" select="normalize-space(./orgDirectorateAbbr)"/> |
140 | 208 |
<xsl:variable name="division" select="normalize-space(./orgDivisionAbbr)"/> |
... | ... | |
211 | 279 |
<xsl:variable name="personSurname" select="normalize-space(./LastName)"></xsl:variable> |
212 | 280 |
<xsl:choose> |
213 | 281 |
<xsl:when test="$personName != '' and $personSurname != '' and $personName != 'NO DATA AVAILABLE' and $personSurname != 'NO DATA AVAILABLE'"> |
214 |
<xsl:value-of select="concat($projectID, '::', translate(concat($personName, ' ', $personSurname), ' ,.', '___'))" />
|
|
282 |
<xsl:value-of select="concat($projectID, '::', translate(concat($personName, ' ', $personSurname), ' ,.', '___'))"/> |
|
215 | 283 |
</xsl:when> |
216 |
<xsl:otherwise><xsl:value-of select="string('NA')"/></xsl:otherwise> |
|
284 |
<xsl:otherwise> |
|
285 |
<xsl:value-of select="string('NA')"/> |
|
286 |
</xsl:otherwise> |
|
217 | 287 |
</xsl:choose> |
218 | 288 |
</xsl:if> |
219 | 289 |
</xsl:for-each> |
Also available in: Unified diff
integrated (hopefully) all required changes from dnet40