Revision 52634
Added by Alessia Bardi over 6 years ago
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/opendoar_2_db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
3 |
xmlns:dnet="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions" version="1.0"> |
|
4 |
|
|
5 |
<xsl:param name="parentDatasourceId"/> |
|
6 |
<xsl:param name="namespacePrefix"/> |
|
7 |
|
|
8 |
<xsl:template match="/"> |
|
9 |
<record> |
|
10 |
|
|
11 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
12 |
<metadata> |
|
13 |
<xsl:variable name="rid" select="normalize-space(//repository/@rID)"/> |
|
14 |
<xsl:variable name="datasourceId" select="concat($namespacePrefix, '::', $rid)"/> |
|
15 |
<xsl:variable name="apiId" select="concat('api_________::', $datasourceId, '::0')"/> |
|
16 |
<xsl:variable name="oUrl" select="normalize-space(//oUrl)"/> |
|
17 |
<xsl:variable name="oName" select="normalize-space(//oName)"/> |
|
18 |
<xsl:variable name="organizationId" select="translate(concat($namespacePrefix, '::', $oName), ' ', '_')"/> |
|
19 |
<xsl:variable name="repositoryType"> |
|
20 |
<xsl:choose> |
|
21 |
<xsl:when test="normalize-space(//repositoryType) = 'Institutional'"> |
|
22 |
<xsl:value-of select="string('pubsrepository::institutional')"/> |
|
23 |
</xsl:when> |
|
24 |
<xsl:when test="normalize-space(//repositoryType) = 'Disciplinary'"> |
|
25 |
<xsl:value-of select="string('pubsrepository::thematic')"/> |
|
26 |
</xsl:when> |
|
27 |
<xsl:when test="normalize-space(//repositoryType) = 'Aggregating'"> |
|
28 |
<xsl:value-of select="string('aggregator::pubsrepository::unknown')"/> |
|
29 |
</xsl:when> |
|
30 |
<xsl:otherwise> |
|
31 |
<xsl:value-of select="string('pubsrepository::unknown')"/> |
|
32 |
</xsl:otherwise> |
|
33 |
</xsl:choose> |
|
34 |
</xsl:variable> |
|
35 |
|
|
36 |
<xsl:variable name="contenttypes"> |
|
37 |
<xsl:for-each select=".//contentType"> |
|
38 |
<xsl:if test="position() > 1"> - </xsl:if> |
|
39 |
<xsl:value-of select="."/> |
|
40 |
</xsl:for-each> |
|
41 |
</xsl:variable> |
|
42 |
<xsl:variable name="languages"> |
|
43 |
<xsl:for-each select=".//lName"> |
|
44 |
<xsl:if test="position() > 1">, </xsl:if> |
|
45 |
<xsl:value-of select="."/> |
|
46 |
</xsl:for-each> |
|
47 |
</xsl:variable> |
|
48 |
|
|
49 |
<xsl:variable name="subjects"> |
|
50 |
<xsl:for-each select=".//clTitle"> |
|
51 |
<xsl:if test="position() > 1"> @@ </xsl:if> |
|
52 |
<xsl:value-of select="."/> |
|
53 |
</xsl:for-each> |
|
54 |
</xsl:variable> |
|
55 |
|
|
56 |
<ROWS> |
|
57 |
<ROW table="dsm_datasources"> |
|
58 |
<FIELD name="_dnet_resource_identifier_"> |
|
59 |
<xsl:value-of select="$datasourceId"/> |
|
60 |
</FIELD> |
|
61 |
<FIELD name="id"> |
|
62 |
<xsl:value-of select="$datasourceId"/> |
|
63 |
</FIELD> |
|
64 |
<FIELD name="officialname"> |
|
65 |
<xsl:value-of select="normalize-space(//rName)"/> |
|
66 |
</FIELD> |
|
67 |
<FIELD name="englishname"> |
|
68 |
<xsl:value-of select="normalize-space(//rAcronym)"/> |
|
69 |
</FIELD> |
|
70 |
<FIELD name="websiteurl"> |
|
71 |
<xsl:value-of select="normalize-space(//rUrl)"/> |
|
72 |
</FIELD> |
|
73 |
<FIELD name="contactemail"> |
|
74 |
<xsl:value-of select="normalize-space(//pEmail)"/> |
|
75 |
</FIELD> |
|
76 |
<FIELD name="latitude" type="float"> |
|
77 |
<xsl:value-of select="normalize-space(//paLatitude)"/> |
|
78 |
</FIELD> |
|
79 |
<FIELD name="longitude" type="float"> |
|
80 |
<xsl:value-of select="normalize-space(//paLongitude)"/> |
|
81 |
</FIELD> |
|
82 |
<FIELD name="namespaceprefix"> |
|
83 |
<xsl:value-of select="dnet:generateNsPrefix('od', $rid)"/> |
|
84 |
</FIELD> |
|
85 |
<FIELD name="languages"> |
|
86 |
<xsl:value-of select="normalize-space($languages)"/> |
|
87 |
</FIELD> |
|
88 |
<FIELD name="od_contenttypes"> |
|
89 |
<xsl:value-of select="normalize-space($contenttypes)"/> |
|
90 |
</FIELD> |
|
91 |
<FIELD name="collectedfrom"> |
|
92 |
<xsl:value-of select="$parentDatasourceId"/> |
|
93 |
</FIELD> |
|
94 |
<FIELD name="typology"> |
|
95 |
<xsl:value-of select="$repositoryType"/> |
|
96 |
</FIELD> |
|
97 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
98 |
<FIELD name="platform"> |
|
99 |
<xsl:value-of select="normalize-space(//rSoftWareName)"/> |
|
100 |
</FIELD> |
|
101 |
<FIELD name="description"> |
|
102 |
<xsl:value-of select="normalize-space(//rDescription)"/> |
|
103 |
</FIELD> |
|
104 |
|
|
105 |
<FIELD name="subjects"> |
|
106 |
<xsl:value-of select="normalize-space($subjects)"/> |
|
107 |
</FIELD> |
|
108 |
</ROW> |
|
109 |
|
|
110 |
<ROW table="dsm_api"> |
|
111 |
<FIELD name="_dnet_resource_identifier_"> |
|
112 |
<xsl:value-of select="$apiId"/> |
|
113 |
</FIELD> |
|
114 |
<FIELD name="id"> |
|
115 |
<xsl:value-of select="$apiId"/> |
|
116 |
</FIELD> |
|
117 |
<FIELD name="protocol">oai</FIELD> |
|
118 |
<FIELD name="datasource"> |
|
119 |
<xsl:value-of select="$datasourceId"/> |
|
120 |
</FIELD> |
|
121 |
<FIELD name="contentdescription">metadata</FIELD> |
|
122 |
<FIELD name="typology"> |
|
123 |
<xsl:value-of select="$repositoryType"/> |
|
124 |
</FIELD> |
|
125 |
<FIELD name="baseurl"> |
|
126 |
<xsl:value-of select="normalize-space(//rOaiBaseUrl)"/> |
|
127 |
</FIELD> |
|
128 |
<FIELD name="metadata_identifier_path">//*[local-name()='header']/*[local-name()='identifier']</FIELD> |
|
129 |
</ROW> |
|
130 |
|
|
131 |
<ROW table="dsm_apiparams"> |
|
132 |
<FIELD name="_dnet_resource_identifier_"> |
|
133 |
<xsl:value-of select="concat($apiId, '@@format')"/> |
|
134 |
</FIELD> |
|
135 |
<FIELD name="api"> |
|
136 |
<xsl:value-of select="$apiId"/> |
|
137 |
</FIELD> |
|
138 |
<FIELD name="param">format</FIELD> |
|
139 |
<FIELD name="value">oai_dc</FIELD> |
|
140 |
</ROW> |
|
141 |
|
|
142 |
<ROW table="dsm_organizations"> |
|
143 |
<FIELD name="_dnet_resource_identifier_"> |
|
144 |
<xsl:value-of select="$organizationId"/> |
|
145 |
</FIELD> |
|
146 |
<FIELD name="id"> |
|
147 |
<xsl:value-of select="$organizationId"/> |
|
148 |
</FIELD> |
|
149 |
<FIELD name="legalname"> |
|
150 |
<xsl:value-of select="$oName"/> |
|
151 |
</FIELD> |
|
152 |
<FIELD name="legalshortname"> |
|
153 |
<xsl:value-of select="normalize-space(//oAcronym)"/> |
|
154 |
</FIELD> |
|
155 |
<FIELD name="websiteurl"> |
|
156 |
<xsl:choose> |
|
157 |
<xsl:when test="starts-with(normalize-space($oUrl), 'http')"> |
|
158 |
<xsl:value-of select="normalize-space($oUrl)"/> |
|
159 |
</xsl:when> |
|
160 |
<xsl:when test="string-length(normalize-space($oUrl)) > 0"> |
|
161 |
<xsl:value-of select="concat('http://', normalize-space($oUrl))"/> |
|
162 |
</xsl:when> |
|
163 |
</xsl:choose> |
|
164 |
</FIELD> |
|
165 |
|
|
166 |
<FIELD name="country"> |
|
167 |
<xsl:choose> |
|
168 |
<xsl:when test="normalize-space(//cIsoCode) = 'GB'">UK</xsl:when> |
|
169 |
<xsl:otherwise> |
|
170 |
<xsl:value-of select="normalize-space(//cIsoCode)"></xsl:value-of> |
|
171 |
</xsl:otherwise> |
|
172 |
</xsl:choose> |
|
173 |
</FIELD> |
|
174 |
|
|
175 |
<FIELD name="collectedfrom"> |
|
176 |
<xsl:value-of select="$parentDatasourceId"/> |
|
177 |
</FIELD> |
|
178 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
179 |
</ROW> |
|
180 |
|
|
181 |
<ROW table="dsm_datasource_organization"> |
|
182 |
<FIELD name="_dnet_resource_identifier_"> |
|
183 |
<xsl:value-of select="concat($datasourceId, '@@', $organizationId)"/> |
|
184 |
</FIELD> |
|
185 |
<FIELD name="datasource"> |
|
186 |
<xsl:value-of select="$datasourceId"/> |
|
187 |
</FIELD> |
|
188 |
<FIELD name="organization"> |
|
189 |
<xsl:value-of select="$organizationId"/> |
|
190 |
</FIELD> |
|
191 |
</ROW> |
|
192 |
|
|
193 |
</ROWS> |
|
194 |
</metadata> |
|
195 |
</record> |
|
196 |
</xsl:template> |
|
197 |
|
|
198 |
</xsl:stylesheet> |
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/re3data_2_db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
3 |
xmlns:dnet="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions" |
|
4 |
version="1.0"> |
|
5 |
|
|
6 |
<xsl:param name="parentDatasourceId"/> |
|
7 |
<xsl:param name="namespacePrefix"/> |
|
8 |
|
|
9 |
<xsl:variable name="dsId" select="concat($namespacePrefix, '::', normalize-space(.//*[local-name()='re3data.orgIdentifier']))"/> |
|
10 |
<xsl:variable name="subjects"> |
|
11 |
<xsl:for-each select="//*[local-name()='subject']"> |
|
12 |
<xsl:if test="position() > 1"> @@ </xsl:if> |
|
13 |
<xsl:value-of select="substring-after(., ' ')"/> |
|
14 |
</xsl:for-each> |
|
15 |
</xsl:variable> |
|
16 |
|
|
17 |
<xsl:template match="/"> |
|
18 |
<record> |
|
19 |
|
|
20 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
21 |
<metadata> |
|
22 |
<ROWS> |
|
23 |
<ROW table="dsm_datasources"> |
|
24 |
<FIELD name="_dnet_resource_identifier_"> |
|
25 |
<xsl:value-of select="$dsId"/> |
|
26 |
</FIELD> |
|
27 |
<FIELD name="id"> |
|
28 |
<xsl:value-of select="$dsId"/> |
|
29 |
</FIELD> |
|
30 |
<FIELD name="officialName"> |
|
31 |
<xsl:value-of select=".//*[local-name()='repositoryName']"/> |
|
32 |
</FIELD> |
|
33 |
<FIELD name="englishName"> |
|
34 |
<xsl:value-of select=".//*[local-name()='additionalName'][@language='eng']"/> |
|
35 |
</FIELD> |
|
36 |
<FIELD name="websiteurl"> |
|
37 |
<xsl:value-of select=".//*[local-name()='repositoryURL']"/> |
|
38 |
</FIELD> |
|
39 |
<FIELD name="namespaceprefix"> |
|
40 |
<xsl:value-of select="dnet:generateNsPrefix('r3', dnet:md5(normalize-space(.//*[local-name()='re3data.orgIdentifier'])))"/> |
|
41 |
</FIELD> |
|
42 |
<FIELD name="collectedfrom"> |
|
43 |
<xsl:value-of select="$parentDatasourceId"/> |
|
44 |
</FIELD> |
|
45 |
<FIELD name="typology">datarepository::unknown</FIELD> |
|
46 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
47 |
<FIELD name="platform"> |
|
48 |
<xsl:value-of select=".//*[local-name()='software']/*[local-name()='softwareName']"/> |
|
49 |
</FIELD> |
|
50 |
<FIELD name="description"> |
|
51 |
<xsl:value-of select="./*[local-name()='description']"/> |
|
52 |
</FIELD> |
|
53 |
<FIELD name="releasestartdate" type="date"> |
|
54 |
<xsl:value-of select=".//*[local-name()='startDate']"/> |
|
55 |
</FIELD> |
|
56 |
<FIELD name="releaseenddate" type="date"> |
|
57 |
<xsl:value-of select=".//*[local-name()='endDate']"/> |
|
58 |
</FIELD> |
|
59 |
<FIELD name="missionstatementurl"> |
|
60 |
<xsl:value-of select=".//*[local-name()='missionStatementURL']"/> |
|
61 |
</FIELD> |
|
62 |
|
|
63 |
<xsl:choose> |
|
64 |
<xsl:when test=".//*[local-name()='providerType'] = 'dataProvider'"> |
|
65 |
<FIELD name="dataprovider" type="boolean">true</FIELD> |
|
66 |
</xsl:when> |
|
67 |
<xsl:otherwise> |
|
68 |
<FIELD name="dataprovider" type="boolean">false</FIELD> |
|
69 |
</xsl:otherwise> |
|
70 |
</xsl:choose> |
|
71 |
<xsl:choose> |
|
72 |
<xsl:when test=".//*[local-name()='providerType'] = 'serviceProvider'"> |
|
73 |
<FIELD name="serviceprovider" type="boolean">true</FIELD> |
|
74 |
</xsl:when> |
|
75 |
<xsl:otherwise> |
|
76 |
<FIELD name="serviceprovider" type="boolean">false</FIELD> |
|
77 |
</xsl:otherwise> |
|
78 |
</xsl:choose> |
|
79 |
<FIELD name="databaseaccesstype"> |
|
80 |
<xsl:value-of select=".//*[local-name()='databaseAccessType']"/> |
|
81 |
</FIELD> |
|
82 |
<FIELD name="datauploadtype"> |
|
83 |
<xsl:value-of select=".//*[local-name()='dataUploadType']"/> |
|
84 |
</FIELD> |
|
85 |
<FIELD name="databaseaccessrestriction"> |
|
86 |
<xsl:value-of select=".//*[local-name()='databaseAccessRestriction']"/> |
|
87 |
</FIELD> |
|
88 |
<FIELD name="datauploadrestriction"> |
|
89 |
<xsl:value-of select=".//*[local-name()='dataUploadRestriction']"/> |
|
90 |
</FIELD> |
|
91 |
<xsl:choose> |
|
92 |
<xsl:when test=".//*[local-name()='versioning'] = 'yes'"> |
|
93 |
<FIELD name="versioning" type="boolean">true</FIELD> |
|
94 |
</xsl:when> |
|
95 |
<xsl:otherwise> |
|
96 |
<FIELD name="versioning" type="boolean">false</FIELD> |
|
97 |
</xsl:otherwise> |
|
98 |
</xsl:choose> |
|
99 |
<FIELD name="citationguidelineurl"> |
|
100 |
<xsl:value-of select=".//*[local-name()='citationGuidelineURL']"/> |
|
101 |
</FIELD> |
|
102 |
<FIELD name="qualitymanagementkind"> |
|
103 |
<xsl:value-of select=".//*[local-name()='qualityManagement']"/> |
|
104 |
</FIELD> |
|
105 |
<FIELD name="pidsystems"> |
|
106 |
<xsl:value-of select=".//*[local-name()='pidSystem']"/> |
|
107 |
</FIELD> |
|
108 |
<FIELD name="certificates"> |
|
109 |
<xsl:value-of select=".//*[local-name()='certificate']"/> |
|
110 |
</FIELD> |
|
111 |
<FIELD name="subjects"> |
|
112 |
<xsl:value-of select="normalize-space($subjects)"/> |
|
113 |
</FIELD> |
|
114 |
</ROW> |
|
115 |
|
|
116 |
<xsl:for-each select="//*[local-name()='api']"> |
|
117 |
<xsl:variable name="apiId" select="concat('api_________::', $dsId, '::', position())"/> |
|
118 |
<xsl:variable name="baseURL" select="normalize-space(.)"/> |
|
119 |
<ROW table="dsm_api"> |
|
120 |
<FIELD name="_dnet_resource_identifier_"> |
|
121 |
<xsl:value-of select="$apiId"/> |
|
122 |
</FIELD> |
|
123 |
<FIELD name="id"> |
|
124 |
<xsl:value-of select="$apiId"/> |
|
125 |
</FIELD> |
|
126 |
<FIELD name="protocol"> |
|
127 |
<xsl:value-of select="normalize-space(@apiType)"/> |
|
128 |
</FIELD> |
|
129 |
<FIELD name="datasource"> |
|
130 |
<xsl:value-of select="$dsId"/> |
|
131 |
</FIELD> |
|
132 |
<FIELD name="contentdescription">metadata</FIELD> |
|
133 |
<FIELD name="typology">datarepository::unknown</FIELD> |
|
134 |
|
|
135 |
<FIELD name="baseurl"> |
|
136 |
<xsl:value-of select="$baseURL"/> |
|
137 |
</FIELD> |
|
138 |
</ROW> |
|
139 |
|
|
140 |
<!-- CANNOT ASSUME THE FORMAT IS oai_dc |
|
141 |
<ROW table="dsm_apiparams"> |
|
142 |
<FIELD name="api"> |
|
143 |
<xsl:value-of select="$apiId"/> |
|
144 |
</FIELD> |
|
145 |
<FIELD name="param">format</FIELD> |
|
146 |
<FIELD name="value">oai_dc</FIELD> |
|
147 |
</ROW> |
|
148 |
--> |
|
149 |
</xsl:for-each> |
|
150 |
|
|
151 |
<xsl:for-each select="//*[local-name()='institution']"> |
|
152 |
<xsl:variable name="orgId" select="concat($namespacePrefix, '::', dnet:md5(normalize-space(./*[local-name()='institutionName'])))"/> |
|
153 |
<ROW table="dsm_organizations"> |
|
154 |
<FIELD name="_dnet_resource_identifier_"> |
|
155 |
<xsl:value-of select="$orgId"/> |
|
156 |
</FIELD> |
|
157 |
<FIELD name="id"> |
|
158 |
<xsl:value-of select="$orgId"/> |
|
159 |
</FIELD> |
|
160 |
<FIELD name="legalname"> |
|
161 |
<xsl:value-of select="./*[local-name()='institutionName']"/> |
|
162 |
</FIELD> |
|
163 |
<FIELD name="legalshortname"> |
|
164 |
<xsl:value-of select="./*[local-name()='institutionAdditionalName'][1]"/> |
|
165 |
</FIELD> |
|
166 |
<FIELD name="websiteurl"> |
|
167 |
<xsl:choose> |
|
168 |
<xsl:when test="starts-with(normalize-space(./*[local-name()='institutionURL']), 'http')"> |
|
169 |
<xsl:value-of select="./*[local-name()='institutionURL']"/> |
|
170 |
</xsl:when> |
|
171 |
<xsl:when test="string-length(normalize-space(./*[local-name()='institutionURL'])) > 0"> |
|
172 |
<xsl:value-of select="concat('http://', normalize-space(./*[local-name()='institutionURL']))"/> |
|
173 |
</xsl:when> |
|
174 |
</xsl:choose> |
|
175 |
</FIELD> |
|
176 |
<FIELD name="country"> |
|
177 |
<xsl:value-of select="./*[local-name()='institutionCountry']"/> |
|
178 |
</FIELD> |
|
179 |
<FIELD name="collectedfrom"> |
|
180 |
<xsl:value-of select="$parentDatasourceId"/> |
|
181 |
</FIELD> |
|
182 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
183 |
</ROW> |
|
184 |
|
|
185 |
<ROW table="dsm_datasource_organization"> |
|
186 |
<FIELD name="_dnet_resource_identifier_"> |
|
187 |
<xsl:value-of select="concat($dsId, '@@', $orgId)"/> |
|
188 |
</FIELD> |
|
189 |
<FIELD name="datasource"> |
|
190 |
<xsl:value-of select="$dsId"/> |
|
191 |
</FIELD> |
|
192 |
<FIELD name="organization"> |
|
193 |
<xsl:value-of select="$orgId"/> |
|
194 |
</FIELD> |
|
195 |
</ROW> |
|
196 |
</xsl:for-each> |
|
197 |
|
|
198 |
</ROWS> |
|
199 |
</metadata> |
|
200 |
</record> |
|
201 |
</xsl:template> |
|
202 |
</xsl:stylesheet> |
|
203 |
|
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/datasources/re3data2db.xml | ||
---|---|---|
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 |
<?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() > 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'])) > 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> |
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 |
<?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" version="1.0"> |
|
19 |
|
|
20 |
<xsl:param name="varDataSourceId"/> |
|
21 |
<xsl:variable name="namespacePrefix" select="string('opendoar____')"/> |
|
22 |
|
|
23 |
<xsl:template match="/"> |
|
24 |
<record> |
|
25 |
|
|
26 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
27 |
<metadata> |
|
28 |
<xsl:variable name="rid" select="normalize-space(//repository/@rID)"/> |
|
29 |
<xsl:variable name="datasourceId" select="concat($namespacePrefix, '::', $rid)"/> |
|
30 |
<xsl:variable name="apiId" select="concat('api_________::', $datasourceId, '::0')"/> |
|
31 |
<xsl:variable name="oUrl" select="normalize-space(//oUrl)"/> |
|
32 |
<xsl:variable name="oName" select="normalize-space(//oName)"/> |
|
33 |
<xsl:variable name="organizationId" select="translate(concat($namespacePrefix, '::', $oName), ' ', '_')"/> |
|
34 |
<xsl:variable name="repositoryType"> |
|
35 |
<xsl:choose> |
|
36 |
<xsl:when test="normalize-space(//repositoryType) = 'Institutional'"> |
|
37 |
<xsl:value-of select="string('pubsrepository::institutional')"/> |
|
38 |
</xsl:when> |
|
39 |
<xsl:when test="normalize-space(//repositoryType) = 'Disciplinary'"> |
|
40 |
<xsl:value-of select="string('pubsrepository::thematic')"/> |
|
41 |
</xsl:when> |
|
42 |
<xsl:when test="normalize-space(//repositoryType) = 'Aggregating'"> |
|
43 |
<xsl:value-of select="string('aggregator::pubsrepository::unknown')"/> |
|
44 |
</xsl:when> |
|
45 |
<xsl:otherwise> |
|
46 |
<xsl:value-of select="string('pubsrepository::unknown')"/> |
|
47 |
</xsl:otherwise> |
|
48 |
</xsl:choose> |
|
49 |
</xsl:variable> |
|
50 |
|
|
51 |
<xsl:variable name="contenttypes"> |
|
52 |
<xsl:for-each select=".//contentType"> |
|
53 |
<xsl:if test="position() > 1"> - </xsl:if> |
|
54 |
<xsl:value-of select="."/> |
|
55 |
</xsl:for-each> |
|
56 |
</xsl:variable> |
|
57 |
<xsl:variable name="languages"> |
|
58 |
<xsl:for-each select=".//lName"> |
|
59 |
<xsl:if test="position() > 1">, </xsl:if> |
|
60 |
<xsl:value-of select="."/> |
|
61 |
</xsl:for-each> |
|
62 |
</xsl:variable> |
|
63 |
|
|
64 |
<xsl:variable name="subjects"> |
|
65 |
<xsl:for-each select=".//clTitle"> |
|
66 |
<xsl:if test="position() > 1"> @@ </xsl:if> |
|
67 |
<xsl:value-of select="."/> |
|
68 |
</xsl:for-each> |
|
69 |
</xsl:variable> |
|
70 |
|
|
71 |
<ROWS> |
|
72 |
<ROW table="dsm_datasources"> |
|
73 |
<FIELD name="_dnet_resource_identifier_"> |
|
74 |
<xsl:value-of select="$datasourceId"/> |
|
75 |
</FIELD> |
|
76 |
<FIELD name="id"> |
|
77 |
<xsl:value-of select="$datasourceId"/> |
|
78 |
</FIELD> |
|
79 |
<FIELD name="officialname"> |
|
80 |
<xsl:value-of select="normalize-space(//rName)"/> |
|
81 |
</FIELD> |
|
82 |
<FIELD name="englishname"> |
|
83 |
<xsl:value-of select="normalize-space(//rAcronym)"/> |
|
84 |
</FIELD> |
|
85 |
<FIELD name="websiteurl"> |
|
86 |
<xsl:value-of select="normalize-space(//rUrl)"/> |
|
87 |
</FIELD> |
|
88 |
<FIELD name="contactemail"> |
|
89 |
<xsl:value-of select="normalize-space(//pEmail)"/> |
|
90 |
</FIELD> |
|
91 |
<FIELD name="latitude" type="float"> |
|
92 |
<xsl:value-of select="normalize-space(//paLatitude)"/> |
|
93 |
</FIELD> |
|
94 |
<FIELD name="longitude" type="float"> |
|
95 |
<xsl:value-of select="normalize-space(//paLongitude)"/> |
|
96 |
</FIELD> |
|
97 |
<FIELD name="namespaceprefix"> |
|
98 |
<xsl:value-of select="dnet:generateNsPrefix('od', $rid)"/> |
|
99 |
</FIELD> |
|
100 |
<FIELD name="languages"> |
|
101 |
<xsl:value-of select="normalize-space($languages)"/> |
|
102 |
</FIELD> |
|
103 |
<FIELD name="od_contenttypes"> |
|
104 |
<xsl:value-of select="normalize-space($contenttypes)"/> |
|
105 |
</FIELD> |
|
106 |
<FIELD name="collectedfrom"> |
|
107 |
<xsl:value-of select="$varDataSourceId"/> |
|
108 |
</FIELD> |
|
109 |
<FIELD name="typology"> |
|
110 |
<xsl:value-of select="$repositoryType"/> |
|
111 |
</FIELD> |
|
112 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
113 |
<FIELD name="platform"> |
|
114 |
<xsl:value-of select="normalize-space(//rSoftWareName)"/> |
|
115 |
</FIELD> |
|
116 |
<FIELD name="description"> |
|
117 |
<xsl:value-of select="normalize-space(//rDescription)"/> |
|
118 |
</FIELD> |
|
119 |
|
|
120 |
<FIELD name="subjects"> |
|
121 |
<xsl:value-of select="normalize-space($subjects)"/> |
|
122 |
</FIELD> |
|
123 |
</ROW> |
|
124 |
|
|
125 |
<ROW table="dsm_api"> |
|
126 |
<FIELD name="_dnet_resource_identifier_"> |
|
127 |
<xsl:value-of select="$apiId"/> |
|
128 |
</FIELD> |
|
129 |
<FIELD name="id"> |
|
130 |
<xsl:value-of select="$apiId"/> |
|
131 |
</FIELD> |
|
132 |
<FIELD name="protocol">oai</FIELD> |
|
133 |
<FIELD name="datasource"> |
|
134 |
<xsl:value-of select="$datasourceId"/> |
|
135 |
</FIELD> |
|
136 |
<FIELD name="contentdescription">metadata</FIELD> |
|
137 |
<FIELD name="typology"> |
|
138 |
<xsl:value-of select="$repositoryType"/> |
|
139 |
</FIELD> |
|
140 |
<FIELD name="baseurl"> |
|
141 |
<xsl:value-of select="normalize-space(//rOaiBaseUrl)"/> |
|
142 |
</FIELD> |
|
143 |
<FIELD name="metadata_identifier_path">//*[local-name()='header']/*[local-name()='identifier']</FIELD> |
|
144 |
</ROW> |
|
145 |
|
|
146 |
<ROW table="dsm_apiparams"> |
|
147 |
<FIELD name="_dnet_resource_identifier_"> |
|
148 |
<xsl:value-of select="concat($apiId, '@@format')"/> |
|
149 |
</FIELD> |
|
150 |
<FIELD name="api"> |
|
151 |
<xsl:value-of select="$apiId"/> |
|
152 |
</FIELD> |
|
153 |
<FIELD name="param">format</FIELD> |
|
154 |
<FIELD name="value">oai_dc</FIELD> |
|
155 |
</ROW> |
|
156 |
|
|
157 |
<ROW table="dsm_organizations"> |
|
158 |
<FIELD name="_dnet_resource_identifier_"> |
|
159 |
<xsl:value-of select="$organizationId"/> |
|
160 |
</FIELD> |
|
161 |
<FIELD name="id"> |
|
162 |
<xsl:value-of select="$organizationId"/> |
|
163 |
</FIELD> |
|
164 |
<FIELD name="legalname"> |
|
165 |
<xsl:value-of select="$oName"/> |
|
166 |
</FIELD> |
|
167 |
<FIELD name="legalshortname"> |
|
168 |
<xsl:value-of select="normalize-space(//oAcronym)"/> |
|
169 |
</FIELD> |
|
170 |
<FIELD name="websiteurl"> |
|
171 |
<xsl:choose> |
|
172 |
<xsl:when test="starts-with(normalize-space($oUrl), 'http')"> |
|
173 |
<xsl:value-of select="normalize-space($oUrl)"/> |
|
174 |
</xsl:when> |
|
175 |
<xsl:when test="string-length(normalize-space($oUrl)) > 0"> |
|
176 |
<xsl:value-of select="concat('http://', normalize-space($oUrl))"/> |
|
177 |
</xsl:when> |
|
178 |
</xsl:choose> |
|
179 |
</FIELD> |
|
180 |
|
|
181 |
<FIELD name="country"> |
|
182 |
<xsl:choose> |
|
183 |
<xsl:when test="normalize-space(//cIsoCode) = 'GB'">UK</xsl:when> |
|
184 |
<xsl:otherwise> |
|
185 |
<xsl:value-of select="normalize-space(//cIsoCode)"></xsl:value-of> |
|
186 |
</xsl:otherwise> |
|
187 |
</xsl:choose> |
|
188 |
</FIELD> |
|
189 |
|
|
190 |
<FIELD name="collectedfrom"> |
|
191 |
<xsl:value-of select="$varDataSourceId"/> |
|
192 |
</FIELD> |
|
193 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
194 |
</ROW> |
|
195 |
|
|
196 |
<ROW table="dsm_datasource_organization"> |
|
197 |
<FIELD name="_dnet_resource_identifier_"> |
|
198 |
<xsl:value-of select="concat($datasourceId, '@@', $organizationId)"/> |
|
199 |
</FIELD> |
|
200 |
<FIELD name="datasource"> |
|
201 |
<xsl:value-of select="$datasourceId"/> |
|
202 |
</FIELD> |
|
203 |
<FIELD name="organization"> |
|
204 |
<xsl:value-of select="$organizationId"/> |
|
205 |
</FIELD> |
|
206 |
</ROW> |
|
207 |
|
|
208 |
</ROWS> |
|
209 |
</metadata> |
|
210 |
</record> |
|
211 |
</xsl:template> |
|
212 |
|
|
213 |
</xsl:stylesheet> |
|
214 |
|
|
215 |
]]> |
|
216 |
</CODE> |
|
217 |
</SCRIPT> |
|
218 |
</CONFIGURATION> |
|
219 |
<STATUS/> |
|
220 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
221 |
</BODY> |
|
222 |
</RESOURCE_PROFILE> |
Also available in: Unified diff
Mappings for re3data and opendoar are now TDS rules and not anymore xslt in the classpath