Project

General

Profile

1 52634 alessia.ba
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="6daafb85-53b2-4adb-8054-f91b10029b20_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
6
		<RESOURCE_URI value=""/>
7
		<DATE_OF_CREATION value="2018-07-02T11:15:30+00:00"/>
8
	</HEADER>
9
	<BODY>
10
		<CONFIGURATION>
11
			<IMPORTED/>
12
			<SCRIPT>
13
				<TITLE>RE3DATA 2 DB</TITLE>
14
				<CODE>
15
					<![CDATA[
16
<?xml version="1.0" encoding="UTF-8"?>
17
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
18
                xmlns:dnet="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions"
19
                version="1.0">
20
21
	<xsl:param name="varDataSourceId"/>
22
	<xsl:variable name="namespacePrefix" select="string('re3data_____')"/>
23
24
	<xsl:variable name="dsId" select="concat($namespacePrefix, '::', normalize-space(.//*[local-name()='re3data.orgIdentifier']))"/>
25
	<xsl:variable name="subjects">
26
		<xsl:for-each select="//*[local-name()='subject']">
27
			<xsl:if test="position() &gt; 1"> @@ </xsl:if>
28
			<xsl:value-of select="substring-after(., ' ')"/>
29
		</xsl:for-each>
30
	</xsl:variable>
31
32
	<xsl:template match="/">
33
		<record>
34
35
			<xsl:copy-of select=".//*[local-name()='header']"/>
36
			<metadata>
37
				<ROWS>
38
					<ROW table="dsm_datasources">
39
						<FIELD name="_dnet_resource_identifier_">
40
							<xsl:value-of select="$dsId"/>
41
						</FIELD>
42
						<FIELD name="id">
43
							<xsl:value-of select="$dsId"/>
44
						</FIELD>
45
						<FIELD name="officialName">
46
							<xsl:value-of select=".//*[local-name()='repositoryName']"/>
47
						</FIELD>
48
						<FIELD name="englishName">
49
							<xsl:value-of select=".//*[local-name()='additionalName'][@language='eng']"/>
50
						</FIELD>
51
						<FIELD name="websiteurl">
52
							<xsl:value-of select=".//*[local-name()='repositoryURL']"/>
53
						</FIELD>
54
						<FIELD name="namespaceprefix">
55
							<xsl:value-of select="dnet:generateNsPrefix('r3', dnet:md5(normalize-space(.//*[local-name()='re3data.orgIdentifier'])))"/>
56
						</FIELD>
57
						<FIELD name="collectedfrom">
58
							<xsl:value-of select="$varDataSourceId"/>
59
						</FIELD>
60
						<FIELD name="typology">datarepository::unknown</FIELD>
61
						<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
62
						<FIELD name="platform">
63
							<xsl:value-of select=".//*[local-name()='software']/*[local-name()='softwareName']"/>
64
						</FIELD>
65
						<FIELD name="description">
66
							<xsl:value-of select="./*[local-name()='description']"/>
67
						</FIELD>
68
						<FIELD name="releasestartdate" type="date">
69
							<xsl:value-of select=".//*[local-name()='startDate']"/>
70
						</FIELD>
71
						<FIELD name="releaseenddate" type="date">
72
							<xsl:value-of select=".//*[local-name()='endDate']"/>
73
						</FIELD>
74
						<FIELD name="missionstatementurl">
75
							<xsl:value-of select=".//*[local-name()='missionStatementURL']"/>
76
						</FIELD>
77
78
						<xsl:choose>
79
							<xsl:when test=".//*[local-name()='providerType'] = 'dataProvider'">
80
								<FIELD name="dataprovider" type="boolean">true</FIELD>
81
							</xsl:when>
82
							<xsl:otherwise>
83
								<FIELD name="dataprovider" type="boolean">false</FIELD>
84
							</xsl:otherwise>
85
						</xsl:choose>
86
						<xsl:choose>
87
							<xsl:when test=".//*[local-name()='providerType'] = 'serviceProvider'">
88
								<FIELD name="serviceprovider" type="boolean">true</FIELD>
89
							</xsl:when>
90
							<xsl:otherwise>
91
								<FIELD name="serviceprovider" type="boolean">false</FIELD>
92
							</xsl:otherwise>
93
						</xsl:choose>
94
						<FIELD name="databaseaccesstype">
95
							<xsl:value-of select=".//*[local-name()='databaseAccessType']"/>
96
						</FIELD>
97
						<FIELD name="datauploadtype">
98
							<xsl:value-of select=".//*[local-name()='dataUploadType']"/>
99
						</FIELD>
100
						<FIELD name="databaseaccessrestriction">
101
							<xsl:value-of select=".//*[local-name()='databaseAccessRestriction']"/>
102
						</FIELD>
103
						<FIELD name="datauploadrestriction">
104
							<xsl:value-of select=".//*[local-name()='dataUploadRestriction']"/>
105
						</FIELD>
106
						<xsl:choose>
107
							<xsl:when test=".//*[local-name()='versioning'] = 'yes'">
108
								<FIELD name="versioning" type="boolean">true</FIELD>
109
							</xsl:when>
110
							<xsl:otherwise>
111
								<FIELD name="versioning" type="boolean">false</FIELD>
112
							</xsl:otherwise>
113
						</xsl:choose>
114
						<FIELD name="citationguidelineurl">
115
							<xsl:value-of select=".//*[local-name()='citationGuidelineURL']"/>
116
						</FIELD>
117
						<FIELD name="qualitymanagementkind">
118
							<xsl:value-of select=".//*[local-name()='qualityManagement']"/>
119
						</FIELD>
120
						<FIELD name="pidsystems">
121
							<xsl:value-of select=".//*[local-name()='pidSystem']"/>
122
						</FIELD>
123
						<FIELD name="certificates">
124
							<xsl:value-of select=".//*[local-name()='certificate']"/>
125
						</FIELD>
126
						<FIELD name="subjects">
127
							<xsl:value-of select="normalize-space($subjects)"/>
128
						</FIELD>
129
					</ROW>
130
131
					<xsl:for-each select="//*[local-name()='api']">
132
						<xsl:variable name="apiId" select="concat('api_________::', $dsId, '::', position())"/>
133
						<xsl:variable name="baseURL" select="normalize-space(.)"/>
134
						<ROW table="dsm_api">
135
							<FIELD name="_dnet_resource_identifier_">
136
								<xsl:value-of select="$apiId"/>
137
							</FIELD>
138
							<FIELD name="id">
139
								<xsl:value-of select="$apiId"/>
140
							</FIELD>
141
							<FIELD name="protocol">
142
								<xsl:value-of select="normalize-space(@apiType)"/>
143
							</FIELD>
144
							<FIELD name="datasource">
145
								<xsl:value-of select="$dsId"/>
146
							</FIELD>
147
							<FIELD name="contentdescription">metadata</FIELD>
148
							<FIELD name="typology">datarepository::unknown</FIELD>
149
150
							<FIELD name="baseurl">
151
								<xsl:value-of select="$baseURL"/>
152
							</FIELD>
153
						</ROW>
154
					</xsl:for-each>
155
156
					<xsl:for-each select="//*[local-name()='institution']">
157
						<xsl:variable name="orgId" select="concat($namespacePrefix, '::', dnet:md5(normalize-space(./*[local-name()='institutionName'])))"/>
158
						<ROW table="dsm_organizations">
159
							<FIELD name="_dnet_resource_identifier_">
160
								<xsl:value-of select="$orgId"/>
161
							</FIELD>
162
							<FIELD name="id">
163
								<xsl:value-of select="$orgId"/>
164
							</FIELD>
165
							<FIELD name="legalname">
166
								<xsl:value-of select="./*[local-name()='institutionName']"/>
167
							</FIELD>
168
							<FIELD name="legalshortname">
169
								<xsl:value-of select="./*[local-name()='institutionAdditionalName'][1]"/>
170
							</FIELD>
171
							<FIELD name="websiteurl">
172
								<xsl:choose>
173
									<xsl:when test="starts-with(normalize-space(./*[local-name()='institutionURL']), 'http')">
174
										<xsl:value-of select="./*[local-name()='institutionURL']"/>
175
									</xsl:when>
176
									<xsl:when test="string-length(normalize-space(./*[local-name()='institutionURL'])) &gt; 0">
177
										<xsl:value-of select="concat('http://', normalize-space(./*[local-name()='institutionURL']))"/>
178
									</xsl:when>
179
								</xsl:choose>
180
							</FIELD>
181
							<FIELD name="country">
182
								<xsl:value-of select="./*[local-name()='institutionCountry']"/>
183
							</FIELD>
184
							<FIELD name="collectedfrom">
185
								<xsl:value-of select="$varDataSourceId"/>
186
							</FIELD>
187
							<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
188
						</ROW>
189
190
						<ROW table="dsm_datasource_organization">
191
							<FIELD name="_dnet_resource_identifier_">
192
								<xsl:value-of select="concat($dsId, '@@', $orgId)"/>
193
							</FIELD>
194
							<FIELD name="datasource">
195
								<xsl:value-of select="$dsId"/>
196
							</FIELD>
197
							<FIELD name="organization">
198
								<xsl:value-of select="$orgId"/>
199
							</FIELD>
200
						</ROW>
201
					</xsl:for-each>
202
203
				</ROWS>
204
			</metadata>
205
		</record>
206
	</xsl:template>
207
</xsl:stylesheet>
208
]]>
209
				</CODE>
210
			</SCRIPT>
211
		</CONFIGURATION>
212
		<STATUS/>
213
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
214
	</BODY>
215
</RESOURCE_PROFILE>