Revision 52627
Added by Alessia Bardi over 6 years ago
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/nsf_2_db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
|
3 |
|
|
4 |
<xsl:param name="parentDatasourceId"/> |
|
5 |
<xsl:param name="namespacePrefix" select="string('nsf_________')"/> |
|
6 |
|
|
7 |
<xsl:template match="/"> |
|
8 |
<record> |
|
9 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
10 |
<metadata> |
|
11 |
<ROWS> |
|
12 |
<xsl:if test="string-length(normalize-space(.//AwardTitle)) > 0 and string-length(normalize-space(.//AwardID)) > 0"> |
|
13 |
|
|
14 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//AwardID))"/> |
|
15 |
<xsl:variable name="orgId" select="concat($namespacePrefix, '::', translate(normalize-space(.//Institution/Name), ' ,.', '___'))"/> |
|
16 |
<xsl:variable name="startDate" select=".//AwardEffectiveDate"/> |
|
17 |
<xsl:variable name="endDate" select=".//AwardExpirationDate"/> |
|
18 |
|
|
19 |
<ROW table="projects"> |
|
20 |
<FIELD name="_dnet_resource_identifier_"> |
|
21 |
<xsl:value-of select="$projectId"/> |
|
22 |
</FIELD> |
|
23 |
<FIELD name="id"> |
|
24 |
<xsl:value-of select="$projectId"/> |
|
25 |
</FIELD> |
|
26 |
<FIELD name="code"> |
|
27 |
<xsl:value-of select=".//AwardID"/> |
|
28 |
</FIELD> |
|
29 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"> |
|
30 |
<xsl:value-of select="$startDate"/> |
|
31 |
</FIELD> |
|
32 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"> |
|
33 |
<xsl:value-of select="$endDate"/> |
|
34 |
</FIELD> |
|
35 |
<FIELD name="title"> |
|
36 |
<xsl:value-of select=".//AwardTitle"/> |
|
37 |
</FIELD> |
|
38 |
<xsl:for-each select=".//Investigator[./RoleCode='Principal Investigator'] | .//Investigator[./RoleCode='Co-Principal Investigator'] | .//Investigator[./RoleCode='Former Principal Investigator'] | .//Investigator[./RoleCode='Former Co-Principal Investigator']"> |
|
39 |
<xsl:if test="position() = 1"> |
|
40 |
<xsl:variable name="personName" select="normalize-space(./FirstName)"/> |
|
41 |
<xsl:variable name="personSurname" select="normalize-space(./LastName)"></xsl:variable> |
|
42 |
<xsl:variable name="email" select="./EmailAddress"/> |
|
43 |
<xsl:choose> |
|
44 |
<xsl:when test="$personName != '' and $personName != 'NO DATA AVAILABLE'"> |
|
45 |
<xsl:choose> |
|
46 |
<xsl:when test="$personSurname != '' and $personSurname != 'NO DATA AVAILABLE'"> |
|
47 |
<FIELD name="contactfullname"> |
|
48 |
<xsl:value-of select="concat($personSurname,', ' ,$personName)"/> |
|
49 |
</FIELD> |
|
50 |
</xsl:when> |
|
51 |
<xsl:otherwise> |
|
52 |
<FIELD name="contactfullname"> |
|
53 |
<xsl:value-of select="$personName"/> |
|
54 |
</FIELD> |
|
55 |
</xsl:otherwise> |
|
56 |
</xsl:choose> |
|
57 |
</xsl:when> |
|
58 |
<xsl:otherwise> |
|
59 |
<xsl:if test="$personSurname != '' and $personSurname != 'NO DATA AVAILABLE'"> |
|
60 |
<FIELD> |
|
61 |
<FIELD name="contactfullname"> |
|
62 |
<xsl:value-of select="$personSurname"/> |
|
63 |
</FIELD> |
|
64 |
</FIELD> |
|
65 |
</xsl:if> |
|
66 |
</xsl:otherwise> |
|
67 |
</xsl:choose> |
|
68 |
|
|
69 |
</xsl:if> |
|
70 |
</xsl:for-each> |
|
71 |
|
|
72 |
|
|
73 |
<FIELD name="contracttypeclass"> |
|
74 |
<xsl:value-of select=".//AwardInstrument/Value"/> |
|
75 |
</FIELD> |
|
76 |
<FIELD name="contracttypescheme">nsf:contractTypes</FIELD> |
|
77 |
<FIELD name="acronym"></FIELD> |
|
78 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
79 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
80 |
<FIELD name="collectedfrom"> |
|
81 |
<xsl:value-of select="$parentDatasourceId"/> |
|
82 |
</FIELD> |
|
83 |
<!-- <FIELD name="???"><xsl:value-of select=".//AbstractNarration" /></FIELD> --> |
|
84 |
</ROW> |
|
85 |
|
|
86 |
<ROW table="organizations"> |
|
87 |
<FIELD name="_dnet_resource_identifier_"> |
|
88 |
<xsl:value-of select="$orgId"/> |
|
89 |
</FIELD> |
|
90 |
<FIELD name="id"> |
|
91 |
<xsl:value-of select="$orgId"/> |
|
92 |
</FIELD> |
|
93 |
<FIELD name="legalname"> |
|
94 |
<xsl:value-of select=".//Institution/Name"/> |
|
95 |
</FIELD> |
|
96 |
<FIELD name="collectedfrom"> |
|
97 |
<xsl:value-of select="$parentDatasourceId"/> |
|
98 |
</FIELD> |
|
99 |
<xsl:if test="string-length(normalize-space(.//Institution/CountryName)) > 0"> |
|
100 |
<FIELD name="countryclass"> |
|
101 |
<xsl:value-of select=".//Institution/CountryName"/> |
|
102 |
</FIELD> |
|
103 |
</xsl:if> |
|
104 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
105 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
106 |
<FIELD name="optional1"> |
|
107 |
<xsl:value-of select=".//Institution/CityName"/> |
|
108 |
</FIELD> |
|
109 |
<FIELD name="optional2"> |
|
110 |
<xsl:value-of select=".//Institution/StreetAddress"/> |
|
111 |
</FIELD> |
|
112 |
</ROW> |
|
113 |
|
|
114 |
<ROW table="project_organization"> |
|
115 |
<FIELD name="_dnet_resource_identifier_"> |
|
116 |
<xsl:value-of select="concat($projectId, '@@', $orgId)"/> |
|
117 |
</FIELD> |
|
118 |
<FIELD name="participantnumber" type="int">1</FIELD> |
|
119 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"> |
|
120 |
<xsl:value-of select="$startDate"/> |
|
121 |
</FIELD> |
|
122 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"> |
|
123 |
<xsl:value-of select="$endDate"/> |
|
124 |
</FIELD> |
|
125 |
<FIELD name="project"> |
|
126 |
<xsl:value-of select="$projectId"/> |
|
127 |
</FIELD> |
|
128 |
<FIELD name="resporganization"> |
|
129 |
<xsl:value-of select="$orgId"/> |
|
130 |
</FIELD> |
|
131 |
<FIELD name="semanticclass">coordinator</FIELD> |
|
132 |
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD> |
|
133 |
</ROW> |
|
134 |
|
|
135 |
<xsl:for-each select=".//FoaInformation"> |
|
136 |
<xsl:variable name="subjectId" select="concat($namespacePrefix, '::', normalize-space(./Code))"/> |
|
137 |
|
|
138 |
<ROW table="subjects"> |
|
139 |
<FIELD name="_dnet_resource_identifier_"> |
|
140 |
<xsl:value-of select="$subjectId"/> |
|
141 |
</FIELD> |
|
142 |
<FIELD name="id"> |
|
143 |
<xsl:value-of select="$subjectId"/> |
|
144 |
</FIELD> |
|
145 |
<FIELD name="name"> |
|
146 |
<xsl:value-of select="./Name"/> |
|
147 |
</FIELD> |
|
148 |
<FIELD name="semanticclass">nsf:fieldOfApplication</FIELD> |
|
149 |
<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD> |
|
150 |
</ROW> |
|
151 |
|
|
152 |
<ROW table="project_subject"> |
|
153 |
<FIELD name="_dnet_resource_identifier_"> |
|
154 |
<xsl:value-of select="concat($projectId, '@@', $subjectId)"/> |
|
155 |
</FIELD> |
|
156 |
<FIELD name="project"> |
|
157 |
<xsl:value-of select="$projectId"/> |
|
158 |
</FIELD> |
|
159 |
<FIELD name="subject"> |
|
160 |
<xsl:value-of select="$subjectId"/> |
|
161 |
</FIELD> |
|
162 |
</ROW> |
|
163 |
</xsl:for-each> |
|
164 |
<!-- |
|
165 |
<xsl:for-each select=".//ProgramElement"> |
|
166 |
<xsl:if test="string-length(normalize-space(./Code)) > 0"> |
|
167 |
<xsl:variable name="fundingId" select="concat($namespacePrefix, '::NSF::PEC::', normalize-space(./Code))" /> |
|
168 |
<ROW table="project_fundingpath"> |
|
169 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($fundingId,'@@', $projectId)" /></FIELD> |
|
170 |
<FIELD name="funding"><xsl:value-of select="$fundingId" /></FIELD> |
|
171 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD> |
|
172 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$startDate" /></FIELD> |
|
173 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$endDate" /></FIELD> |
|
174 |
</ROW> |
|
175 |
</xsl:if> |
|
176 |
</xsl:for-each> |
|
177 |
|
|
178 |
<xsl:for-each select=".//ProgramReference"> |
|
179 |
<xsl:if test="string-length(normalize-space(./Code)) > 0"> |
|
180 |
<xsl:variable name="fundingId" select="concat($namespacePrefix, '::NSF::PRC::', normalize-space(./Code))"/> |
|
181 |
<ROW table="project_fundingpath"> |
|
182 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($fundingId,'@@', $projectId)" /></FIELD> |
|
183 |
<FIELD name="funding"><xsl:value-of select="$fundingId" /></FIELD> |
|
184 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD> |
|
185 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$startDate" /></FIELD> |
|
186 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"><xsl:value-of select="$endDate" /></FIELD> |
|
187 |
</ROW> |
|
188 |
</xsl:if> |
|
189 |
</xsl:for-each> |
|
190 |
--> |
|
191 |
|
|
192 |
|
|
193 |
<xsl:for-each select="//funding"> |
|
194 |
<xsl:variable name="directorate" select="normalize-space(./orgDirectorateAbbr)"/> |
|
195 |
<xsl:variable name="division" select="normalize-space(./orgDivisionAbbr)"/> |
|
196 |
<xsl:variable name="fundingId"> |
|
197 |
<xsl:choose> |
|
198 |
<xsl:when test="string-length($directorate) > 0"> |
|
199 |
<xsl:choose> |
|
200 |
<xsl:when test="string-length($division) > 0"> |
|
201 |
<xsl:value-of select="concat($namespacePrefix, '::NSF::', $directorate, '::', $division)"/> |
|
202 |
</xsl:when> |
|
203 |
<xsl:otherwise> |
|
204 |
<xsl:value-of select="concat($namespacePrefix, '::NSF::', $directorate)"/> |
|
205 |
</xsl:otherwise> |
|
206 |
</xsl:choose> |
|
207 |
</xsl:when> |
|
208 |
<xsl:otherwise> |
|
209 |
<xsl:value-of select="concat($namespacePrefix, '::NSF')"/> |
|
210 |
</xsl:otherwise> |
|
211 |
</xsl:choose> |
|
212 |
</xsl:variable> |
|
213 |
|
|
214 |
<ROW table="project_fundingpath"> |
|
215 |
<FIELD name="_dnet_resource_identifier_"> |
|
216 |
<xsl:value-of select="concat($fundingId,'@@', $projectId)"/> |
|
217 |
</FIELD> |
|
218 |
<FIELD name="funding"> |
|
219 |
<xsl:value-of select="$fundingId"/> |
|
220 |
</FIELD> |
|
221 |
<FIELD name="project"> |
|
222 |
<xsl:value-of select="$projectId"/> |
|
223 |
</FIELD> |
|
224 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"> |
|
225 |
<xsl:value-of select="$startDate"/> |
|
226 |
</FIELD> |
|
227 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"> |
|
228 |
<xsl:value-of select="$endDate"/> |
|
229 |
</FIELD> |
|
230 |
</ROW> |
|
231 |
</xsl:for-each> |
|
232 |
|
|
233 |
<!-- If there is no funding element at all, let's add a funding path that contains only the funder. --> |
|
234 |
<xsl:if test="not(//funding)"> |
|
235 |
<xsl:variable name="fundingId" select="concat($namespacePrefix, '::NSF')"/> |
|
236 |
<ROW table="project_fundingpath"> |
|
237 |
<FIELD name="_dnet_resource_identifier_"> |
|
238 |
<xsl:value-of select="concat($fundingId,'@@', $projectId)"/> |
|
239 |
</FIELD> |
|
240 |
<FIELD name="funding"> |
|
241 |
<xsl:value-of select="$fundingId"/> |
|
242 |
</FIELD> |
|
243 |
<FIELD name="project"> |
|
244 |
<xsl:value-of select="$projectId"/> |
|
245 |
</FIELD> |
|
246 |
<FIELD name="startdate" type="date" format="MM/dd/yyyy"> |
|
247 |
<xsl:value-of select="$startDate"/> |
|
248 |
</FIELD> |
|
249 |
<FIELD name="enddate" type="date" format="MM/dd/yyyy"> |
|
250 |
<xsl:value-of select="$endDate"/> |
|
251 |
</FIELD> |
|
252 |
</ROW> |
|
253 |
</xsl:if> |
|
254 |
|
|
255 |
</xsl:if> |
|
256 |
</ROWS> |
|
257 |
</metadata> |
|
258 |
</record> |
|
259 |
</xsl:template> |
|
260 |
</xsl:stylesheet> |
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/tara_2_db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
3 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
|
4 |
exclude-result-prefixes="xs" version="1.0"> |
|
5 |
|
|
6 |
<xsl:param name="parentDatasourceId"/> |
|
7 |
<xsl:param name="namespacePrefix"/> |
|
8 |
|
|
9 |
<xsl:template match="/"> |
|
10 |
|
|
11 |
<xsl:variable name="funderId" select="string('taraexp_____::tara')"/> |
|
12 |
|
|
13 |
<record> |
|
14 |
|
|
15 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
16 |
|
|
17 |
<metadata> |
|
18 |
<ROWS> |
|
19 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='PROJECT ID']))"/> |
|
20 |
<xsl:variable name="startDate" select=".//column[@name='START DATE']"/> |
|
21 |
<xsl:variable name="endDate" select=".//column[@name='END DATE']"/> |
|
22 |
|
|
23 |
<ROW table="projects"> |
|
24 |
<FIELD name="_dnet_resource_identifier_"> |
|
25 |
<xsl:value-of select="$projectId"/> |
|
26 |
</FIELD> |
|
27 |
<FIELD name="id"> |
|
28 |
<xsl:value-of select="$projectId"/> |
|
29 |
</FIELD> |
|
30 |
<FIELD name="code"> |
|
31 |
<xsl:value-of select=".//column[@name='PROJECT ID']"/> |
|
32 |
</FIELD> |
|
33 |
<FIELD name="title"> |
|
34 |
<xsl:value-of select=".//column[@name='PROJECT TITLE']"/> |
|
35 |
</FIELD> |
|
36 |
<FIELD name="jsonextrainfo"> |
|
37 |
<xsl:value-of select=".//column[@name='DM KEYWORDS']"/> |
|
38 |
</FIELD> |
|
39 |
<FIELD name="startdate" type="date" format="yyyy"> |
|
40 |
<xsl:value-of select="$startDate"/> |
|
41 |
</FIELD> |
|
42 |
<FIELD name="enddate" type="date" format="yyyy"> |
|
43 |
<xsl:value-of select="$endDate"/> |
|
44 |
</FIELD> |
|
45 |
<FIELD name="collectedfrom"> |
|
46 |
<xsl:value-of select="$parentDatasourceId"/> |
|
47 |
</FIELD> |
|
48 |
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD> |
|
49 |
</ROW> |
|
50 |
|
|
51 |
<ROW table="project_fundingpath"> |
|
52 |
<FIELD name="_dnet_resource_identifier_"> |
|
53 |
<xsl:value-of select="concat($funderId, '@@', $projectId)"/> |
|
54 |
</FIELD> |
|
55 |
<FIELD name="funding"> |
|
56 |
<xsl:value-of select="$funderId"/> |
|
57 |
</FIELD> |
|
58 |
<FIELD name="project"> |
|
59 |
<xsl:value-of select="$projectId"/> |
|
60 |
</FIELD> |
|
61 |
<FIELD name="startdate" type="date" format="yyyy"> |
|
62 |
<xsl:value-of select="$startDate"/> |
|
63 |
</FIELD> |
|
64 |
<FIELD name="enddate" type="date" format="yyyy"> |
|
65 |
<xsl:value-of select="$endDate"/> |
|
66 |
</FIELD> |
|
67 |
</ROW> |
|
68 |
|
|
69 |
</ROWS> |
|
70 |
</metadata> |
|
71 |
</record> |
|
72 |
</xsl:template> |
|
73 |
|
|
74 |
</xsl:stylesheet> |
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/corda_2_db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|
3 |
|
|
4 |
<xsl:param name="parentDatasourceId"/> |
|
5 |
|
|
6 |
<xsl:template name="dateCorda"> |
|
7 |
<xsl:param name="datename"/> |
|
8 |
<xsl:param name="datevalue"/> |
|
9 |
<FIELD name="{$datename}" type="date" format="dd-MMM-yyyy"> |
|
10 |
<xsl:value-of select="concat(substring($datevalue, 1, 2),'-',substring($datevalue,3,3),'-',substring($datevalue,6,4))"/> |
|
11 |
</FIELD> |
|
12 |
</xsl:template> |
|
13 |
|
|
14 |
<xsl:variable name="namespacePrefix" select="string('ec__________')"/> |
|
15 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')"/> |
|
16 |
|
|
17 |
<xsl:template match="/"> |
|
18 |
<record> |
|
19 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
20 |
<metadata> |
|
21 |
<ROWS> |
|
22 |
<xsl:for-each select="//Project"> |
|
23 |
|
|
24 |
<xsl:variable name="specificName"> |
|
25 |
<xsl:choose> |
|
26 |
<xsl:when test="normalize-space(./ProjectSpecificProgram)"> |
|
27 |
<xsl:value-of select="normalize-space(./ProjectSpecificProgram)"/> |
|
28 |
</xsl:when> |
|
29 |
<xsl:otherwise> |
|
30 |
<xsl:value-of select="string('UNKNOWN')"/> |
|
31 |
</xsl:otherwise> |
|
32 |
</xsl:choose> |
|
33 |
</xsl:variable> |
|
34 |
|
|
35 |
<xsl:variable name="specificDesc" select="./ProjectSpecificProgramDescr"/> |
|
36 |
<xsl:variable name="specificId" select="normalize-space(concat($funderID, '::FP7::', $specificName))"/> |
|
37 |
|
|
38 |
<xsl:variable name="projectProgramName"> |
|
39 |
<xsl:choose> |
|
40 |
<xsl:when test="normalize-space(./ProjectProgram)"> |
|
41 |
<xsl:value-of select="normalize-space(./ProjectProgram)"/> |
|
42 |
</xsl:when> |
|
43 |
<xsl:otherwise> |
|
44 |
<xsl:value-of select="string('UNKNOWN')"/> |
|
45 |
</xsl:otherwise> |
|
46 |
</xsl:choose> |
|
47 |
</xsl:variable> |
|
48 |
|
|
49 |
<xsl:variable name="projectProgramDesc" select="./ProjectProgramDescr"/> |
|
50 |
<xsl:variable name="projectProgramId" select="concat($funderID, '::FP7::', $specificName, '::', $projectProgramName)"/> |
|
51 |
<xsl:variable name="projectId" select="concat('corda_______::', normalize-space(./ProjectId))"/> |
|
52 |
|
|
53 |
<!-- |
|
54 |
<ROW table="fundings"> |
|
55 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$specificId" /></FIELD> |
|
56 |
<FIELD name="id"><xsl:value-of select="$specificId" /></FIELD> |
|
57 |
<FIELD name="name"><xsl:value-of select="$specificName" /></FIELD> |
|
58 |
<FIELD name="description"><xsl:value-of select="$specificDesc" /></FIELD> |
|
59 |
<FIELD name="semanticclass">ec:specificprogram</FIELD> |
|
60 |
<FIELD name="semanticscheme">ec:funding_typologies</FIELD> |
|
61 |
</ROW> |
|
62 |
|
|
63 |
<ROW table="fundings"> |
|
64 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectProgramId" /></FIELD> |
|
65 |
<FIELD name="id"><xsl:value-of select="$projectProgramId" /></FIELD> |
|
66 |
<FIELD name="name"><xsl:value-of select="$projectProgramName" /></FIELD> |
|
67 |
<FIELD name="description"><xsl:value-of select="$projectProgramDesc" /></FIELD> |
|
68 |
<FIELD name="semanticclass">ec:program</FIELD> |
|
69 |
<FIELD name="semanticscheme">ec:funding_typologies</FIELD> |
|
70 |
</ROW> |
|
71 |
|
|
72 |
<ROW table="funding_funding"> |
|
73 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($specificId, '@@corda_______::FP7')" /></FIELD> |
|
74 |
<FIELD name="funding1"><xsl:value-of select="$specificId" /></FIELD> |
|
75 |
<FIELD name="funding2">corda_______::FP7</FIELD> |
|
76 |
<FIELD name="semanticclass">ec:hasframeworkprogram</FIELD> |
|
77 |
<FIELD name="semanticscheme">ec:funding_relations</FIELD> |
|
78 |
</ROW> |
|
79 |
|
|
80 |
<ROW table="funding_funding"> |
|
81 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectProgramId, '@@', $specificId)" /></FIELD> |
|
82 |
<FIELD name="funding1"><xsl:value-of select="$projectProgramId" /></FIELD> |
|
83 |
<FIELD name="funding2"><xsl:value-of select="$specificId" /></FIELD> |
|
84 |
<FIELD name="semanticclass">ec:hasspecificprogram</FIELD> |
|
85 |
<FIELD name="semanticscheme">ec:funding_relations</FIELD> |
|
86 |
</ROW> |
|
87 |
--> |
|
88 |
|
|
89 |
<ROW table="projects"> |
|
90 |
<FIELD name="_dnet_resource_identifier_"> |
|
91 |
<xsl:value-of select="$projectId"/> |
|
92 |
</FIELD> |
|
93 |
<FIELD name="id"> |
|
94 |
<xsl:value-of select="$projectId"/> |
|
95 |
</FIELD> |
|
96 |
<FIELD name="code"> |
|
97 |
<xsl:value-of select="./ProjectId"/> |
|
98 |
</FIELD> |
|
99 |
<FIELD name="acronym"> |
|
100 |
<xsl:value-of select="./ProjectAcronym"/> |
|
101 |
</FIELD> |
|
102 |
<FIELD name="title"> |
|
103 |
<xsl:value-of select="./ProjectTitle"/> |
|
104 |
</FIELD> |
|
105 |
<xsl:call-template name="dateCorda"> |
|
106 |
<xsl:with-param name="datename">startdate</xsl:with-param> |
|
107 |
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param> |
|
108 |
</xsl:call-template> |
|
109 |
<xsl:call-template name="dateCorda"> |
|
110 |
<xsl:with-param name="datename">enddate</xsl:with-param> |
|
111 |
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param> |
|
112 |
</xsl:call-template> |
|
113 |
<FIELD name="call_identifier"> |
|
114 |
<xsl:value-of select="./ProjectCallIdentifier"/> |
|
115 |
</FIELD> |
|
116 |
<FIELD name="ec_sc39" type="boolean"> |
|
117 |
<xsl:value-of select="./SpecialClause39"/> |
|
118 |
</FIELD> |
|
119 |
<FIELD name="oa_mandate_for_publications" type="boolean"> |
|
120 |
<xsl:value-of select="./SpecialClause39"/> |
|
121 |
</FIELD> |
|
122 |
<FIELD name="collectedfrom"> |
|
123 |
<xsl:value-of select="$parentDatasourceId"/> |
|
124 |
</FIELD> |
|
125 |
<FIELD name="contracttypeclass"> |
|
126 |
<xsl:value-of select="./ProjectFundingScheme"/> |
|
127 |
</FIELD> |
|
128 |
<FIELD name="contracttypescheme">ec:FP7contractTypes</FIELD> |
|
129 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
130 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
131 |
<FIELD name="websiteurl"> |
|
132 |
<xsl:value-of select="./ProjectInternetAddress"/> |
|
133 |
</FIELD> |
|
134 |
<FIELD name="optional1"> |
|
135 |
<xsl:value-of select="./ProjectSubFundingScheme"/> |
|
136 |
</FIELD> |
|
137 |
<FIELD name="optional2"> |
|
138 |
<xsl:value-of select="./ProjectCallWebpageUrl"/> |
|
139 |
</FIELD> |
|
140 |
<xsl:variable name="personSurname" select="normalize-space(./CoordinatorContactPerson/PersonLastName)"/> |
|
141 |
<xsl:variable name="personFirstName" select="normalize-space(./CoordinatorContactPerson/PersonFirstName)"/> |
|
142 |
<xsl:variable name="contactfullname"> |
|
143 |
<xsl:choose> |
|
144 |
<xsl:when test="string-length($personFirstName) > 0 and string-length($personSurname) > 0"> |
|
145 |
<xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/> |
|
146 |
</xsl:when> |
|
147 |
<xsl:when test="string-length($personFirstName) > 0"> |
|
148 |
<xsl:value-of select="$personFirstName"/> |
|
149 |
</xsl:when> |
|
150 |
<xsl:when test="string-length($personSurname) > 0"> |
|
151 |
<xsl:value-of select="$personSurname"/> |
|
152 |
</xsl:when> |
|
153 |
<xsl:otherwise> |
|
154 |
<xsl:value-of select="''"/> |
|
155 |
</xsl:otherwise> |
|
156 |
</xsl:choose> |
|
157 |
</xsl:variable> |
|
158 |
<xsl:if test="string-length($contactfullname) > 0"> |
|
159 |
<FIELD name="contactfullname"> |
|
160 |
<xsl:value-of select="$contactfullname"/> |
|
161 |
</FIELD> |
|
162 |
</xsl:if> |
|
163 |
<xsl:variable name="contactfax" select="normalize-space(./CoordinatorContactPerson/ContactFax)"/> |
|
164 |
<xsl:if test="string-length($contactfax) > 0"> |
|
165 |
<FIELD name="contactfax"> |
|
166 |
<xsl:value-of select="$contactfax"/> |
|
167 |
</FIELD> |
|
168 |
</xsl:if> |
|
169 |
<xsl:variable name="contactphone" select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/> |
|
170 |
<xsl:if test="string-length($contactphone) > 0"> |
|
171 |
<FIELD name="contactphone"> |
|
172 |
<xsl:value-of select="$contactphone"/> |
|
173 |
</FIELD> |
|
174 |
</xsl:if> |
|
175 |
<xsl:variable name="contactemail" select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/> |
|
176 |
<xsl:if test="string-length($contactemail) > 0"> |
|
177 |
<FIELD name="contactemail"> |
|
178 |
<xsl:value-of select="$contactemail"/> |
|
179 |
</FIELD> |
|
180 |
</xsl:if> |
|
181 |
</ROW> |
|
182 |
|
|
183 |
<!-- |
|
184 |
<ROW table="project_funding"> |
|
185 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectProgramId, '@@', $projectId)" /></FIELD> |
|
186 |
<FIELD name="funding"><xsl:value-of select="$projectProgramId" /></FIELD> |
|
187 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD> |
|
188 |
<xsl:call-template name="dateCorda"> |
|
189 |
<xsl:with-param name="datename">startdate</xsl:with-param> |
|
190 |
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param> |
|
191 |
</xsl:call-template> |
|
192 |
<xsl:call-template name="dateCorda"> |
|
193 |
<xsl:with-param name="datename">enddate</xsl:with-param> |
|
194 |
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param> |
|
195 |
</xsl:call-template> |
|
196 |
<FIELD name="semanticclass"><xsl:value-of select="./ProjectFundingScheme" /></FIELD> |
|
197 |
<FIELD name="semanticscheme">ec:FP7contractTypes</FIELD> |
|
198 |
</ROW> |
|
199 |
--> |
|
200 |
|
|
201 |
<ROW table="project_fundingpath"> |
|
202 |
<FIELD name="_dnet_resource_identifier_"> |
|
203 |
<xsl:value-of select="concat($projectProgramId, '@@', $projectId)"/> |
|
204 |
</FIELD> |
|
205 |
<FIELD name="funding"> |
|
206 |
<xsl:value-of select="$projectProgramId"/> |
|
207 |
</FIELD> |
|
208 |
<FIELD name="project"> |
|
209 |
<xsl:value-of select="$projectId"/> |
|
210 |
</FIELD> |
|
211 |
<xsl:call-template name="dateCorda"> |
|
212 |
<xsl:with-param name="datename">startdate</xsl:with-param> |
|
213 |
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param> |
|
214 |
</xsl:call-template> |
|
215 |
<xsl:call-template name="dateCorda"> |
|
216 |
<xsl:with-param name="datename">enddate</xsl:with-param> |
|
217 |
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param> |
|
218 |
</xsl:call-template> |
|
219 |
<FIELD name="semanticclass"> |
|
220 |
<xsl:value-of select="./ProjectFundingScheme"/> |
|
221 |
</FIELD> |
|
222 |
<FIELD name="semanticscheme">ec:FP7contractTypes</FIELD> |
|
223 |
</ROW> |
|
224 |
</xsl:for-each> |
|
225 |
|
|
226 |
<xsl:for-each select="//OrganisationParticipant"> |
|
227 |
<xsl:variable name="organizationId" select="concat('corda_______::', ./OrganisationPIC)"/> |
|
228 |
<xsl:variable name="projectId" select="concat('corda_______::', normalize-space(../ProjectId))"/> |
|
229 |
<xsl:variable name="whitelist" select="'0123456789'"/> |
|
230 |
<ROW table="organizations"> |
|
231 |
<FIELD name="_dnet_resource_identifier_"> |
|
232 |
<xsl:value-of select="$organizationId"/> |
|
233 |
</FIELD> |
|
234 |
<FIELD name="id"> |
|
235 |
<xsl:value-of select="$organizationId"/> |
|
236 |
</FIELD> |
|
237 |
<FIELD name="legalshortname"> |
|
238 |
<xsl:value-of select="./OrganisationShortName"/> |
|
239 |
</FIELD> |
|
240 |
<FIELD name="legalname"> |
|
241 |
<xsl:value-of select="./OrganisationLegalName"/> |
|
242 |
</FIELD> |
|
243 |
<FIELD name="websiteurl"> |
|
244 |
<xsl:choose> |
|
245 |
<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')"> |
|
246 |
<xsl:value-of select="./OrganisationWebPage"/> |
|
247 |
</xsl:when> |
|
248 |
<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) > 0"> |
|
249 |
<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/> |
|
250 |
</xsl:when> |
|
251 |
</xsl:choose> |
|
252 |
</FIELD> |
|
253 |
<FIELD name="ec_legalbody" type="boolean"> |
|
254 |
<xsl:value-of select="./PublicBody"/> |
|
255 |
</FIELD> |
|
256 |
<FIELD name="ec_legalperson" type="boolean"> |
|
257 |
<xsl:value-of select="./LegalPerson"/> |
|
258 |
</FIELD> |
|
259 |
<FIELD name="ec_nonprofit" type="boolean"> |
|
260 |
<xsl:value-of select="./NonProfit"/> |
|
261 |
</FIELD> |
|
262 |
<FIELD name="ec_researchorganization" type="boolean"> |
|
263 |
<xsl:value-of select="./ResearchOrganisation"/> |
|
264 |
</FIELD> |
|
265 |
<FIELD name="ec_highereducation" type="boolean"> |
|
266 |
<xsl:value-of select="./HigherEducation"/> |
|
267 |
</FIELD> |
|
268 |
<FIELD name="ec_internationalorganizationeurinterests" type="boolean"> |
|
269 |
<xsl:value-of select="./InternationalOrgEurInterest"/> |
|
270 |
</FIELD> |
|
271 |
<FIELD name="ec_internationalorganization" type="boolean"> |
|
272 |
<xsl:value-of select="./InternationalOrgEurInterest"/> |
|
273 |
</FIELD> |
|
274 |
<FIELD name="ec_enterprise" type="boolean"> |
|
275 |
<xsl:value-of select="./Enterprise"/> |
|
276 |
</FIELD> |
|
277 |
<FIELD name="ec_smevalidated" type="boolean"> |
|
278 |
<xsl:value-of select="./SMEValidated"/> |
|
279 |
</FIELD> |
|
280 |
<FIELD name="countryclass"> |
|
281 |
<xsl:value-of select="./OrganisationCountry"/> |
|
282 |
</FIELD> |
|
283 |
<FIELD name="countryscheme">dnet:countries</FIELD> |
|
284 |
<FIELD name="collectedfrom"> |
|
285 |
<xsl:value-of select="$parentDatasourceId"/> |
|
286 |
</FIELD> |
|
287 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
288 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
289 |
<FIELD name="trust" type="float"> |
|
290 |
<xsl:value-of select="0.8"/> |
|
291 |
</FIELD> |
|
292 |
</ROW> |
|
293 |
|
|
294 |
<ROW table="project_organization"> |
|
295 |
<FIELD name="_dnet_resource_identifier_"> |
|
296 |
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/> |
|
297 |
</FIELD> |
|
298 |
<xsl:choose> |
|
299 |
<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) > 0"> |
|
300 |
<FIELD name="participantnumber" type="int">9999</FIELD> |
|
301 |
</xsl:when> |
|
302 |
<xsl:otherwise> |
|
303 |
<FIELD name="participantnumber" type="int"> |
|
304 |
<xsl:value-of select="./ParticipantOrder"/> |
|
305 |
</FIELD> |
|
306 |
</xsl:otherwise> |
|
307 |
</xsl:choose> |
|
308 |
<FIELD name="project"> |
|
309 |
<xsl:value-of select="$projectId"/> |
|
310 |
</FIELD> |
|
311 |
<FIELD name="resporganization"> |
|
312 |
<xsl:value-of select="$organizationId"/> |
|
313 |
</FIELD> |
|
314 |
<xsl:choose> |
|
315 |
<xsl:when test="./ParticipantOrder = 1"> |
|
316 |
<FIELD name="semanticclass">coordinator</FIELD> |
|
317 |
</xsl:when> |
|
318 |
<xsl:otherwise> |
|
319 |
<FIELD name="semanticclass">participant</FIELD> |
|
320 |
</xsl:otherwise> |
|
321 |
</xsl:choose> |
|
322 |
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD> |
|
323 |
</ROW> |
|
324 |
</xsl:for-each> |
|
325 |
</ROWS> |
|
326 |
</metadata> |
|
327 |
</record> |
|
328 |
</xsl:template> |
|
329 |
</xsl:stylesheet> |
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/aka2db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
3 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions" |
|
4 |
exclude-result-prefixes="xs" version="2.0"> |
|
5 |
|
|
6 |
<xsl:param name="parentDatasourceId"/> |
|
7 |
<xsl:param name="namespacePrefix"/> |
|
8 |
<xsl:param name="quote">"</xsl:param> |
|
9 |
|
|
10 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::AKA')"/> |
|
11 |
|
|
12 |
|
|
13 |
<!--<xsl:variable name="stream" select="normalize-space(.//column[@name='FUNDING STREAM(S)'])"/>--> |
|
14 |
<xsl:variable name="fundingID"> |
|
15 |
|
|
16 |
<xsl:value-of select="$funderID"/> |
|
17 |
</xsl:variable> |
|
18 |
|
|
19 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Decision No.']))"/> |
|
20 |
|
|
21 |
<xsl:variable name="fundingPeriod" select="tokenize(.//column[@name='Funding period'],'-')"/> |
|
22 |
<xsl:variable name="startDate" select="normalize-space($fundingPeriod[1])"/> |
|
23 |
<xsl:variable name="endDate" select="normalize-space($fundingPeriod[2])"/> |
|
24 |
|
|
25 |
<xsl:variable name="dateFormat" select="string('dd.MM.yyyy')"/> |
|
26 |
<xsl:variable name="projectTitle" select="normalize-space(.//column[@name='Project title'])"/> |
|
27 |
|
|
28 |
<xsl:template match="/"> |
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
<record> |
|
33 |
|
|
34 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
35 |
<metadata> |
|
36 |
<xsl:if test="string-length($projectTitle) > 0 and string-length($projectId) > 0"> |
|
37 |
<ROWS> |
|
38 |
|
|
39 |
<ROW table="projects"> |
|
40 |
<FIELD name="_dnet_resource_identifier_"> |
|
41 |
<xsl:value-of select="$projectId"/> |
|
42 |
</FIELD> |
|
43 |
<FIELD name="id"> |
|
44 |
<xsl:value-of select="$projectId"/> |
|
45 |
</FIELD> |
|
46 |
<FIELD name="code"> |
|
47 |
<xsl:value-of select="normalize-space(.//column[@name='Decision No.'])"/> |
|
48 |
</FIELD> |
|
49 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
50 |
<xsl:value-of select="$startDate"/> |
|
51 |
</FIELD> |
|
52 |
<FIELD name="enddate" type="date" format="{$dateFormat}"> |
|
53 |
<xsl:value-of select="$endDate"/> |
|
54 |
</FIELD> |
|
55 |
<FIELD name="title"> |
|
56 |
<xsl:value-of select="$projectTitle"/> |
|
57 |
</FIELD> |
|
58 |
<FIELD name="call_identifier"> |
|
59 |
<xsl:value-of select=".//column[@name='Call']"/> |
|
60 |
</FIELD> |
|
61 |
<!-- <FIELD name="contactfullname"> |
|
62 |
<xsl:value-of select=".//column[@name='Name']"/> |
|
63 |
</FIELD> --> |
|
64 |
<FIELD name="optional1"> |
|
65 |
<xsl:value-of select="concat(.//column[@name='Funding'], ' €')"/> |
|
66 |
</FIELD> |
|
67 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
68 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
69 |
<FIELD name="collectedfrom"> |
|
70 |
<xsl:value-of select="$parentDatasourceId"/> |
|
71 |
</FIELD> |
|
72 |
|
|
73 |
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD> |
|
74 |
|
|
75 |
</ROW> |
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
<ROW table="project_fundingpath"> |
|
80 |
<FIELD name="_dnet_resource_identifier_"> |
|
81 |
<xsl:value-of select="concat($fundingID,'@@', $projectId)"/> |
|
82 |
</FIELD> |
|
83 |
<FIELD name="funding"> |
|
84 |
<xsl:value-of select="$fundingID"/> |
|
85 |
</FIELD> |
|
86 |
<FIELD name="project"> |
|
87 |
<xsl:value-of select="$projectId"/> |
|
88 |
</FIELD> |
|
89 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
90 |
<xsl:value-of select="$startDate"/> |
|
91 |
</FIELD> |
|
92 |
<FIELD name="enddate" type="date" format="{$dateFormat}"> |
|
93 |
<xsl:value-of select="$endDate"/> |
|
94 |
</FIELD> |
|
95 |
</ROW> |
|
96 |
<xsl:variable name="organizationId" select="concat($namespacePrefix,'::',utils:md5(normalize-space(.//column[@name='Organisation'])))"/> |
|
97 |
<ROW table = "organizations"> |
|
98 |
<FIELD name="_dnet_resource_identifier_"> |
|
99 |
<xsl:value-of select="$organizationId"/> |
|
100 |
</FIELD> |
|
101 |
<FIELD name="id"> |
|
102 |
<xsl:value-of select="$organizationId"/> |
|
103 |
</FIELD> |
|
104 |
<FIELD name="legalname"> |
|
105 |
<xsl:value-of select="normalize-space(.//column[@name='Organisation'])"/> |
|
106 |
</FIELD> |
|
107 |
<FIELD name="collectedfrom"> |
|
108 |
<xsl:value-of select="$parentDatasourceId"/> |
|
109 |
</FIELD> |
|
110 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
111 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
112 |
</ROW> |
|
113 |
<ROW table="project_organization"> |
|
114 |
<FIELD name="_dnet_resource_identifier_"> |
|
115 |
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/> |
|
116 |
</FIELD> |
|
117 |
<FIELD name="project"> |
|
118 |
<xsl:value-of select="$projectId"/> |
|
119 |
</FIELD> |
|
120 |
<FIELD name="resporganization"> |
|
121 |
<xsl:value-of select="$organizationId"/> |
|
122 |
</FIELD> |
|
123 |
|
|
124 |
</ROW> |
|
125 |
</ROWS> |
|
126 |
</xsl:if> |
|
127 |
</metadata> |
|
128 |
</record> |
|
129 |
|
|
130 |
</xsl:template> |
|
131 |
</xsl:stylesheet> |
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/dfg2db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions" |
|
3 |
> |
|
4 |
|
|
5 |
<xsl:param name="parentDatasourceId"/> |
|
6 |
<xsl:param name="namespacePrefix"/> |
|
7 |
|
|
8 |
<xsl:variable name="dateFormat" select="string('yyyy')"/> |
|
9 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::DFG')"/> |
|
10 |
<xsl:variable name="fundingId"> |
|
11 |
<xsl:value-of select="concat($funderID,'::',utils:md5(.//column[@name='Funding Programme']))"/> |
|
12 |
</xsl:variable> |
|
13 |
|
|
14 |
|
|
15 |
<xsl:template match="/"> |
|
16 |
<record> |
|
17 |
|
|
18 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
19 |
|
|
20 |
<metadata> |
|
21 |
<ROWS> |
|
22 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Project ID']))"/> |
|
23 |
<xsl:variable name="startDate" select="replace(.//column[@name='Funding Start Year'],'/','-')"/> |
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
<ROW table="projects"> |
|
28 |
|
|
29 |
<FIELD name="_dnet_resource_identifier_"> |
|
30 |
<xsl:value-of select="$projectId"/> |
|
31 |
</FIELD> |
|
32 |
<FIELD name="id"> |
|
33 |
<xsl:value-of select="$projectId"/> |
|
34 |
</FIELD> |
|
35 |
<FIELD name="code"> |
|
36 |
<xsl:value-of select="normalize-space(.//column[@name='Project ID'])"/> |
|
37 |
</FIELD> |
|
38 |
<FIELD name="title"> |
|
39 |
<xsl:value-of select=".//column[@name='Project Title English**']"/> |
|
40 |
</FIELD> |
|
41 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
42 |
<xsl:value-of select="$startDate"/> |
|
43 |
</FIELD> |
|
44 |
|
|
45 |
|
|
46 |
<FIELD name="collectedfrom"> |
|
47 |
<xsl:value-of select="$parentDatasourceId"/> |
|
48 |
</FIELD> |
|
49 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
50 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
51 |
|
|
52 |
|
|
53 |
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD> |
|
54 |
</ROW> |
|
55 |
<ROW table="project_fundingpath"> |
|
56 |
<FIELD name="_dnet_resource_identifier_"> |
|
57 |
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/> |
|
58 |
</FIELD> |
|
59 |
<FIELD name="funding"> |
|
60 |
<xsl:value-of select="$fundingId"/> |
|
61 |
</FIELD> |
|
62 |
<FIELD name="project"> |
|
63 |
<xsl:value-of select="$projectId"/> |
|
64 |
</FIELD> |
|
65 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
66 |
<xsl:value-of select="$startDate"/> |
|
67 |
</FIELD> |
|
68 |
|
|
69 |
</ROW> |
|
70 |
</ROWS> |
|
71 |
</metadata> |
|
72 |
</record> |
|
73 |
</xsl:template> |
|
74 |
</xsl:stylesheet> |
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/corda_h2020_2_db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
3 |
> |
|
4 |
|
|
5 |
<xsl:param name="parentDatasourceId"/> |
|
6 |
|
|
7 |
<xsl:template name="dateCorda"> |
|
8 |
<xsl:param name="datename"/> |
|
9 |
<xsl:param name="datevalue"/> |
|
10 |
<FIELD name="{$datename}" type="date" format="dd-MMM-yyyy"> |
|
11 |
<xsl:value-of select="concat(substring($datevalue, 1, 2),'-',substring($datevalue,3,3),'-',substring($datevalue,6,4))"/> |
|
12 |
</FIELD> |
|
13 |
</xsl:template> |
|
14 |
|
|
15 |
<xsl:variable name="namespacePrefix" select="string('ec__________')"/> |
|
16 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')"/> |
|
17 |
|
|
18 |
<xsl:template match="/"> |
|
19 |
<record> |
|
20 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
21 |
<metadata> |
|
22 |
<ROWS> |
|
23 |
<xsl:for-each select="//Project"> |
|
24 |
<xsl:variable name="fundingId" select="concat($funderID, '::H2020')"/> |
|
25 |
<xsl:variable name="projectId" select="concat('corda__h2020::', normalize-space(./ProjectId))"/> |
|
26 |
<ROW table="projects"> |
|
27 |
<FIELD name="_dnet_resource_identifier_"> |
|
28 |
<xsl:value-of select="$projectId"/> |
|
29 |
</FIELD> |
|
30 |
<FIELD name="id"> |
|
31 |
<xsl:value-of select="$projectId"/> |
|
32 |
</FIELD> |
|
33 |
<FIELD name="code"> |
|
34 |
<xsl:value-of select="./ProjectId"/> |
|
35 |
</FIELD> |
|
36 |
<FIELD name="acronym"> |
|
37 |
<xsl:value-of select="./ProjectAcronym"/> |
|
38 |
</FIELD> |
|
39 |
<FIELD name="title"> |
|
40 |
<xsl:value-of select="./ProjectTitle"/> |
|
41 |
</FIELD> |
|
42 |
<xsl:call-template name="dateCorda"> |
|
43 |
<xsl:with-param name="datename">startdate</xsl:with-param> |
|
44 |
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param> |
|
45 |
</xsl:call-template> |
|
46 |
<xsl:call-template name="dateCorda"> |
|
47 |
<xsl:with-param name="datename">enddate</xsl:with-param> |
|
48 |
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param> |
|
49 |
</xsl:call-template> |
|
50 |
<FIELD name="call_identifier"> |
|
51 |
<xsl:value-of select="./ProjectCallIdentifier"/> |
|
52 |
</FIELD> |
|
53 |
<FIELD name="oa_mandate_for_publications" type="boolean">true</FIELD> |
|
54 |
<FIELD name="ec_article29_3" type="boolean"> |
|
55 |
<xsl:value-of select="./Article29-3"/> |
|
56 |
</FIELD> |
|
57 |
<FIELD name="collectedfrom"> |
|
58 |
<xsl:value-of select="$parentDatasourceId"/> |
|
59 |
</FIELD> |
|
60 |
<FIELD name="contracttypeclass"> |
|
61 |
<xsl:value-of select="./ProjectTOACode"/> |
|
62 |
</FIELD> |
|
63 |
<FIELD name="contracttypescheme">ec:h2020toas</FIELD> |
|
64 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
65 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
66 |
<FIELD name="websiteurl"> |
|
67 |
<xsl:value-of select="./ProjectInternetAddress"/> |
|
68 |
</FIELD> |
|
69 |
<FIELD name="optional1"> |
|
70 |
<xsl:value-of select="./ProjectTopicCode"/> |
|
71 |
</FIELD> |
|
72 |
<FIELD name="optional2"> |
|
73 |
<xsl:value-of select="./ProjectTopicDescr"/> |
|
74 |
</FIELD> |
|
75 |
<xsl:variable name="personSurname" select="normalize-space(./CoordinatorContactPerson/PersonLastName)"/> |
|
76 |
<xsl:variable name="personFirstName" select="normalize-space(./CoordinatorContactPerson/PersonFirstName)"/> |
|
77 |
<xsl:variable name="contactfullname"> |
|
78 |
<xsl:choose> |
|
79 |
<xsl:when test="string-length($personFirstName) > 0 and string-length($personSurname) > 0"> |
|
80 |
<xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/> |
|
81 |
</xsl:when> |
|
82 |
<xsl:when test="string-length($personFirstName) > 0"> |
|
83 |
<xsl:value-of select="$personFirstName"/> |
|
84 |
</xsl:when> |
|
85 |
<xsl:when test="string-length($personSurname) > 0"> |
|
86 |
<xsl:value-of select="$personSurname"/> |
|
87 |
</xsl:when> |
|
88 |
<xsl:otherwise> |
|
89 |
<xsl:value-of select="''"/> |
|
90 |
</xsl:otherwise> |
|
91 |
</xsl:choose> |
|
92 |
</xsl:variable> |
|
93 |
<xsl:if test="string-length($contactfullname) > 0"> |
|
94 |
<FIELD name="contactfullname"> |
|
95 |
<xsl:value-of select="$contactfullname"/> |
|
96 |
</FIELD> |
|
97 |
</xsl:if> |
|
98 |
<xsl:variable name="contactfax" select="normalize-space(./CoordinatorContactPerson/ContactFax)"/> |
|
99 |
<xsl:if test="string-length($contactfax) > 0"> |
|
100 |
<FIELD name="contactfax"> |
|
101 |
<xsl:value-of select="$contactfax"/> |
|
102 |
</FIELD> |
|
103 |
</xsl:if> |
|
104 |
<xsl:variable name="contactphone" select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/> |
|
105 |
<xsl:if test="string-length($contactphone) > 0"> |
|
106 |
<FIELD name="contactphone"> |
|
107 |
<xsl:value-of select="$contactphone"/> |
|
108 |
</FIELD> |
|
109 |
</xsl:if> |
|
110 |
<xsl:variable name="contactemail" select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/> |
|
111 |
<xsl:if test="string-length($contactemail) > 0"> |
|
112 |
<FIELD name="contactemail"> |
|
113 |
<xsl:value-of select="$contactemail"/> |
|
114 |
</FIELD> |
|
115 |
</xsl:if> |
|
116 |
</ROW> |
|
117 |
|
|
118 |
<xsl:for-each select="./OrganisationParticipant"> |
|
119 |
<xsl:variable name="organizationId" select="concat('corda__h2020::', ./OrganisationPIC)"/> |
|
120 |
|
|
121 |
<xsl:variable name="whitelist" select="'0123456789'"/> |
|
122 |
<ROW table="organizations"> |
|
123 |
<FIELD name="_dnet_resource_identifier_"> |
|
124 |
<xsl:value-of select="$organizationId"/> |
|
125 |
</FIELD> |
|
126 |
<FIELD name="id"> |
|
127 |
<xsl:value-of select="$organizationId"/> |
|
128 |
</FIELD> |
|
129 |
<FIELD name="legalshortname"> |
|
130 |
<xsl:value-of select="./OrganisationShortName"/> |
|
131 |
</FIELD> |
|
132 |
<FIELD name="legalname"> |
|
133 |
<xsl:value-of select="./OrganisationLegalName"/> |
|
134 |
</FIELD> |
|
135 |
<FIELD name="websiteurl"> |
|
136 |
<xsl:choose> |
|
137 |
<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')"> |
|
138 |
<xsl:value-of select="./OrganisationWebPage"/> |
|
139 |
</xsl:when> |
|
140 |
<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) > 0"> |
|
141 |
<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/> |
|
142 |
</xsl:when> |
|
143 |
</xsl:choose> |
|
144 |
</FIELD> |
|
145 |
<FIELD name="ec_legalbody" type="boolean"> |
|
146 |
<xsl:value-of select="./PublicBody"/> |
|
147 |
</FIELD> |
|
148 |
<FIELD name="ec_legalperson" type="boolean"> |
|
149 |
<xsl:value-of select="./LegalPerson"/> |
|
150 |
</FIELD> |
|
151 |
<FIELD name="ec_nonprofit" type="boolean"> |
|
152 |
<xsl:value-of select="./NonProfit"/> |
|
153 |
</FIELD> |
|
154 |
<FIELD name="ec_researchorganization" type="boolean"> |
|
155 |
<xsl:value-of select="./ResearchOrganisation"/> |
|
156 |
</FIELD> |
|
157 |
<FIELD name="ec_highereducation" type="boolean"> |
|
158 |
<xsl:value-of select="./HigherEducation"/> |
|
159 |
</FIELD> |
|
160 |
<FIELD name="ec_internationalorganizationeurinterests" type="boolean"> |
|
161 |
<xsl:value-of select="./InternationalOrgEurInterest"/> |
|
162 |
</FIELD> |
|
163 |
<FIELD name="ec_internationalorganization" type="boolean"> |
|
164 |
<xsl:value-of select="./InternationalOrgEurInterest"/> |
|
165 |
</FIELD> |
|
166 |
<FIELD name="ec_smevalidated" type="boolean"> |
|
167 |
<xsl:value-of select="./SMEValidated"/> |
|
168 |
</FIELD> |
|
169 |
<FIELD name="countryclass"> |
|
170 |
<xsl:value-of select="./OrganisationCountry"/> |
|
171 |
</FIELD> |
|
172 |
<FIELD name="countryscheme">dnet:countries</FIELD> |
|
173 |
<FIELD name="collectedfrom"> |
|
174 |
<xsl:value-of select="$parentDatasourceId"/> |
|
175 |
</FIELD> |
|
176 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
177 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
178 |
<FIELD name="trust" type="float"> |
|
179 |
<xsl:value-of select="0.92"/> |
|
180 |
</FIELD> |
|
181 |
</ROW> |
|
182 |
|
|
183 |
<ROW table="project_organization"> |
|
184 |
<FIELD name="_dnet_resource_identifier_"> |
|
185 |
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/> |
|
186 |
</FIELD> |
|
187 |
<xsl:choose> |
|
188 |
<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) > 0"> |
|
189 |
<FIELD name="participantnumber" type="int">9999</FIELD> |
|
190 |
</xsl:when> |
|
191 |
<xsl:otherwise> |
|
192 |
<FIELD name="participantnumber" type="int"> |
|
193 |
<xsl:value-of select="./ParticipantOrder"/> |
|
194 |
</FIELD> |
|
195 |
</xsl:otherwise> |
|
196 |
</xsl:choose> |
|
197 |
<FIELD name="project"> |
|
198 |
<xsl:value-of select="$projectId"/> |
|
199 |
</FIELD> |
|
200 |
<FIELD name="resporganization"> |
|
201 |
<xsl:value-of select="$organizationId"/> |
|
202 |
</FIELD> |
|
203 |
<xsl:choose> |
|
204 |
<xsl:when test="./ParticipantOrder = 1"> |
|
205 |
<FIELD name="semanticclass">coordinator</FIELD> |
|
206 |
</xsl:when> |
|
207 |
<xsl:otherwise> |
|
208 |
<FIELD name="semanticclass">participant</FIELD> |
|
209 |
</xsl:otherwise> |
|
210 |
</xsl:choose> |
|
211 |
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD> |
|
212 |
</ROW> |
|
213 |
</xsl:for-each> |
|
214 |
|
|
215 |
<ROW table="subjects"> |
|
216 |
<FIELD name="_dnet_resource_identifier_"> |
|
217 |
<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/> |
|
218 |
</FIELD> |
|
219 |
<FIELD name="id"> |
|
220 |
<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/> |
|
221 |
</FIELD> |
|
222 |
<FIELD name="name"> |
|
223 |
<xsl:value-of select="./ProjectTopicDescr"/> |
|
224 |
</FIELD> |
|
225 |
<FIELD name="semanticclass">ec:h2020topics</FIELD> |
|
226 |
<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD> |
|
227 |
</ROW> |
|
228 |
|
|
229 |
<ROW table="project_subject"> |
|
230 |
<FIELD name="_dnet_resource_identifier_"> |
|
231 |
<xsl:value-of select="concat($projectId, '@@corda__h2020::', normalize-space(./ProjectTopicCode))"/> |
|
232 |
</FIELD> |
|
233 |
<FIELD name="project"> |
|
234 |
<xsl:value-of select="$projectId"/> |
|
235 |
</FIELD> |
|
236 |
<FIELD name="subject"> |
|
237 |
<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/> |
|
238 |
</FIELD> |
|
239 |
</ROW> |
|
240 |
|
|
241 |
<ROW table="project_fundingpath"> |
|
242 |
<FIELD name="_dnet_resource_identifier_"> |
|
243 |
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/> |
|
244 |
</FIELD> |
|
245 |
<FIELD name="funding"> |
|
246 |
<xsl:value-of select="$fundingId"/> |
|
247 |
</FIELD> |
|
248 |
<FIELD name="project"> |
|
249 |
<xsl:value-of select="$projectId"/> |
|
250 |
</FIELD> |
|
251 |
<xsl:call-template name="dateCorda"> |
|
252 |
<xsl:with-param name="datename">startdate</xsl:with-param> |
|
253 |
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param> |
|
254 |
</xsl:call-template> |
|
255 |
<xsl:call-template name="dateCorda"> |
|
256 |
<xsl:with-param name="datename">enddate</xsl:with-param> |
|
257 |
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param> |
|
258 |
</xsl:call-template> |
|
259 |
<FIELD name="semanticclass"> |
|
260 |
<xsl:value-of select="./ProjectTOACode"/> |
|
261 |
</FIELD> |
|
262 |
<FIELD name="semanticscheme">ec:h2020toas</FIELD> |
|
263 |
</ROW> |
|
264 |
</xsl:for-each> |
|
265 |
|
|
266 |
</ROWS> |
|
267 |
</metadata> |
|
268 |
</record> |
|
269 |
</xsl:template> |
|
270 |
</xsl:stylesheet> |
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/nwo_2_db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
3 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
|
4 |
exclude-result-prefixes="xs" version="1.0"> |
|
5 |
|
|
6 |
<xsl:param name="parentDatasourceId"/> |
|
7 |
<xsl:param name="namespacePrefix"/> |
|
8 |
<xsl:param name="quote">"</xsl:param> |
|
9 |
|
|
10 |
<xsl:template name="getJson"> |
|
11 |
<xsl:param name="varName"/> |
|
12 |
<xsl:param name="value"/> |
|
13 |
<xsl:value-of select="concat($quote, $varName, $quote, ':', $quote, $value, $quote)"/> |
|
14 |
</xsl:template> |
|
15 |
|
|
16 |
|
|
17 |
<xsl:template match="/"> |
|
18 |
|
|
19 |
<xsl:variable name="prefix" select="string('nwo_________')"/> |
|
20 |
|
|
21 |
<record> |
|
22 |
|
|
23 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
24 |
|
|
25 |
<metadata> |
|
26 |
<ROWS> |
|
27 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='ProjectID']))"/> |
|
28 |
<xsl:variable name="startDate" select=".//column[@name='Werk startdat']"/> |
|
29 |
<xsl:variable name="endDate" select=".//column[@name='Werk einddat']"/> |
|
30 |
<xsl:variable name="dossiernr"> |
|
31 |
<xsl:call-template name="getJson"> |
|
32 |
<xsl:with-param name="varName">dossiernr</xsl:with-param> |
|
33 |
<xsl:with-param name="value"> |
|
34 |
<xsl:value-of select=".//column[@name='Dossiernr']"/> |
|
35 |
</xsl:with-param> |
|
36 |
</xsl:call-template> |
|
37 |
</xsl:variable> |
|
38 |
<xsl:variable name="NWOgebied"> |
|
39 |
<xsl:call-template name="getJson"> |
|
40 |
<xsl:with-param name="varName">NWOgebied</xsl:with-param> |
|
41 |
<xsl:with-param name="value"> |
|
42 |
<xsl:value-of select=".//column[@name='NWO gebied']"/> |
|
43 |
</xsl:with-param> |
|
44 |
</xsl:call-template> |
|
45 |
</xsl:variable> |
|
46 |
|
|
47 |
<xsl:variable name="jsonExtra"> |
|
48 |
<xsl:value-of select="concat('{', $dossiernr, ',', $NWOgebied, '}')"/> |
|
49 |
</xsl:variable> |
|
50 |
<ROW table="projects"> |
|
51 |
<FIELD name="_dnet_resource_identifier_"> |
|
52 |
<xsl:value-of select="$projectId"/> |
|
53 |
</FIELD> |
|
54 |
<FIELD name="id"> |
|
55 |
<xsl:value-of select="$projectId"/> |
|
56 |
</FIELD> |
|
57 |
<FIELD name="code"> |
|
58 |
<xsl:value-of select=".//column[@name='ProjectID']"/> |
|
59 |
</FIELD> |
|
60 |
<FIELD name="title"> |
|
61 |
<xsl:value-of select=".//column[@name='Proj titel']"/> |
|
62 |
</FIELD> |
|
63 |
<FIELD name="startdate" type="date" format="dd/MM/yyyy"> |
|
64 |
<xsl:value-of select="$startDate"/> |
|
65 |
</FIELD> |
|
66 |
<FIELD name="enddate" type="date" format="dd/MM/yyyy"> |
|
67 |
<xsl:value-of select="$endDate"/> |
|
68 |
</FIELD> |
|
69 |
<FIELD name="collectedfrom"> |
|
70 |
<xsl:value-of select="$parentDatasourceId"/> |
|
71 |
</FIELD> |
|
72 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
73 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
74 |
<FIELD name="optional1"> |
|
75 |
<xsl:value-of select=".//column[@name='Dossiernr']"/> |
|
76 |
</FIELD> |
|
77 |
<FIELD name="optional2"> |
|
78 |
<xsl:value-of select=".//column[@name='NWO gebied']"/> |
|
79 |
</FIELD> |
|
80 |
<FIELD name="jsonextrainfo"> |
|
81 |
<xsl:value-of select="$jsonExtra"/> |
|
82 |
</FIELD> |
|
83 |
</ROW> |
|
84 |
|
|
85 |
<xsl:variable name="funderId" select="concat($prefix, '::NWO')"/> |
|
86 |
<ROW table="project_fundingpath"> |
|
87 |
<FIELD name="_dnet_resource_identifier_"> |
|
88 |
<xsl:value-of select="concat($funderId, '@@', $projectId)"/> |
|
89 |
</FIELD> |
|
90 |
<FIELD name="funding"> |
|
91 |
<xsl:value-of select="$funderId"/> |
|
92 |
</FIELD> |
|
93 |
<FIELD name="project"> |
|
94 |
<xsl:value-of select="$projectId"/> |
|
95 |
</FIELD> |
|
96 |
<FIELD name="startdate" type="date" format="dd/MM/yyyy"> |
|
97 |
<xsl:value-of select="$startDate"/> |
|
98 |
</FIELD> |
|
99 |
<FIELD name="enddate" type="date" format="dd/MM/yyyy"> |
|
100 |
<xsl:value-of select="$endDate"/> |
|
101 |
</FIELD> |
|
102 |
</ROW> |
|
103 |
|
|
104 |
</ROWS> |
|
105 |
</metadata> |
|
106 |
</record> |
|
107 |
</xsl:template> |
|
108 |
|
|
109 |
</xsl:stylesheet> |
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/rcuk_2_db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
3 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
|
4 |
exclude-result-prefixes="xs" version="1.0"> |
|
5 |
|
|
6 |
<xsl:param name="parentDatasourceId"/> |
|
7 |
<xsl:param name="namespacePrefix"/> |
|
8 |
|
|
9 |
<xsl:variable name="dateFormat" select="string('yyyy-MM-dd')"/> |
|
10 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::RCUK')"/> |
|
11 |
|
|
12 |
<xsl:template match="/"> |
|
13 |
|
|
14 |
|
|
15 |
<record> |
|
16 |
|
|
17 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
18 |
|
|
19 |
<metadata> |
|
20 |
<ROWS> |
|
21 |
<xsl:variable name="projectCode" |
|
22 |
select="//*[local-name()='identifier' and ./@*[local-name()='type' and .='RCUK']]"/> |
|
23 |
<xsl:variable name="projectId" |
|
24 |
select="concat($namespacePrefix, '::', $projectCode)"/> |
|
25 |
|
|
26 |
<xsl:variable name="sDate" select=".//*[local-name()='fund']/*[local-name()='start']"/> |
|
27 |
<xsl:variable name="eDate" select=".//*[local-name()='fund']/*[local-name()='end']"/> |
|
28 |
<xsl:variable name="startDate"> |
|
29 |
<xsl:choose> |
|
30 |
<xsl:when test="contains($sDate, '+')"> |
|
31 |
<xsl:value-of select="substring-before($sDate, '+')"/> |
|
32 |
</xsl:when> |
|
33 |
<xsl:when test="contains($sDate, 'Z')"> |
|
34 |
<xsl:value-of select="substring-before($sDate, 'Z')"/> |
|
35 |
</xsl:when> |
|
36 |
<xsl:otherwise> |
|
37 |
<xsl:value-of select="$sDate"/> |
|
38 |
</xsl:otherwise> |
|
39 |
</xsl:choose> |
|
40 |
</xsl:variable> |
|
41 |
<xsl:variable name="endDate"> |
|
42 |
<xsl:choose> |
|
43 |
<xsl:when test="contains($eDate, '+')"> |
|
44 |
<xsl:value-of select="substring-before($eDate, '+')"/> |
|
45 |
</xsl:when> |
|
46 |
<xsl:when test="contains($eDate, 'Z')"> |
|
47 |
<xsl:value-of select="substring-before($eDate, 'Z')"/> |
|
48 |
</xsl:when> |
|
49 |
<xsl:otherwise> |
|
50 |
<xsl:value-of select="$eDate"/> |
|
51 |
</xsl:otherwise> |
|
52 |
</xsl:choose> |
|
53 |
</xsl:variable> |
|
54 |
|
|
55 |
<xsl:variable name="personCode" |
|
56 |
select=".//*[local-name()='person']/@*[local-name()='id']"/> |
|
57 |
<xsl:variable name="personId" |
|
58 |
select="concat($namespacePrefix,'::',$personCode)"/> |
|
59 |
<xsl:variable name="funding" select=".//*[local-name()='funder']/name"/> |
|
60 |
<xsl:variable name="fundingId"> |
|
61 |
<xsl:if test="string-length($funding) > 0"> |
|
62 |
<xsl:value-of select="concat($funderID ,'::' , .//*[local-name()='funder']/name)"/> |
|
63 |
</xsl:if> |
|
64 |
<xsl:otherwise><xsl:value-of select="$funderID"/></xsl:otherwise> |
|
65 |
</xsl:variable> |
|
66 |
|
|
67 |
<ROW table="projects"> |
|
68 |
<FIELD name="_dnet_resource_identifier_"> |
|
69 |
<xsl:value-of select="$projectId"/> |
|
70 |
</FIELD> |
|
71 |
<FIELD name="id"> |
|
72 |
<xsl:value-of select="$projectId"/> |
|
73 |
</FIELD> |
|
74 |
<FIELD name="code"> |
|
75 |
<xsl:value-of select="$projectCode"/> |
|
76 |
</FIELD> |
|
77 |
<FIELD name="title"> |
|
78 |
<xsl:value-of select=".//*[local-name()='title']"/> |
|
79 |
</FIELD> |
|
80 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
81 |
<xsl:value-of select="$startDate"/> |
|
82 |
</FIELD> |
|
83 |
<FIELD name="enddate" type="date" format="{$dateFormat}"> |
|
84 |
<xsl:value-of select="$endDate"/> |
|
85 |
</FIELD> |
|
86 |
<FIELD name="collectedfrom"> |
|
87 |
<xsl:value-of select="$parentDatasourceId"/> |
|
88 |
</FIELD> |
|
89 |
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD> |
|
90 |
<FIELD name="optional1"> |
|
91 |
<xsl:value-of |
|
92 |
select="concat(.//*[local-name()='valuePounds']/@*[local-name()='amount'], ' ', .//*[local-name()='valuePounds']/@*[local-name()='currencyCode'])"/> |
|
93 |
</FIELD> |
|
94 |
|
|
95 |
<xsl:variable name="personSurname" select="normalize-space(.//*[local-name()='surname'])"/> |
|
96 |
<xsl:variable name="personFirstName" select="normalize-space(.//*[local-name()='firstName'])"/> |
|
97 |
<xsl:variable name="contactfullname"> |
|
98 |
<xsl:choose> |
|
99 |
<xsl:when test="string-length($personFirstName) > 0 and string-length($personSurname) > 0"> |
|
100 |
<xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/> |
|
101 |
</xsl:when> |
|
102 |
<xsl:when test="string-length($personFirstName) > 0"> |
|
103 |
<xsl:value-of select="$personFirstName"/> |
|
104 |
</xsl:when> |
|
105 |
<xsl:when test="string-length($personSurname) > 0"> |
|
106 |
<xsl:value-of select="$personSurname"/> |
|
107 |
</xsl:when> |
|
108 |
<xsl:otherwise> |
|
109 |
<xsl:value-of select="''"/> |
|
110 |
</xsl:otherwise> |
|
111 |
</xsl:choose> |
|
112 |
</xsl:variable> |
|
113 |
<xsl:if test="string-length($contactfullname) > 0"> |
|
114 |
<FIELD name="contactfullname"> |
|
115 |
<xsl:value-of select="$contactfullname"/> |
|
116 |
</FIELD> |
|
117 |
</xsl:if> |
|
118 |
</ROW> |
|
119 |
|
|
120 |
<ROW table="project_fundingpath"> |
|
121 |
<FIELD name="_dnet_resource_identifier_"> |
|
122 |
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/> |
|
123 |
</FIELD> |
|
124 |
<FIELD name="funding"> |
|
125 |
<xsl:value-of select="$fundingId"/> |
|
126 |
</FIELD> |
|
127 |
<FIELD name="project"> |
|
128 |
<xsl:value-of select="$projectId"/> |
|
129 |
</FIELD> |
|
130 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
131 |
<xsl:value-of select="$startDate"/> |
|
132 |
</FIELD> |
|
133 |
<FIELD name="enddate" type="date" format="{$dateFormat}"> |
|
134 |
<xsl:value-of select="$endDate"/> |
|
135 |
</FIELD> |
|
136 |
</ROW> |
|
137 |
|
|
138 |
<xsl:for-each select=".//pp-org"> |
|
139 |
<xsl:variable name="organizationId" select="concat($namespacePrefix, '::', normalize-space(./id))"/> |
|
140 |
<xsl:variable name="country" select="./country"/> |
|
141 |
<ROW table="organizations"> |
|
142 |
<FIELD name="_dnet_resource_identifier_"> |
|
143 |
<xsl:value-of select="$organizationId"/> |
|
144 |
</FIELD> |
|
145 |
<FIELD name="id"> |
|
146 |
<xsl:value-of select="$organizationId"/> |
|
147 |
</FIELD> |
|
148 |
<FIELD name="legalname"> |
|
149 |
<xsl:value-of select="./name"/> |
|
150 |
</FIELD> |
|
151 |
|
|
152 |
<xsl:if test="string-length($country) > 0"> |
|
153 |
<FIELD name="countryclass"> |
|
154 |
<xsl:value-of select="$country"/> |
|
155 |
</FIELD> |
|
156 |
<FIELD name="countryscheme">dnet:countries</FIELD> |
|
157 |
</xsl:if> |
|
158 |
|
|
159 |
<FIELD name="collectedfrom"> |
|
160 |
<xsl:value-of select="$parentDatasourceId"/> |
|
161 |
</FIELD> |
|
162 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
163 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
164 |
</ROW> |
|
165 |
<ROW table="project_organization"> |
|
166 |
<FIELD name="_dnet_resource_identifier_"> |
|
167 |
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/> |
|
168 |
</FIELD> |
|
169 |
<FIELD name="project"> |
|
170 |
<xsl:value-of select="$projectId"/> |
|
171 |
</FIELD> |
|
172 |
<FIELD name="resporganization"> |
|
173 |
<xsl:value-of select="$organizationId"/> |
|
174 |
</FIELD> |
|
175 |
|
|
176 |
<FIELD name="semanticclass">participant</FIELD> |
|
177 |
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD> |
|
178 |
</ROW> |
|
179 |
|
|
180 |
</xsl:for-each> |
|
181 |
|
|
182 |
<xsl:variable name="leadOrgId" |
|
183 |
select="concat($namespacePrefix, '::', normalize-space(.//ld-org/id))"/> |
|
184 |
<ROW table="organizations"> |
|
185 |
<FIELD name="_dnet_resource_identifier_"> |
|
186 |
<xsl:value-of select="$leadOrgId"/> |
|
187 |
</FIELD> |
|
188 |
<FIELD name="id"> |
|
189 |
<xsl:value-of select="$leadOrgId"/> |
|
190 |
</FIELD> |
|
191 |
<FIELD name="legalname"> |
|
192 |
<xsl:value-of select=".//ld-org/name"/> |
|
193 |
</FIELD> |
|
194 |
<xsl:variable name="country" select=".//ld-org/country"/> |
|
195 |
<xsl:if test="string-length($country) > 0"> |
|
196 |
<FIELD name="countryclass"> |
|
197 |
<xsl:value-of select="$country"/> |
|
198 |
</FIELD> |
|
199 |
<FIELD name="countryscheme">dnet:countries</FIELD> |
|
200 |
</xsl:if> |
|
201 |
|
|
202 |
<FIELD name="collectedfrom"> |
|
203 |
<xsl:value-of select="$parentDatasourceId"/> |
|
204 |
</FIELD> |
|
205 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
206 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
207 |
</ROW> |
|
208 |
|
|
209 |
<ROW table="project_organization"> |
|
210 |
<FIELD name="_dnet_resource_identifier_"> |
|
211 |
<xsl:value-of select='concat($projectId, "@@", $leadOrgId)'/> |
|
212 |
</FIELD> |
|
213 |
<FIELD name="project"> |
Also available in: Unified diff
Deleted old xslt: now that we have incremental transformation we have to use TDS rules