Revision 55015
Added by Alessia Bardi about 5 years ago
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/datasources/opendoar2db.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="5b194596-4f55-4df2-989a-27b50232ddf6_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>OPENDOAR 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" version="1.0"> |
|
18 |
|
|
19 |
<xsl:param name="varDataSourceId"/> |
|
20 |
<xsl:variable name="namespacePrefix" select="string('opendoar____')"/> |
|
21 |
|
|
22 |
<xsl:template match="/"> |
|
23 |
<record> |
|
24 |
|
|
25 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
26 |
<metadata> |
|
27 |
<xsl:variable name="rid" select="normalize-space(//repository/@rID)"/> |
|
28 |
<xsl:variable name="datasourceId" select="concat($namespacePrefix, '::', $rid)"/> |
|
29 |
<xsl:variable name="apiId" select="concat('api_________::', $datasourceId, '::0')"/> |
|
30 |
<xsl:variable name="oUrl" select="normalize-space(//oUrl)"/> |
|
31 |
<xsl:variable name="oName" select="normalize-space(//oName)"/> |
|
32 |
<xsl:variable name="organizationId" select="translate(concat($namespacePrefix, '::', $oName), ' ', '_')"/> |
|
33 |
<xsl:variable name="repositoryType"> |
|
34 |
<xsl:choose> |
|
35 |
<xsl:when test="normalize-space(//repositoryType) = 'Institutional'"> |
|
36 |
<xsl:value-of select="string('pubsrepository::institutional')"/> |
|
37 |
</xsl:when> |
|
38 |
<xsl:when test="normalize-space(//repositoryType) = 'Disciplinary'"> |
|
39 |
<xsl:value-of select="string('pubsrepository::thematic')"/> |
|
40 |
</xsl:when> |
|
41 |
<xsl:when test="normalize-space(//repositoryType) = 'Aggregating'"> |
|
42 |
<xsl:value-of select="string('aggregator::pubsrepository::unknown')"/> |
|
43 |
</xsl:when> |
|
44 |
<xsl:otherwise> |
|
45 |
<xsl:value-of select="string('pubsrepository::unknown')"/> |
|
46 |
</xsl:otherwise> |
|
47 |
</xsl:choose> |
|
48 |
</xsl:variable> |
|
49 |
|
|
50 |
<xsl:variable name="contenttypes"> |
|
51 |
<xsl:for-each select=".//contentType"> |
|
52 |
<xsl:if test="position() > 1"> - </xsl:if> |
|
53 |
<xsl:value-of select="."/> |
|
54 |
</xsl:for-each> |
|
55 |
</xsl:variable> |
|
56 |
<xsl:variable name="languages"> |
|
57 |
<xsl:for-each select=".//lName"> |
|
58 |
<xsl:if test="position() > 1">, </xsl:if> |
|
59 |
<xsl:value-of select="."/> |
|
60 |
</xsl:for-each> |
|
61 |
</xsl:variable> |
|
62 |
|
|
63 |
<xsl:variable name="subjects"> |
|
64 |
<xsl:for-each select=".//clTitle"> |
|
65 |
<xsl:if test="position() > 1"> @@ </xsl:if> |
|
66 |
<xsl:value-of select="."/> |
|
67 |
</xsl:for-each> |
|
68 |
</xsl:variable> |
|
69 |
|
|
70 |
<ROWS> |
|
71 |
<ROW table="dsm_datasources"> |
|
72 |
<FIELD name="_dnet_resource_identifier_"> |
|
73 |
<xsl:value-of select="$datasourceId"/> |
|
74 |
</FIELD> |
|
75 |
<FIELD name="id"> |
|
76 |
<xsl:value-of select="$datasourceId"/> |
|
77 |
</FIELD> |
|
78 |
<FIELD name="officialname"> |
|
79 |
<xsl:value-of select="normalize-space(//rName)"/> |
|
80 |
</FIELD> |
|
81 |
<FIELD name="englishname"> |
|
82 |
<xsl:value-of select="normalize-space(//rAcronym)"/> |
|
83 |
</FIELD> |
|
84 |
<FIELD name="websiteurl"> |
|
85 |
<xsl:value-of select="normalize-space(//rUrl)"/> |
|
86 |
</FIELD> |
|
87 |
<FIELD name="contactemail"> |
|
88 |
<xsl:value-of select="normalize-space(//pEmail)"/> |
|
89 |
</FIELD> |
|
90 |
<FIELD name="latitude" type="float"> |
|
91 |
<xsl:value-of select="normalize-space(//paLatitude)"/> |
|
92 |
</FIELD> |
|
93 |
<FIELD name="longitude" type="float"> |
|
94 |
<xsl:value-of select="normalize-space(//paLongitude)"/> |
|
95 |
</FIELD> |
|
96 |
<FIELD name="namespaceprefix"> |
|
97 |
<xsl:value-of select="dnet:generateNsPrefix('od', $rid)"/> |
|
98 |
</FIELD> |
|
99 |
<FIELD name="languages"> |
|
100 |
<xsl:value-of select="normalize-space($languages)"/> |
|
101 |
</FIELD> |
|
102 |
<FIELD name="od_contenttypes"> |
|
103 |
<xsl:value-of select="normalize-space($contenttypes)"/> |
|
104 |
</FIELD> |
|
105 |
<FIELD name="collectedfrom"> |
|
106 |
<xsl:value-of select="$varDataSourceId"/> |
|
107 |
</FIELD> |
|
108 |
<FIELD name="typology"> |
|
109 |
<xsl:value-of select="$repositoryType"/> |
|
110 |
</FIELD> |
|
111 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
112 |
<FIELD name="platform"> |
|
113 |
<xsl:value-of select="normalize-space(//rSoftWareName)"/> |
|
114 |
</FIELD> |
|
115 |
<FIELD name="description"> |
|
116 |
<xsl:value-of select="normalize-space(//rDescription)"/> |
|
117 |
</FIELD> |
|
118 |
|
|
119 |
<FIELD name="subjects"> |
|
120 |
<xsl:value-of select="normalize-space($subjects)"/> |
|
121 |
</FIELD> |
|
122 |
</ROW> |
|
123 |
|
|
124 |
<ROW table="dsm_api"> |
|
125 |
<FIELD name="_dnet_resource_identifier_"> |
|
126 |
<xsl:value-of select="$apiId"/> |
|
127 |
</FIELD> |
|
128 |
<FIELD name="id"> |
|
129 |
<xsl:value-of select="$apiId"/> |
|
130 |
</FIELD> |
|
131 |
<FIELD name="protocol">oai</FIELD> |
|
132 |
<FIELD name="datasource"> |
|
133 |
<xsl:value-of select="$datasourceId"/> |
|
134 |
</FIELD> |
|
135 |
<FIELD name="contentdescription">metadata</FIELD> |
|
136 |
<FIELD name="typology"> |
|
137 |
<xsl:value-of select="$repositoryType"/> |
|
138 |
</FIELD> |
|
139 |
<FIELD name="baseurl"> |
|
140 |
<xsl:value-of select="normalize-space(//rOaiBaseUrl)"/> |
|
141 |
</FIELD> |
|
142 |
<FIELD name="metadata_identifier_path">//*[local-name()='header']/*[local-name()='identifier']</FIELD> |
|
143 |
</ROW> |
|
144 |
|
|
145 |
<ROW table="dsm_apiparams"> |
|
146 |
<FIELD name="_dnet_resource_identifier_"> |
|
147 |
<xsl:value-of select="concat($apiId, '@@format')"/> |
|
148 |
</FIELD> |
|
149 |
<FIELD name="api"> |
|
150 |
<xsl:value-of select="$apiId"/> |
|
151 |
</FIELD> |
|
152 |
<FIELD name="param">format</FIELD> |
|
153 |
<FIELD name="value">oai_dc</FIELD> |
|
154 |
</ROW> |
|
155 |
|
|
156 |
<ROW table="dsm_organizations"> |
|
157 |
<FIELD name="_dnet_resource_identifier_"> |
|
158 |
<xsl:value-of select="$organizationId"/> |
|
159 |
</FIELD> |
|
160 |
<FIELD name="id"> |
|
161 |
<xsl:value-of select="$organizationId"/> |
|
162 |
</FIELD> |
|
163 |
<FIELD name="legalname"> |
|
164 |
<xsl:value-of select="$oName"/> |
|
165 |
</FIELD> |
|
166 |
<FIELD name="legalshortname"> |
|
167 |
<xsl:value-of select="normalize-space(//oAcronym)"/> |
|
168 |
</FIELD> |
|
169 |
<FIELD name="websiteurl"> |
|
170 |
<xsl:choose> |
|
171 |
<xsl:when test="starts-with(normalize-space($oUrl), 'http')"> |
|
172 |
<xsl:value-of select="normalize-space($oUrl)"/> |
|
173 |
</xsl:when> |
|
174 |
<xsl:when test="string-length(normalize-space($oUrl)) > 0"> |
|
175 |
<xsl:value-of select="concat('http://', normalize-space($oUrl))"/> |
|
176 |
</xsl:when> |
|
177 |
</xsl:choose> |
|
178 |
</FIELD> |
|
179 |
|
|
180 |
<FIELD name="country"> |
|
181 |
<xsl:choose> |
|
182 |
<xsl:when test="normalize-space(//cIsoCode) = 'GB'">UK</xsl:when> |
|
183 |
<xsl:otherwise> |
|
184 |
<xsl:value-of select="normalize-space(//cIsoCode)"></xsl:value-of> |
|
185 |
</xsl:otherwise> |
|
186 |
</xsl:choose> |
|
187 |
</FIELD> |
|
188 |
|
|
189 |
<FIELD name="collectedfrom"> |
|
190 |
<xsl:value-of select="$varDataSourceId"/> |
|
191 |
</FIELD> |
|
192 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
193 |
</ROW> |
|
194 |
|
|
195 |
<ROW table="dsm_datasource_organization"> |
|
196 |
<FIELD name="_dnet_resource_identifier_"> |
|
197 |
<xsl:value-of select="concat($datasourceId, '@@', $organizationId)"/> |
|
198 |
</FIELD> |
|
199 |
<FIELD name="datasource"> |
|
200 |
<xsl:value-of select="$datasourceId"/> |
|
201 |
</FIELD> |
|
202 |
<FIELD name="organization"> |
|
203 |
<xsl:value-of select="$organizationId"/> |
|
204 |
</FIELD> |
|
205 |
</ROW> |
|
206 |
|
|
207 |
</ROWS> |
|
208 |
</metadata> |
|
209 |
</record> |
|
210 |
</xsl:template> |
|
211 |
|
|
212 |
</xsl:stylesheet> |
|
213 |
|
|
214 |
]]> |
|
215 |
</CODE> |
|
216 |
</SCRIPT> |
|
217 |
</CONFIGURATION> |
|
218 |
<STATUS/> |
|
219 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
220 |
</BODY> |
|
221 |
</RESOURCE_PROFILE> |
Also available in: Unified diff
Removed old opendoar mapping to db