Revision 48139
Added by Alessia Bardi almost 7 years ago
fct_2_db.xsl | ||
---|---|---|
3 | 3 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
4 | 4 |
exclude-result-prefixes="xs" version="2.0"> |
5 | 5 |
|
6 |
<xsl:param name="parentDatasourceId"/>
|
|
7 |
<xsl:param name="namespacePrefix"/>
|
|
6 |
<xsl:param name="parentDatasourceId"/>
|
|
7 |
<xsl:param name="namespacePrefix"/>
|
|
8 | 8 |
|
9 |
<xsl:variable name="invalid" select="' ,-'"/>
|
|
10 |
<xsl:variable name="valid" select="'___'"/>
|
|
9 |
<xsl:variable name="invalid" select="' ,-'"/>
|
|
10 |
<xsl:variable name="valid" select="'___'"/>
|
|
11 | 11 |
|
12 |
<xsl:variable name="prefix" select="string('fct_________')"/>
|
|
13 |
<xsl:variable name="funderID" select="concat($prefix, '::FCT')"/>
|
|
12 |
<xsl:variable name="prefix" select="string('fct_________')"/>
|
|
13 |
<xsl:variable name="funderID" select="concat($prefix, '::FCT')"/>
|
|
14 | 14 |
|
15 |
<xsl:template match="/">
|
|
16 |
<record>
|
|
17 |
<xsl:copy-of select=".//*[local-name()='header']"/>
|
|
18 |
<metadata>
|
|
19 |
<ROWS>
|
|
20 |
<xsl:for-each select="//project">
|
|
21 |
<xsl:call-template name="projectTemplate"/>
|
|
22 |
</xsl:for-each>
|
|
23 |
</ROWS>
|
|
24 |
</metadata>
|
|
15 |
<xsl:template match="/">
|
|
16 |
<record>
|
|
17 |
<xsl:copy-of select=".//*[local-name()='header']"/>
|
|
18 |
<metadata>
|
|
19 |
<ROWS>
|
|
20 |
<xsl:for-each select="//project">
|
|
21 |
<xsl:call-template name="projectTemplate"/>
|
|
22 |
</xsl:for-each>
|
|
23 |
</ROWS>
|
|
24 |
</metadata>
|
|
25 | 25 |
|
26 |
</record>
|
|
27 |
</xsl:template>
|
|
26 |
</record>
|
|
27 |
</xsl:template>
|
|
28 | 28 |
|
29 |
<xsl:template name="projectTemplate">
|
|
29 |
<xsl:template name="projectTemplate">
|
|
30 | 30 |
|
31 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', ./id)"/>
|
|
32 |
<xsl:variable name="projectAcronym" select="./reference"/>
|
|
33 |
<xsl:variable name="tokens" select="tokenize(./reference,'/')"/>
|
|
34 |
<xsl:variable name="callID" select="concat($tokens[1], '/', $tokens[last()])"/>
|
|
31 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', ./id)"/>
|
|
32 |
<xsl:variable name="projectAcronym" select="./reference"/>
|
|
33 |
<xsl:variable name="tokens" select="tokenize(./reference,'/')"/>
|
|
34 |
<xsl:variable name="callID" select="concat($tokens[1], '/', $tokens[last()])"/>
|
|
35 | 35 |
|
36 |
<ROW table="projects">
|
|
37 |
<FIELD name="_dnet_resource_identifier_">
|
|
38 |
<xsl:value-of select="$projectId"/>
|
|
39 |
</FIELD>
|
|
40 |
<FIELD name="id">
|
|
41 |
<xsl:value-of select="$projectId"/>
|
|
42 |
</FIELD>
|
|
43 |
<FIELD name="code">
|
|
44 |
<xsl:value-of select="./id"/>
|
|
45 |
</FIELD>
|
|
46 |
<FIELD name="call_identifier">
|
|
47 |
<xsl:value-of select="$callID"/>
|
|
48 |
</FIELD>
|
|
49 |
<FIELD name="websiteurl">
|
|
50 |
<xsl:value-of select="./refUri"/>
|
|
51 |
</FIELD>
|
|
52 |
<FIELD name="acronym">
|
|
53 |
<xsl:value-of select="./reference"/>
|
|
54 |
</FIELD>
|
|
55 |
<FIELD name="title">
|
|
56 |
<xsl:value-of select="./name"/>
|
|
57 |
</FIELD>
|
|
58 |
<FIELD name="startdate" type="date" format="dd/MM/yyyy">
|
|
59 |
<xsl:value-of select="./startDate"/>
|
|
60 |
</FIELD>
|
|
61 |
<FIELD name="enddate" type="date" format="dd/MM/yyyy">
|
|
62 |
<xsl:value-of select="./endDate"/>
|
|
63 |
</FIELD>
|
|
64 |
<FIELD name="keywords">
|
|
65 |
<xsl:for-each select="./classification/elem">
|
|
66 |
<xsl:if test="position() > 1">,</xsl:if>
|
|
67 |
<xsl:value-of select="."/>
|
|
68 |
</xsl:for-each>
|
|
69 |
</FIELD>
|
|
70 |
<FIELD name="collectedfrom">
|
|
71 |
<xsl:value-of select="$parentDatasourceId"/>
|
|
72 |
</FIELD>
|
|
73 |
<FIELD name="contracttypeclass">UNKNOWN</FIELD>
|
|
74 |
<FIELD name="contracttypescheme">fct:contractTypes</FIELD>
|
|
75 |
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD>
|
|
76 |
<xsl:if test="string-length(normalize-space(./oaMandate)) > 0">
|
|
77 |
<FIELD name="oa_mandate_for_publications" type="boolean">
|
|
78 |
<xsl:value-of select="./oaMandate"/>
|
|
79 |
</FIELD>
|
|
80 |
</xsl:if>
|
|
81 |
</ROW>
|
|
36 |
<ROW table="projects">
|
|
37 |
<FIELD name="_dnet_resource_identifier_">
|
|
38 |
<xsl:value-of select="$projectId"/>
|
|
39 |
</FIELD>
|
|
40 |
<FIELD name="id">
|
|
41 |
<xsl:value-of select="$projectId"/>
|
|
42 |
</FIELD>
|
|
43 |
<FIELD name="code">
|
|
44 |
<xsl:value-of select="./id"/>
|
|
45 |
</FIELD>
|
|
46 |
<FIELD name="call_identifier">
|
|
47 |
<xsl:value-of select="$callID"/>
|
|
48 |
</FIELD>
|
|
49 |
<FIELD name="websiteurl">
|
|
50 |
<xsl:value-of select="./refUri"/>
|
|
51 |
</FIELD>
|
|
52 |
<FIELD name="acronym">
|
|
53 |
<xsl:value-of select="./reference"/>
|
|
54 |
</FIELD>
|
|
55 |
<FIELD name="title">
|
|
56 |
<xsl:value-of select="./name"/>
|
|
57 |
</FIELD>
|
|
58 |
<FIELD name="startdate" type="date" format="dd/MM/yyyy">
|
|
59 |
<xsl:value-of select="./startDate"/>
|
|
60 |
</FIELD>
|
|
61 |
<FIELD name="enddate" type="date" format="dd/MM/yyyy">
|
|
62 |
<xsl:value-of select="./endDate"/>
|
|
63 |
</FIELD>
|
|
64 |
<FIELD name="keywords">
|
|
65 |
<xsl:for-each select="./classification/elem">
|
|
66 |
<xsl:if test="position() > 1">,</xsl:if>
|
|
67 |
<xsl:value-of select="."/>
|
|
68 |
</xsl:for-each>
|
|
69 |
</FIELD>
|
|
70 |
<FIELD name="collectedfrom">
|
|
71 |
<xsl:value-of select="$parentDatasourceId"/>
|
|
72 |
</FIELD>
|
|
73 |
<FIELD name="contracttypeclass">UNKNOWN</FIELD>
|
|
74 |
<FIELD name="contracttypescheme">fct:contractTypes</FIELD>
|
|
75 |
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD>
|
|
76 |
<xsl:if test="string-length(normalize-space(./oaMandate)) > 0">
|
|
77 |
<FIELD name="oa_mandate_for_publications" type="boolean">
|
|
78 |
<xsl:value-of select="./oaMandate"/>
|
|
79 |
</FIELD>
|
|
80 |
</xsl:if>
|
|
81 |
</ROW>
|
|
82 | 82 |
|
83 |
<!--
|
|
84 |
<xsl:for-each select="./persons/elem">
|
|
85 |
<xsl:if test="string-length(./name) > 0 and string-length(./researcherId) > 0">
|
|
83 |
<!--
|
|
84 |
<xsl:for-each select="./persons/elem">
|
|
85 |
<xsl:if test="string-length(./name) > 0 and string-length(./researcherId) > 0">
|
|
86 | 86 |
|
87 |
<xsl:variable name="orgId" select="concat($projectId, '::', translate(./organization, $invalid, $valid))" />
|
|
88 |
<ROW table="organizations">
|
|
89 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$orgId" /></FIELD>
|
|
90 |
<FIELD name="id"><xsl:value-of select="$orgId" /></FIELD>
|
|
91 |
<FIELD name="legalname"><xsl:value-of select="./organization" /></FIELD>
|
|
92 |
<FIELD name="countryclass"><xsl:value-of select="./country" /></FIELD>
|
|
93 |
<FIELD name="countryscheme">dnet:countries</FIELD>
|
|
94 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
|
|
95 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
|
96 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
|
97 |
</ROW>
|
|
98 |
<xsl:variable name="personId" select="concat($projectId, '::', ./researcherId)"/>
|
|
99 |
<ROW table="persons">
|
|
100 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$personId" /></FIELD>
|
|
101 |
<FIELD name="id"><xsl:value-of select="$personId" /></FIELD>
|
|
102 |
<FIELD name="firstname"><xsl:value-of select="./name" /></FIELD>
|
|
103 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
|
|
104 |
<FIELD name="nationalityClass"><xsl:value-of select="./country" /></FIELD>
|
|
105 |
<FIELD name="nationalityScheme">dnet:countries</FIELD>
|
|
106 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
|
107 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
|
108 |
<FIELD name="optional1"><xsl:value-of select="./role" /></FIELD>
|
|
109 |
</ROW>
|
|
110 |
<ROW table="project_organization">
|
|
111 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($orgId, '@@', $projectId)" /></FIELD>
|
|
112 |
<FIELD name="participantnumber" type="int"><xsl:value-of select="position()" /></FIELD>
|
|
113 |
<FIELD name="startdate" type="date" format="dd/MM/yyyy"><xsl:value-of select="../../startDate"/></FIELD>
|
|
114 |
<FIELD name="enddate" type="date" format="dd/MM/yyyy"><xsl:value-of select="../../endDate"/></FIELD>
|
|
115 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
|
|
116 |
<FIELD name="resporganization"><xsl:value-of select="$orgId" /></FIELD>
|
|
117 |
<FIELD name="contactperson"><xsl:value-of select="$personId" /></FIELD>
|
|
118 |
<FIELD name="semanticclass">participant</FIELD>
|
|
119 |
</ROW>
|
|
120 |
<ROW table="identities">
|
|
121 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="./researcherId" /></FIELD>
|
|
122 |
<FIELD name="pid"><xsl:value-of select="./researcherId" /></FIELD>
|
|
123 |
<FIELD name="issuertypeclass">fct:researcher_ids</FIELD>
|
|
124 |
<FIELD name="issuertypescheme">dnet:pid_types</FIELD>
|
|
125 |
</ROW>
|
|
126 |
<ROW table="personpids">
|
|
127 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat(./researcherId, '@@', $personId)" /></FIELD>
|
|
128 |
<FIELD name="pid"><xsl:value-of select="./researcherId" /></FIELD>
|
|
129 |
<FIELD name="person"><xsl:value-of select="$personId" /></FIELD>
|
|
130 |
</ROW>
|
|
131 |
<xsl:if test="string-length(normalize-space(./orcidId)) > 0">
|
|
132 |
<ROW table="identities">
|
|
133 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="./orcidId" /></FIELD>
|
|
134 |
<FIELD name="pid"><xsl:value-of select="./orcidId" /></FIELD>
|
|
135 |
<FIELD name="issuertypeclass">orcid</FIELD>
|
|
136 |
<FIELD name="issuertypescheme">dnet:pid_types</FIELD>
|
|
137 |
</ROW>
|
|
138 |
<ROW table="personpids">
|
|
139 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat(./orcidId, '@@', $personId)" /></FIELD>
|
|
140 |
<FIELD name="pid"><xsl:value-of select="./orcidId" /></FIELD>
|
|
141 |
<FIELD name="person"><xsl:value-of select="$personId" /></FIELD>
|
|
142 |
</ROW>
|
|
143 |
</xsl:if>
|
|
144 |
</xsl:if>
|
|
145 |
</xsl:for-each>
|
|
146 |
-->
|
|
87 |
<xsl:variable name="orgId" select="concat($projectId, '::', translate(./organization, $invalid, $valid))" />
|
|
88 |
<ROW table="organizations">
|
|
89 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$orgId" /></FIELD>
|
|
90 |
<FIELD name="id"><xsl:value-of select="$orgId" /></FIELD>
|
|
91 |
<FIELD name="legalname"><xsl:value-of select="./organization" /></FIELD>
|
|
92 |
<FIELD name="countryclass"><xsl:value-of select="./country" /></FIELD>
|
|
93 |
<FIELD name="countryscheme">dnet:countries</FIELD>
|
|
94 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
|
|
95 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
|
96 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
|
97 |
</ROW>
|
|
98 |
<xsl:variable name="personId" select="concat($projectId, '::', ./researcherId)"/>
|
|
99 |
<ROW table="persons">
|
|
100 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$personId" /></FIELD>
|
|
101 |
<FIELD name="id"><xsl:value-of select="$personId" /></FIELD>
|
|
102 |
<FIELD name="firstname"><xsl:value-of select="./name" /></FIELD>
|
|
103 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
|
|
104 |
<FIELD name="nationalityClass"><xsl:value-of select="./country" /></FIELD>
|
|
105 |
<FIELD name="nationalityScheme">dnet:countries</FIELD>
|
|
106 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
|
107 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
|
108 |
<FIELD name="optional1"><xsl:value-of select="./role" /></FIELD>
|
|
109 |
</ROW>
|
|
110 |
<ROW table="project_organization">
|
|
111 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($orgId, '@@', $projectId)" /></FIELD>
|
|
112 |
<FIELD name="participantnumber" type="int"><xsl:value-of select="position()" /></FIELD>
|
|
113 |
<FIELD name="startdate" type="date" format="dd/MM/yyyy"><xsl:value-of select="../../startDate"/></FIELD>
|
|
114 |
<FIELD name="enddate" type="date" format="dd/MM/yyyy"><xsl:value-of select="../../endDate"/></FIELD>
|
|
115 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
|
|
116 |
<FIELD name="resporganization"><xsl:value-of select="$orgId" /></FIELD>
|
|
117 |
<FIELD name="contactperson"><xsl:value-of select="$personId" /></FIELD>
|
|
118 |
<FIELD name="semanticclass">participant</FIELD>
|
|
119 |
</ROW>
|
|
120 |
<ROW table="identities">
|
|
121 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="./researcherId" /></FIELD>
|
|
122 |
<FIELD name="pid"><xsl:value-of select="./researcherId" /></FIELD>
|
|
123 |
<FIELD name="issuertypeclass">fct:researcher_ids</FIELD>
|
|
124 |
<FIELD name="issuertypescheme">dnet:pid_types</FIELD>
|
|
125 |
</ROW>
|
|
126 |
<ROW table="personpids">
|
|
127 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat(./researcherId, '@@', $personId)" /></FIELD>
|
|
128 |
<FIELD name="pid"><xsl:value-of select="./researcherId" /></FIELD>
|
|
129 |
<FIELD name="person"><xsl:value-of select="$personId" /></FIELD>
|
|
130 |
</ROW>
|
|
131 |
<xsl:if test="string-length(normalize-space(./orcidId)) > 0">
|
|
132 |
<ROW table="identities">
|
|
133 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="./orcidId" /></FIELD>
|
|
134 |
<FIELD name="pid"><xsl:value-of select="./orcidId" /></FIELD>
|
|
135 |
<FIELD name="issuertypeclass">orcid</FIELD>
|
|
136 |
<FIELD name="issuertypescheme">dnet:pid_types</FIELD>
|
|
137 |
</ROW>
|
|
138 |
<ROW table="personpids">
|
|
139 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat(./orcidId, '@@', $personId)" /></FIELD>
|
|
140 |
<FIELD name="pid"><xsl:value-of select="./orcidId" /></FIELD>
|
|
141 |
<FIELD name="person"><xsl:value-of select="$personId" /></FIELD>
|
|
142 |
</ROW>
|
|
143 |
</xsl:if>
|
|
144 |
</xsl:if>
|
|
145 |
</xsl:for-each>
|
|
146 |
-->
|
|
147 | 147 |
|
148 |
<xsl:for-each select="./funding">
|
|
149 |
<xsl:variable name="p1" select="normalize-space(./program)"/>
|
|
150 |
<xsl:variable name="p2" select="normalize-space(./program2)"/>
|
|
151 |
|
|
148 |
<xsl:for-each select="./funding">
|
|
149 |
<xsl:variable name="p1" select="normalize-space(./program)"/>
|
|
150 |
<xsl:variable name="p2" select="normalize-space(./program2)"/>
|
|
151 |
|
|
152 | 152 |
<xsl:variable name="tmpFundingId"> |
153 | 153 |
<xsl:choose> |
154 |
<xsl:when test="string-length($p1) > 0 and string-length($p2) > 0">
|
|
155 |
<xsl:value-of select="concat($funderID, '::', $p1, '::', $p2)" />
|
|
154 |
<xsl:when test="string-length($p1) > 0 and string-length($p2) > 0"> |
|
155 |
<xsl:value-of select="concat($funderID, '::', $p1, '::', $p2)"/> |
|
156 | 156 |
</xsl:when> |
157 |
<xsl:when test="string-length($p1) > 0">
|
|
158 |
<xsl:value-of select="concat($funderID, '::', $p1)" />
|
|
157 |
<xsl:when test="string-length($p1) > 0"> |
|
158 |
<xsl:value-of select="concat($funderID, '::', $p1)"/> |
|
159 | 159 |
</xsl:when> |
160 | 160 |
<xsl:otherwise></xsl:otherwise> |
161 | 161 |
</xsl:choose> |
162 | 162 |
</xsl:variable> |
163 |
|
|
164 |
<xsl:variable name="fundingId" select="normalize-space($tmpFundingId)" /> |
|
165 | 163 |
|
166 |
<xsl:if test="string-length($fundingId) > 0"> |
|
167 |
<ROW table="project_fundingpath"> |
|
168 |
<FIELD name="_dnet_resource_identifier_"> |
|
169 |
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/> |
|
170 |
</FIELD> |
|
171 |
<FIELD name="funding"> |
|
172 |
<xsl:value-of select="$fundingId"/> |
|
173 |
</FIELD> |
|
174 |
<FIELD name="project"> |
|
175 |
<xsl:value-of select="$projectId"/> |
|
176 |
</FIELD> |
|
177 |
<FIELD name="startdate" type="date" format="dd/MM/yyyy"> |
|
178 |
<xsl:value-of select="../startDate"/> |
|
179 |
</FIELD> |
|
180 |
<FIELD name="enddate" type="date" format="dd/MM/yyyy"> |
|
181 |
<xsl:value-of select="../endDate"/> |
|
182 |
</FIELD> |
|
183 |
<FIELD name="optional1"> |
|
184 |
<xsl:value-of select="./amount"/> |
|
185 |
</FIELD> |
|
186 |
<FIELD name="optional2"> |
|
187 |
<xsl:value-of select="./dateAwarded"/> |
|
188 |
</FIELD> |
|
189 |
</ROW> |
|
190 |
</xsl:if> |
|
191 |
</xsl:for-each> |
|
164 |
<xsl:variable name="fundingId" select="normalize-space($tmpFundingId)"/> |
|
192 | 165 |
|
193 |
</xsl:template> |
|
166 |
<xsl:if test="string-length($fundingId) > 0"> |
|
167 |
<ROW table="project_fundingpath"> |
|
168 |
<FIELD name="_dnet_resource_identifier_"> |
|
169 |
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/> |
|
170 |
</FIELD> |
|
171 |
<FIELD name="funding"> |
|
172 |
<xsl:value-of select="$fundingId"/> |
|
173 |
</FIELD> |
|
174 |
<FIELD name="project"> |
|
175 |
<xsl:value-of select="$projectId"/> |
|
176 |
</FIELD> |
|
177 |
<FIELD name="startdate" type="date" format="dd/MM/yyyy"> |
|
178 |
<xsl:value-of select="../startDate"/> |
|
179 |
</FIELD> |
|
180 |
<FIELD name="enddate" type="date" format="dd/MM/yyyy"> |
|
181 |
<xsl:value-of select="../endDate"/> |
|
182 |
</FIELD> |
|
183 |
<FIELD name="optional1"> |
|
184 |
<xsl:value-of select="./amount"/> |
|
185 |
</FIELD> |
|
186 |
<FIELD name="optional2"> |
|
187 |
<xsl:value-of select="./dateAwarded"/> |
|
188 |
</FIELD> |
|
189 |
</ROW> |
|
190 |
</xsl:if> |
|
191 |
</xsl:for-each> |
|
192 |
|
|
193 |
</xsl:template> |
|
194 | 194 |
</xsl:stylesheet> |
Also available in: Unified diff
integrated (hopefully) all required changes from dnet40