Revision 48139
Added by Alessia Bardi over 6 years ago
corda_h2020_2_db.xsl | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<xsl:stylesheet version="1.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"
|
|
3 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oaa="http://namespace.openaire.eu/oaa" xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:fn="http://www.w3.org/2005/xpath-functions">
|
|
4 |
|
|
5 |
<xsl:param name="parentDatasourceId" />
|
|
6 |
|
|
2 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
3 |
> |
|
4 |
|
|
5 |
<xsl:param name="parentDatasourceId"/> |
|
6 |
|
|
7 | 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"><xsl:value-of select="concat(substring($datevalue, 1, 2),'-',substring($datevalue,3,3),'-',substring($datevalue,6,4))" /></FIELD> |
|
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> |
|
11 | 13 |
</xsl:template> |
12 |
|
|
13 |
<xsl:variable name="namespacePrefix" select="string('ec__________')" />
|
|
14 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')" />
|
|
15 |
|
|
14 |
|
|
15 |
<xsl:variable name="namespacePrefix" select="string('ec__________')"/> |
|
16 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')"/> |
|
17 |
|
|
16 | 18 |
<xsl:template match="/"> |
17 |
<record xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
18 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" |
|
19 |
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
20 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"> |
|
21 |
|
|
19 |
<record |
|
20 |
> |
|
21 |
|
|
22 | 22 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
23 |
|
|
23 |
|
|
24 | 24 |
<metadata> |
25 | 25 |
<ROWS> |
26 | 26 |
<xsl:for-each select="//Project"> |
27 |
|
|
27 |
|
|
28 | 28 |
<xsl:variable name="fundingId" select="concat($funderID, '::H2020')"/> |
29 | 29 |
<xsl:variable name="projectId" select="concat('corda__h2020::', normalize-space(./ProjectId))"/> |
30 |
|
|
30 |
|
|
31 | 31 |
<ROW table="projects"> |
32 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectId" /></FIELD> |
|
33 |
<FIELD name="id"><xsl:value-of select="$projectId" /></FIELD> |
|
34 |
<FIELD name="code"><xsl:value-of select="./ProjectId" /></FIELD> |
|
35 |
<FIELD name="acronym"><xsl:value-of select="./ProjectAcronym" /></FIELD> |
|
36 |
<FIELD name="title"><xsl:value-of select="./ProjectTitle" /></FIELD> |
|
32 |
<FIELD name="_dnet_resource_identifier_"> |
|
33 |
<xsl:value-of select="$projectId"/> |
|
34 |
</FIELD> |
|
35 |
<FIELD name="id"> |
|
36 |
<xsl:value-of select="$projectId"/> |
|
37 |
</FIELD> |
|
38 |
<FIELD name="code"> |
|
39 |
<xsl:value-of select="./ProjectId"/> |
|
40 |
</FIELD> |
|
41 |
<FIELD name="acronym"> |
|
42 |
<xsl:value-of select="./ProjectAcronym"/> |
|
43 |
</FIELD> |
|
44 |
<FIELD name="title"> |
|
45 |
<xsl:value-of select="./ProjectTitle"/> |
|
46 |
</FIELD> |
|
37 | 47 |
<xsl:call-template name="dateCorda"> |
38 | 48 |
<xsl:with-param name="datename">startdate</xsl:with-param> |
39 | 49 |
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param> |
... | ... | |
41 | 51 |
<xsl:call-template name="dateCorda"> |
42 | 52 |
<xsl:with-param name="datename">enddate</xsl:with-param> |
43 | 53 |
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param> |
44 |
</xsl:call-template> |
|
45 |
<FIELD name="call_identifier"><xsl:value-of select="./ProjectCallIdentifier" /></FIELD> |
|
54 |
</xsl:call-template> |
|
55 |
<FIELD name="call_identifier"> |
|
56 |
<xsl:value-of select="./ProjectCallIdentifier"/> |
|
57 |
</FIELD> |
|
46 | 58 |
<FIELD name="oa_mandate_for_publications" type="boolean">true</FIELD> |
47 |
<FIELD name="ec_article29_3" type="boolean"><xsl:value-of select="./Article29-3" /></FIELD> |
|
48 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD> |
|
49 |
<FIELD name="contracttypeclass"><xsl:value-of select="./ProjectTOACode" /></FIELD> |
|
59 |
<FIELD name="ec_article29_3" type="boolean"> |
|
60 |
<xsl:value-of select="./Article29-3"/> |
|
61 |
</FIELD> |
|
62 |
<FIELD name="collectedfrom"> |
|
63 |
<xsl:value-of select="$parentDatasourceId"/> |
|
64 |
</FIELD> |
|
65 |
<FIELD name="contracttypeclass"> |
|
66 |
<xsl:value-of select="./ProjectTOACode"/> |
|
67 |
</FIELD> |
|
50 | 68 |
<FIELD name="contracttypescheme">ec:h2020toas</FIELD> |
51 | 69 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
52 | 70 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
53 |
<FIELD name="websiteurl"><xsl:value-of select="./ProjectInternetAddress" /></FIELD> |
|
54 |
<FIELD name="optional1"><xsl:value-of select="./ProjectTopicCode" /></FIELD> |
|
55 |
<FIELD name="optional2"><xsl:value-of select="./ProjectTopicDescr" /></FIELD> |
|
71 |
<FIELD name="websiteurl"> |
|
72 |
<xsl:value-of select="./ProjectInternetAddress"/> |
|
73 |
</FIELD> |
|
74 |
<FIELD name="optional1"> |
|
75 |
<xsl:value-of select="./ProjectTopicCode"/> |
|
76 |
</FIELD> |
|
77 |
<FIELD name="optional2"> |
|
78 |
<xsl:value-of select="./ProjectTopicDescr"/> |
|
79 |
</FIELD> |
|
56 | 80 |
</ROW> |
57 |
|
|
81 |
|
|
58 | 82 |
<xsl:for-each select="./CoordinatorContactPerson"> |
59 | 83 |
<xsl:if test="string-length(./PersonFirstName) > 0 and string-length(./PersonLastName) > 0"> |
60 | 84 |
<xsl:variable name="personId" select="concat('corda__h2020::', ../ProjectId, '::', ./PersonFirstName, '_', ./PersonLastName)"></xsl:variable> |
61 | 85 |
<ROW table="persons"> |
62 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$personId" /></FIELD> |
|
63 |
<FIELD name="id"><xsl:value-of select="$personId" /></FIELD> |
|
64 |
<FIELD name="firstname"><xsl:value-of select="./PersonFirstName" /></FIELD> |
|
65 |
<FIELD name="secondnames"><xsl:value-of select="./PersonLastName" /></FIELD> |
|
66 |
<FIELD name="email"><xsl:value-of select="./ContactEmail" /></FIELD> |
|
67 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD> |
|
86 |
<FIELD name="_dnet_resource_identifier_"> |
|
87 |
<xsl:value-of select="$personId"/> |
|
88 |
</FIELD> |
|
89 |
<FIELD name="id"> |
|
90 |
<xsl:value-of select="$personId"/> |
|
91 |
</FIELD> |
|
92 |
<FIELD name="firstname"> |
|
93 |
<xsl:value-of select="./PersonFirstName"/> |
|
94 |
</FIELD> |
|
95 |
<FIELD name="secondnames"> |
|
96 |
<xsl:value-of select="./PersonLastName"/> |
|
97 |
</FIELD> |
|
98 |
<FIELD name="email"> |
|
99 |
<xsl:value-of select="./ContactEmail"/> |
|
100 |
</FIELD> |
|
101 |
<FIELD name="collectedfrom"> |
|
102 |
<xsl:value-of select="$parentDatasourceId"/> |
|
103 |
</FIELD> |
|
68 | 104 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
69 | 105 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
70 | 106 |
</ROW> |
71 | 107 |
</xsl:if> |
72 | 108 |
</xsl:for-each> |
73 |
|
|
109 |
|
|
74 | 110 |
<xsl:for-each select="./OrganisationParticipant"> |
75 |
<xsl:variable name="organizationId" select="concat('corda__h2020::', ./OrganisationPIC)" />
|
|
76 |
|
|
111 |
<xsl:variable name="organizationId" select="concat('corda__h2020::', ./OrganisationPIC)"/> |
|
112 |
|
|
77 | 113 |
<xsl:variable name="whitelist" select="'0123456789'"/> |
78 | 114 |
<ROW table="organizations"> |
79 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$organizationId" /></FIELD> |
|
80 |
<FIELD name="id"><xsl:value-of select="$organizationId" /></FIELD> |
|
81 |
<FIELD name="legalshortname"><xsl:value-of select="./OrganisationShortName" /></FIELD> |
|
82 |
<FIELD name="legalname"><xsl:value-of select="./OrganisationLegalName" /></FIELD> |
|
115 |
<FIELD name="_dnet_resource_identifier_"> |
|
116 |
<xsl:value-of select="$organizationId"/> |
|
117 |
</FIELD> |
|
118 |
<FIELD name="id"> |
|
119 |
<xsl:value-of select="$organizationId"/> |
|
120 |
</FIELD> |
|
121 |
<FIELD name="legalshortname"> |
|
122 |
<xsl:value-of select="./OrganisationShortName"/> |
|
123 |
</FIELD> |
|
124 |
<FIELD name="legalname"> |
|
125 |
<xsl:value-of select="./OrganisationLegalName"/> |
|
126 |
</FIELD> |
|
83 | 127 |
<FIELD name="websiteurl"> |
84 | 128 |
<xsl:choose> |
85 | 129 |
<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')"> |
86 |
<xsl:value-of select="./OrganisationWebPage" />
|
|
130 |
<xsl:value-of select="./OrganisationWebPage"/> |
|
87 | 131 |
</xsl:when> |
88 | 132 |
<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) > 0"> |
89 |
<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))" />
|
|
133 |
<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/> |
|
90 | 134 |
</xsl:when> |
91 | 135 |
</xsl:choose> |
92 | 136 |
</FIELD> |
93 |
<FIELD name="ec_legalbody" type="boolean"><xsl:value-of select="./PublicBody" /></FIELD> |
|
94 |
<FIELD name="ec_legalperson" type="boolean"><xsl:value-of select="./LegalPerson" /></FIELD> |
|
95 |
<FIELD name="ec_nonprofit" type="boolean"><xsl:value-of select="./NonProfit" /></FIELD> |
|
96 |
<FIELD name="ec_researchorganization" type="boolean"><xsl:value-of select="./ResearchOrganisation" /></FIELD> |
|
97 |
<FIELD name="ec_highereducation" type="boolean"><xsl:value-of select="./HigherEducation" /></FIELD> |
|
98 |
<FIELD name="ec_internationalorganizationeurinterests" type="boolean"><xsl:value-of select="./InternationalOrgEurInterest" /></FIELD> |
|
99 |
<FIELD name="ec_internationalorganization" type="boolean"><xsl:value-of select="./InternationalOrgEurInterest" /></FIELD> |
|
100 |
<FIELD name="ec_smevalidated" type="boolean"><xsl:value-of select="./SMEValidated" /></FIELD> |
|
101 |
<FIELD name="countryclass"><xsl:value-of select="./OrganisationCountry" /></FIELD> |
|
137 |
<FIELD name="ec_legalbody" type="boolean"> |
|
138 |
<xsl:value-of select="./PublicBody"/> |
|
139 |
</FIELD> |
|
140 |
<FIELD name="ec_legalperson" type="boolean"> |
|
141 |
<xsl:value-of select="./LegalPerson"/> |
|
142 |
</FIELD> |
|
143 |
<FIELD name="ec_nonprofit" type="boolean"> |
|
144 |
<xsl:value-of select="./NonProfit"/> |
|
145 |
</FIELD> |
|
146 |
<FIELD name="ec_researchorganization" type="boolean"> |
|
147 |
<xsl:value-of select="./ResearchOrganisation"/> |
|
148 |
</FIELD> |
|
149 |
<FIELD name="ec_highereducation" type="boolean"> |
|
150 |
<xsl:value-of select="./HigherEducation"/> |
|
151 |
</FIELD> |
|
152 |
<FIELD name="ec_internationalorganizationeurinterests" type="boolean"> |
|
153 |
<xsl:value-of select="./InternationalOrgEurInterest"/> |
|
154 |
</FIELD> |
|
155 |
<FIELD name="ec_internationalorganization" type="boolean"> |
|
156 |
<xsl:value-of select="./InternationalOrgEurInterest"/> |
|
157 |
</FIELD> |
|
158 |
<FIELD name="ec_smevalidated" type="boolean"> |
|
159 |
<xsl:value-of select="./SMEValidated"/> |
|
160 |
</FIELD> |
|
161 |
<FIELD name="countryclass"> |
|
162 |
<xsl:value-of select="./OrganisationCountry"/> |
|
163 |
</FIELD> |
|
102 | 164 |
<FIELD name="countryscheme">dnet:countries</FIELD> |
103 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD> |
|
165 |
<FIELD name="collectedfrom"> |
|
166 |
<xsl:value-of select="$parentDatasourceId"/> |
|
167 |
</FIELD> |
|
104 | 168 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
105 | 169 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
106 |
<FIELD name="trust" type="float"><xsl:value-of select="0.92" /></FIELD> |
|
170 |
<FIELD name="trust" type="float"> |
|
171 |
<xsl:value-of select="0.92"/> |
|
172 |
</FIELD> |
|
107 | 173 |
</ROW> |
108 |
|
|
174 |
|
|
109 | 175 |
<ROW table="project_organization"> |
110 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select='concat($projectId, "@@", $organizationId)' /></FIELD> |
|
176 |
<FIELD name="_dnet_resource_identifier_"> |
|
177 |
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/> |
|
178 |
</FIELD> |
|
111 | 179 |
<xsl:choose> |
112 |
<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) > 0" >
|
|
180 |
<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) > 0">
|
|
113 | 181 |
<FIELD name="participantnumber" type="int">9999</FIELD> |
114 | 182 |
</xsl:when> |
115 | 183 |
<xsl:otherwise> |
116 |
<FIELD name="participantnumber" type="int"><xsl:value-of select="./ParticipantOrder" /></FIELD> |
|
184 |
<FIELD name="participantnumber" type="int"> |
|
185 |
<xsl:value-of select="./ParticipantOrder"/> |
|
186 |
</FIELD> |
|
117 | 187 |
</xsl:otherwise> |
118 | 188 |
</xsl:choose> |
119 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD> |
|
120 |
<FIELD name="resporganization"><xsl:value-of select="$organizationId" /></FIELD> |
|
189 |
<FIELD name="project"> |
|
190 |
<xsl:value-of select="$projectId"/> |
|
191 |
</FIELD> |
|
192 |
<FIELD name="resporganization"> |
|
193 |
<xsl:value-of select="$organizationId"/> |
|
194 |
</FIELD> |
|
121 | 195 |
<xsl:choose> |
122 | 196 |
<xsl:when test="./ParticipantOrder = 1"> |
123 |
<FIELD name="contactperson"><xsl:value-of select="concat($projectId, '::', ..//CoordinatorContactPerson/PersonFirstName, '_', ../CoordinatorContactPerson/PersonLastName)"></xsl:value-of></FIELD> |
|
197 |
<FIELD name="contactperson"> |
|
198 |
<xsl:value-of select="concat($projectId, '::', ..//CoordinatorContactPerson/PersonFirstName, '_', ../CoordinatorContactPerson/PersonLastName)"></xsl:value-of> |
|
199 |
</FIELD> |
|
124 | 200 |
<FIELD name="semanticclass">coordinator</FIELD> |
125 | 201 |
</xsl:when> |
126 | 202 |
<xsl:otherwise> |
... | ... | |
131 | 207 |
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD> |
132 | 208 |
</ROW> |
133 | 209 |
</xsl:for-each> |
134 |
|
|
210 |
|
|
135 | 211 |
<ROW table="subjects"> |
136 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))" /></FIELD> |
|
137 |
<FIELD name="id"><xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))" /></FIELD> |
|
138 |
<FIELD name="name"><xsl:value-of select="./ProjectTopicDescr" /></FIELD> |
|
212 |
<FIELD name="_dnet_resource_identifier_"> |
|
213 |
<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/> |
|
214 |
</FIELD> |
|
215 |
<FIELD name="id"> |
|
216 |
<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/> |
|
217 |
</FIELD> |
|
218 |
<FIELD name="name"> |
|
219 |
<xsl:value-of select="./ProjectTopicDescr"/> |
|
220 |
</FIELD> |
|
139 | 221 |
<FIELD name="semanticclass">ec:h2020topics</FIELD> |
140 | 222 |
<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD> |
141 | 223 |
</ROW> |
142 | 224 |
|
143 | 225 |
<ROW table="project_subject"> |
144 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectId, '@@corda__h2020::', normalize-space(./ProjectTopicCode))" /></FIELD> |
|
145 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD> |
|
146 |
<FIELD name="subject"><xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))" /></FIELD> |
|
226 |
<FIELD name="_dnet_resource_identifier_"> |
|
227 |
<xsl:value-of select="concat($projectId, '@@corda__h2020::', normalize-space(./ProjectTopicCode))"/> |
|
228 |
</FIELD> |
|
229 |
<FIELD name="project"> |
|
230 |
<xsl:value-of select="$projectId"/> |
|
231 |
</FIELD> |
|
232 |
<FIELD name="subject"> |
|
233 |
<xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))"/> |
|
234 |
</FIELD> |
|
147 | 235 |
</ROW> |
148 |
|
|
236 |
|
|
149 | 237 |
<ROW table="project_fundingpath"> |
150 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($fundingId, '@@', $projectId)" /></FIELD> |
|
151 |
<FIELD name="funding"><xsl:value-of select="$fundingId" /></FIELD> |
|
152 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD> |
|
238 |
<FIELD name="_dnet_resource_identifier_"> |
|
239 |
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/> |
|
240 |
</FIELD> |
|
241 |
<FIELD name="funding"> |
|
242 |
<xsl:value-of select="$fundingId"/> |
|
243 |
</FIELD> |
|
244 |
<FIELD name="project"> |
|
245 |
<xsl:value-of select="$projectId"/> |
|
246 |
</FIELD> |
|
153 | 247 |
<xsl:call-template name="dateCorda"> |
154 | 248 |
<xsl:with-param name="datename">startdate</xsl:with-param> |
155 | 249 |
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param> |
... | ... | |
157 | 251 |
<xsl:call-template name="dateCorda"> |
158 | 252 |
<xsl:with-param name="datename">enddate</xsl:with-param> |
159 | 253 |
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param> |
160 |
</xsl:call-template> |
|
161 |
<FIELD name="semanticclass"><xsl:value-of select="./ProjectTOACode" /></FIELD> |
|
254 |
</xsl:call-template> |
|
255 |
<FIELD name="semanticclass"> |
|
256 |
<xsl:value-of select="./ProjectTOACode"/> |
|
257 |
</FIELD> |
|
162 | 258 |
<FIELD name="semanticscheme">ec:h2020toas</FIELD> |
163 | 259 |
</ROW> |
164 | 260 |
</xsl:for-each> |
165 |
|
|
261 |
|
|
166 | 262 |
</ROWS> |
167 | 263 |
</metadata> |
168 | 264 |
</record> |
Also available in: Unified diff
integrated (hopefully) all required changes from dnet40