Project

General

Profile

1
<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
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
                xmlns:dnet="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions"
18
                version="1.0">
19

    
20
	<xsl:param name="varDataSourceId"/>
21
	<xsl:variable name="namespacePrefix" select="string('re3data_____')"/>
22

    
23
	<xsl:variable name="dsId" select="concat($namespacePrefix, '::', normalize-space(.//*[local-name()='re3data.orgIdentifier']))"/>
24
	<xsl:variable name="subjects">
25
		<xsl:for-each select="//*[local-name()='subject']">
26
			<xsl:if test="position() &gt; 1"> @@ </xsl:if>
27
			<xsl:value-of select="substring-after(., ' ')"/>
28
		</xsl:for-each>
29
	</xsl:variable>
30

    
31
	<xsl:template match="/">
32
		<record>
33

    
34
			<xsl:copy-of select=".//*[local-name()='header']"/>
35
			<metadata>
36
				<ROWS>
37
					<ROW table="dsm_datasources">
38
						<FIELD name="_dnet_resource_identifier_">
39
							<xsl:value-of select="$dsId"/>
40
						</FIELD>
41
						<FIELD name="id">
42
							<xsl:value-of select="$dsId"/>
43
						</FIELD>
44
						<FIELD name="officialName">
45
							<xsl:value-of select=".//*[local-name()='repositoryName']"/>
46
						</FIELD>
47
						<FIELD name="englishName">
48
							<xsl:value-of select=".//*[local-name()='additionalName'][@language='eng']"/>
49
						</FIELD>
50
						<FIELD name="websiteurl">
51
							<xsl:value-of select=".//*[local-name()='repositoryURL']"/>
52
						</FIELD>
53
						<FIELD name="namespaceprefix">
54
							<xsl:value-of select="dnet:generateNsPrefix('r3', dnet:md5(normalize-space(.//*[local-name()='re3data.orgIdentifier'])))"/>
55
						</FIELD>
56
						<FIELD name="collectedfrom">
57
							<xsl:value-of select="$varDataSourceId"/>
58
						</FIELD>
59
						<FIELD name="typology">datarepository::unknown</FIELD>
60
						<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
61
						<FIELD name="platform">
62
							<xsl:value-of select=".//*[local-name()='software']/*[local-name()='softwareName']"/>
63
						</FIELD>
64
						<FIELD name="description">
65
							<xsl:value-of select="./*[local-name()='description']"/>
66
						</FIELD>
67
						<FIELD name="releasestartdate" type="date">
68
							<xsl:value-of select=".//*[local-name()='startDate']"/>
69
						</FIELD>
70
						<FIELD name="releaseenddate" type="date">
71
							<xsl:value-of select=".//*[local-name()='endDate']"/>
72
						</FIELD>
73
						<FIELD name="missionstatementurl">
74
							<xsl:value-of select=".//*[local-name()='missionStatementURL']"/>
75
						</FIELD>
76

    
77
						<xsl:choose>
78
							<xsl:when test=".//*[local-name()='providerType'] = 'dataProvider'">
79
								<FIELD name="dataprovider" type="boolean">true</FIELD>
80
							</xsl:when>
81
							<xsl:otherwise>
82
								<FIELD name="dataprovider" type="boolean">false</FIELD>
83
							</xsl:otherwise>
84
						</xsl:choose>
85
						<xsl:choose>
86
							<xsl:when test=".//*[local-name()='providerType'] = 'serviceProvider'">
87
								<FIELD name="serviceprovider" type="boolean">true</FIELD>
88
							</xsl:when>
89
							<xsl:otherwise>
90
								<FIELD name="serviceprovider" type="boolean">false</FIELD>
91
							</xsl:otherwise>
92
						</xsl:choose>
93
						<FIELD name="databaseaccesstype">
94
							<xsl:value-of select=".//*[local-name()='databaseAccessType']"/>
95
						</FIELD>
96
						<FIELD name="datauploadtype">
97
							<xsl:value-of select=".//*[local-name()='dataUploadType']"/>
98
						</FIELD>
99
						<FIELD name="databaseaccessrestriction">
100
							<xsl:value-of select=".//*[local-name()='databaseAccessRestriction']"/>
101
						</FIELD>
102
						<FIELD name="datauploadrestriction">
103
							<xsl:value-of select=".//*[local-name()='dataUploadRestriction']"/>
104
						</FIELD>
105
						<xsl:choose>
106
							<xsl:when test=".//*[local-name()='versioning'] = 'yes'">
107
								<FIELD name="versioning" type="boolean">true</FIELD>
108
							</xsl:when>
109
							<xsl:otherwise>
110
								<FIELD name="versioning" type="boolean">false</FIELD>
111
							</xsl:otherwise>
112
						</xsl:choose>
113
						<FIELD name="citationguidelineurl">
114
							<xsl:value-of select=".//*[local-name()='citationGuidelineURL']"/>
115
						</FIELD>
116
						<FIELD name="qualitymanagementkind">
117
							<xsl:value-of select=".//*[local-name()='qualityManagement']"/>
118
						</FIELD>
119
						<FIELD name="pidsystems">
120
							<xsl:value-of select=".//*[local-name()='pidSystem']"/>
121
						</FIELD>
122
						<FIELD name="certificates">
123
							<xsl:value-of select=".//*[local-name()='certificate']"/>
124
						</FIELD>
125
						<FIELD name="subjects">
126
							<xsl:value-of select="normalize-space($subjects)"/>
127
						</FIELD>
128
					</ROW>
129

    
130
					<xsl:for-each select="//*[local-name()='api']">
131
						<xsl:variable name="apiId" select="concat('api_________::', $dsId, '::', position())"/>
132
						<xsl:variable name="baseURL" select="normalize-space(.)"/>
133
						<ROW table="dsm_api">
134
							<FIELD name="_dnet_resource_identifier_">
135
								<xsl:value-of select="$apiId"/>
136
							</FIELD>
137
							<FIELD name="id">
138
								<xsl:value-of select="$apiId"/>
139
							</FIELD>
140
							<FIELD name="protocol">
141
								<xsl:value-of select="normalize-space(@apiType)"/>
142
							</FIELD>
143
							<FIELD name="datasource">
144
								<xsl:value-of select="$dsId"/>
145
							</FIELD>
146
							<FIELD name="contentdescription">metadata</FIELD>
147
							<FIELD name="typology">datarepository::unknown</FIELD>
148

    
149
							<FIELD name="baseurl">
150
								<xsl:value-of select="$baseURL"/>
151
							</FIELD>
152
						</ROW>
153
					</xsl:for-each>
154

    
155
					<xsl:for-each select="//*[local-name()='institution']">
156
						<xsl:variable name="orgId" select="concat($namespacePrefix, '::', dnet:md5(normalize-space(./*[local-name()='institutionName'])))"/>
157
						<ROW table="dsm_organizations">
158
							<FIELD name="_dnet_resource_identifier_">
159
								<xsl:value-of select="$orgId"/>
160
							</FIELD>
161
							<FIELD name="id">
162
								<xsl:value-of select="$orgId"/>
163
							</FIELD>
164
							<FIELD name="legalname">
165
								<xsl:value-of select="./*[local-name()='institutionName']"/>
166
							</FIELD>
167
							<FIELD name="legalshortname">
168
								<xsl:value-of select="./*[local-name()='institutionAdditionalName'][1]"/>
169
							</FIELD>
170
							<FIELD name="websiteurl">
171
								<xsl:choose>
172
									<xsl:when test="starts-with(normalize-space(./*[local-name()='institutionURL']), 'http')">
173
										<xsl:value-of select="./*[local-name()='institutionURL']"/>
174
									</xsl:when>
175
									<xsl:when test="string-length(normalize-space(./*[local-name()='institutionURL'])) &gt; 0">
176
										<xsl:value-of select="concat('http://', normalize-space(./*[local-name()='institutionURL']))"/>
177
									</xsl:when>
178
								</xsl:choose>
179
							</FIELD>
180
							<FIELD name="country">
181
								<xsl:value-of select="./*[local-name()='institutionCountry']"/>
182
							</FIELD>
183
							<FIELD name="collectedfrom">
184
								<xsl:value-of select="$varDataSourceId"/>
185
							</FIELD>
186
							<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
187
						</ROW>
188

    
189
						<ROW table="dsm_datasource_organization">
190
							<FIELD name="_dnet_resource_identifier_">
191
								<xsl:value-of select="concat($dsId, '@@', $orgId)"/>
192
							</FIELD>
193
							<FIELD name="datasource">
194
								<xsl:value-of select="$dsId"/>
195
							</FIELD>
196
							<FIELD name="organization">
197
								<xsl:value-of select="$orgId"/>
198
							</FIELD>
199
						</ROW>
200
					</xsl:for-each>
201

    
202
				</ROWS>
203
			</metadata>
204
		</record>
205
	</xsl:template>
206
</xsl:stylesheet>
207
]]>
208
				</CODE>
209
			</SCRIPT>
210
		</CONFIGURATION>
211
		<STATUS/>
212
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
213
	</BODY>
214
</RESOURCE_PROFILE>
(6-6/6)