Revision 52636
Added by Alessia Bardi over 6 years ago
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" ?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
<parent> |
|
4 |
<groupId>eu.dnetlib</groupId> |
|
5 |
<artifactId>dnet45-parent</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
<relativePath /> |
|
8 |
</parent> |
|
9 |
<modelVersion>4.0.0</modelVersion> |
|
10 |
<groupId>eu.dnetlib</groupId> |
|
11 |
<artifactId>dnet-openaireplus-profiles</artifactId> |
|
12 |
<packaging>jar</packaging> |
|
13 |
<version>1.0.25</version> |
|
14 |
<scm> |
|
15 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25</developerConnection> |
|
16 |
</scm> |
|
17 |
|
|
18 |
<dependencies> |
|
19 |
|
|
20 |
</dependencies> |
|
21 |
</project> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/corda_2_db.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="b2f93c95-f4e7-447e-9048-1a651630670e_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2018-06-04T11:15:30+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<IMPORTED/> |
|
12 |
<SCRIPT> |
|
13 |
<TITLE>CORDA to DB</TITLE> |
|
14 |
<CODE> |
|
15 |
<![CDATA[ |
|
16 |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|
17 |
|
|
18 |
<xsl:param name="varDataSourceId"/> |
|
19 |
|
|
20 |
<xsl:template name="dateCorda"> |
|
21 |
<xsl:param name="datename"/> |
|
22 |
<xsl:param name="datevalue"/> |
|
23 |
<FIELD name="{$datename}" type="date" format="dd-MMM-yyyy"> |
|
24 |
<xsl:value-of select="concat(substring($datevalue, 1, 2),'-',substring($datevalue,3,3),'-',substring($datevalue,6,4))"/> |
|
25 |
</FIELD> |
|
26 |
</xsl:template> |
|
27 |
|
|
28 |
<xsl:variable name="namespacePrefix" select="string('ec__________')"/> |
|
29 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')"/> |
|
30 |
|
|
31 |
<xsl:template match="/"> |
|
32 |
<record> |
|
33 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
34 |
<metadata> |
|
35 |
<ROWS> |
|
36 |
<xsl:for-each select="//Project"> |
|
37 |
|
|
38 |
<xsl:variable name="specificName"> |
|
39 |
<xsl:choose> |
|
40 |
<xsl:when test="normalize-space(./ProjectSpecificProgram)"> |
|
41 |
<xsl:value-of select="normalize-space(./ProjectSpecificProgram)"/> |
|
42 |
</xsl:when> |
|
43 |
<xsl:otherwise> |
|
44 |
<xsl:value-of select="string('UNKNOWN')"/> |
|
45 |
</xsl:otherwise> |
|
46 |
</xsl:choose> |
|
47 |
</xsl:variable> |
|
48 |
|
|
49 |
<xsl:variable name="specificDesc" select="./ProjectSpecificProgramDescr"/> |
|
50 |
<xsl:variable name="specificId" select="normalize-space(concat($funderID, '::FP7::', $specificName))"/> |
|
51 |
|
|
52 |
<xsl:variable name="projectProgramName"> |
|
53 |
<xsl:choose> |
|
54 |
<xsl:when test="normalize-space(./ProjectProgram)"> |
|
55 |
<xsl:value-of select="normalize-space(./ProjectProgram)"/> |
|
56 |
</xsl:when> |
|
57 |
<xsl:otherwise> |
|
58 |
<xsl:value-of select="string('UNKNOWN')"/> |
|
59 |
</xsl:otherwise> |
|
60 |
</xsl:choose> |
|
61 |
</xsl:variable> |
|
62 |
|
|
63 |
<xsl:variable name="projectProgramDesc" select="./ProjectProgramDescr"/> |
|
64 |
<xsl:variable name="projectProgramId" select="concat($funderID, '::FP7::', $specificName, '::', $projectProgramName)"/> |
|
65 |
<xsl:variable name="projectId" select="concat('corda_______::', normalize-space(./ProjectId))"/> |
|
66 |
|
|
67 |
|
|
68 |
<ROW table="projects"> |
|
69 |
<FIELD name="_dnet_resource_identifier_"> |
|
70 |
<xsl:value-of select="$projectId"/> |
|
71 |
</FIELD> |
|
72 |
<FIELD name="id"> |
|
73 |
<xsl:value-of select="$projectId"/> |
|
74 |
</FIELD> |
|
75 |
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD> |
|
76 |
<FIELD name="code"> |
|
77 |
<xsl:value-of select="./ProjectId"/> |
|
78 |
</FIELD> |
|
79 |
<FIELD name="acronym"> |
|
80 |
<xsl:value-of select="./ProjectAcronym"/> |
|
81 |
</FIELD> |
|
82 |
<FIELD name="title"> |
|
83 |
<xsl:value-of select="./ProjectTitle"/> |
|
84 |
</FIELD> |
|
85 |
<xsl:call-template name="dateCorda"> |
|
86 |
<xsl:with-param name="datename">startdate</xsl:with-param> |
|
87 |
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param> |
|
88 |
</xsl:call-template> |
|
89 |
<xsl:call-template name="dateCorda"> |
|
90 |
<xsl:with-param name="datename">enddate</xsl:with-param> |
|
91 |
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param> |
|
92 |
</xsl:call-template> |
|
93 |
<FIELD name="call_identifier"> |
|
94 |
<xsl:value-of select="./ProjectCallIdentifier"/> |
|
95 |
</FIELD> |
|
96 |
<FIELD name="ec_sc39" type="boolean"> |
|
97 |
<xsl:value-of select="./SpecialClause39"/> |
|
98 |
</FIELD> |
|
99 |
<FIELD name="oa_mandate_for_publications" type="boolean"> |
|
100 |
<xsl:value-of select="./SpecialClause39"/> |
|
101 |
</FIELD> |
|
102 |
<FIELD name="collectedfrom"> |
|
103 |
<xsl:value-of select="$varDataSourceId"/> |
|
104 |
</FIELD> |
|
105 |
<FIELD name="contracttypeclass"> |
|
106 |
<xsl:value-of select="./ProjectFundingScheme"/> |
|
107 |
</FIELD> |
|
108 |
<FIELD name="contracttypescheme">ec:FP7contractTypes</FIELD> |
|
109 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
110 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
111 |
<FIELD name="websiteurl"> |
|
112 |
<xsl:value-of select="./ProjectInternetAddress"/> |
|
113 |
</FIELD> |
|
114 |
<FIELD name="optional1"> |
|
115 |
<xsl:value-of select="./ProjectSubFundingScheme"/> |
|
116 |
</FIELD> |
|
117 |
<FIELD name="optional2"> |
|
118 |
<xsl:value-of select="./ProjectCallWebpageUrl"/> |
|
119 |
</FIELD> |
|
120 |
<xsl:variable name="personSurname" select="normalize-space(./CoordinatorContactPerson/PersonLastName)"/> |
|
121 |
<xsl:variable name="personFirstName" select="normalize-space(./CoordinatorContactPerson/PersonFirstName)"/> |
|
122 |
<xsl:variable name="contactfullname"> |
|
123 |
<xsl:choose> |
|
124 |
<xsl:when test="string-length($personFirstName) > 0 and string-length($personSurname) > 0"> |
|
125 |
<xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/> |
|
126 |
</xsl:when> |
|
127 |
<xsl:when test="string-length($personFirstName) > 0"> |
|
128 |
<xsl:value-of select="$personFirstName"/> |
|
129 |
</xsl:when> |
|
130 |
<xsl:when test="string-length($personSurname) > 0"> |
|
131 |
<xsl:value-of select="$personSurname"/> |
|
132 |
</xsl:when> |
|
133 |
<xsl:otherwise> |
|
134 |
<xsl:value-of select="''"/> |
|
135 |
</xsl:otherwise> |
|
136 |
</xsl:choose> |
|
137 |
</xsl:variable> |
|
138 |
<xsl:if test="string-length($contactfullname) > 0"> |
|
139 |
<FIELD name="contactfullname"> |
|
140 |
<xsl:value-of select="$contactfullname"/> |
|
141 |
</FIELD> |
|
142 |
</xsl:if> |
|
143 |
<xsl:variable name="contactfax" select="normalize-space(./CoordinatorContactPerson/ContactFax)"/> |
|
144 |
<xsl:if test="string-length($contactfax) > 0"> |
|
145 |
<FIELD name="contactfax"> |
|
146 |
<xsl:value-of select="$contactfax"/> |
|
147 |
</FIELD> |
|
148 |
</xsl:if> |
|
149 |
<xsl:variable name="contactphone" select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/> |
|
150 |
<xsl:if test="string-length($contactphone) > 0"> |
|
151 |
<FIELD name="contactphone"> |
|
152 |
<xsl:value-of select="$contactphone"/> |
|
153 |
</FIELD> |
|
154 |
</xsl:if> |
|
155 |
<xsl:variable name="contactemail" select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/> |
|
156 |
<xsl:if test="string-length($contactemail) > 0"> |
|
157 |
<FIELD name="contactemail"> |
|
158 |
<xsl:value-of select="$contactemail"/> |
|
159 |
</FIELD> |
|
160 |
</xsl:if> |
|
161 |
</ROW> |
|
162 |
|
|
163 |
<ROW table="project_fundingpath"> |
|
164 |
<FIELD name="_dnet_resource_identifier_"> |
|
165 |
<xsl:value-of select="concat($projectProgramId, '@@', $projectId)"/> |
|
166 |
</FIELD> |
|
167 |
<FIELD name="funding"> |
|
168 |
<xsl:value-of select="$projectProgramId"/> |
|
169 |
</FIELD> |
|
170 |
<FIELD name="project"> |
|
171 |
<xsl:value-of select="$projectId"/> |
|
172 |
</FIELD> |
|
173 |
<xsl:call-template name="dateCorda"> |
|
174 |
<xsl:with-param name="datename">startdate</xsl:with-param> |
|
175 |
<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param> |
|
176 |
</xsl:call-template> |
|
177 |
<xsl:call-template name="dateCorda"> |
|
178 |
<xsl:with-param name="datename">enddate</xsl:with-param> |
|
179 |
<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param> |
|
180 |
</xsl:call-template> |
|
181 |
<FIELD name="semanticclass"> |
|
182 |
<xsl:value-of select="./ProjectFundingScheme"/> |
|
183 |
</FIELD> |
|
184 |
<FIELD name="semanticscheme">ec:FP7contractTypes</FIELD> |
|
185 |
</ROW> |
|
186 |
</xsl:for-each> |
|
187 |
|
|
188 |
<xsl:for-each select="//OrganisationParticipant"> |
|
189 |
<xsl:variable name="organizationId" select="concat('corda_______::', ./OrganisationPIC)"/> |
|
190 |
<xsl:variable name="projectId" select="concat('corda_______::', normalize-space(../ProjectId))"/> |
|
191 |
<xsl:variable name="whitelist" select="'0123456789'"/> |
|
192 |
<ROW table="dsm_organizations"> |
|
193 |
<FIELD name="_dnet_resource_identifier_"> |
|
194 |
<xsl:value-of select="$organizationId"/> |
|
195 |
</FIELD> |
|
196 |
<FIELD name="id"> |
|
197 |
<xsl:value-of select="$organizationId"/> |
|
198 |
</FIELD> |
|
199 |
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD> |
|
200 |
<FIELD name="legalshortname"> |
|
201 |
<xsl:value-of select="./OrganisationShortName"/> |
|
202 |
</FIELD> |
|
203 |
<FIELD name="legalname"> |
|
204 |
<xsl:value-of select="./OrganisationLegalName"/> |
|
205 |
</FIELD> |
|
206 |
<FIELD name="websiteurl"> |
|
207 |
<xsl:choose> |
|
208 |
<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')"> |
|
209 |
<xsl:value-of select="./OrganisationWebPage"/> |
|
210 |
</xsl:when> |
|
211 |
<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) > 0"> |
|
212 |
<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/> |
|
213 |
</xsl:when> |
|
214 |
</xsl:choose> |
|
215 |
</FIELD> |
|
216 |
<FIELD name="ec_legalbody" type="boolean"> |
|
217 |
<xsl:value-of select="./PublicBody"/> |
|
218 |
</FIELD> |
|
219 |
<FIELD name="ec_legalperson" type="boolean"> |
|
220 |
<xsl:value-of select="./LegalPerson"/> |
|
221 |
</FIELD> |
|
222 |
<FIELD name="ec_nonprofit" type="boolean"> |
|
223 |
<xsl:value-of select="./NonProfit"/> |
|
224 |
</FIELD> |
|
225 |
<FIELD name="ec_researchorganization" type="boolean"> |
|
226 |
<xsl:value-of select="./ResearchOrganisation"/> |
|
227 |
</FIELD> |
|
228 |
<FIELD name="ec_highereducation" type="boolean"> |
|
229 |
<xsl:value-of select="./HigherEducation"/> |
|
230 |
</FIELD> |
|
231 |
<FIELD name="ec_internationalorganizationeurinterests" type="boolean"> |
|
232 |
<xsl:value-of select="./InternationalOrgEurInterest"/> |
|
233 |
</FIELD> |
|
234 |
<FIELD name="ec_internationalorganization" type="boolean"> |
|
235 |
<xsl:value-of select="./InternationalOrgEurInterest"/> |
|
236 |
</FIELD> |
|
237 |
<FIELD name="ec_enterprise" type="boolean"> |
|
238 |
<xsl:value-of select="./Enterprise"/> |
|
239 |
</FIELD> |
|
240 |
<FIELD name="ec_smevalidated" type="boolean"> |
|
241 |
<xsl:value-of select="./SMEValidated"/> |
|
242 |
</FIELD> |
|
243 |
<FIELD name="countryclass"> |
|
244 |
<xsl:value-of select="./OrganisationCountry"/> |
|
245 |
</FIELD> |
|
246 |
<FIELD name="countryscheme">dnet:countries</FIELD> |
|
247 |
<FIELD name="collectedfrom"> |
|
248 |
<xsl:value-of select="$varDataSourceId"/> |
|
249 |
</FIELD> |
|
250 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
251 |
|
|
252 |
<FIELD name="trust" type="float"> |
|
253 |
<xsl:value-of select="0.8"/> |
|
254 |
</FIELD> |
|
255 |
</ROW> |
|
256 |
|
|
257 |
<ROW table="project_organization"> |
|
258 |
<FIELD name="_dnet_resource_identifier_"> |
|
259 |
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/> |
|
260 |
</FIELD> |
|
261 |
<xsl:choose> |
|
262 |
<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) > 0"> |
|
263 |
<FIELD name="participantnumber" type="int">9999</FIELD> |
|
264 |
</xsl:when> |
|
265 |
<xsl:otherwise> |
|
266 |
<FIELD name="participantnumber" type="int"> |
|
267 |
<xsl:value-of select="./ParticipantOrder"/> |
|
268 |
</FIELD> |
|
269 |
</xsl:otherwise> |
|
270 |
</xsl:choose> |
|
271 |
<FIELD name="project"> |
|
272 |
<xsl:value-of select="$projectId"/> |
|
273 |
</FIELD> |
|
274 |
<FIELD name="resporganization"> |
|
275 |
<xsl:value-of select="$organizationId"/> |
|
276 |
</FIELD> |
|
277 |
<xsl:choose> |
|
278 |
<xsl:when test="./ParticipantOrder = 1"> |
|
279 |
<FIELD name="semanticclass">coordinator</FIELD> |
|
280 |
</xsl:when> |
|
281 |
<xsl:otherwise> |
|
282 |
<FIELD name="semanticclass">participant</FIELD> |
|
283 |
</xsl:otherwise> |
|
284 |
</xsl:choose> |
|
285 |
</ROW> |
|
286 |
</xsl:for-each> |
|
287 |
</ROWS> |
|
288 |
</metadata> |
|
289 |
</record> |
|
290 |
</xsl:template> |
|
291 |
</xsl:stylesheet> |
|
292 |
]]> |
|
293 |
</CODE> |
|
294 |
</SCRIPT> |
|
295 |
</CONFIGURATION> |
|
296 |
<STATUS/> |
|
297 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
298 |
</BODY> |
|
299 |
</RESOURCE_PROFILE> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/2hbase/projectorganization_2_hbase.xsl | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="621df4c6-ff71-4c1c-82bf-67a64c850be6_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<SOURCE_METADATA_FORMAT name="dbmf" layout="store" interpretation="cleaned"/> |
|
12 |
<SINK_METADATA_FORMAT name="oaf_hbase"/> |
|
13 |
<IMPORTED/> |
|
14 |
<SCRIPT> |
|
15 |
<TITLE>xslt_mapping_projectOrganization2hbase</TITLE> |
|
16 |
<CODE> |
|
17 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
18 |
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
19 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oaa="http://namespace.openaire.eu/oaa" |
|
20 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dnet="eu.dnetlib.data.transform.xml.DbmfToHbaseXsltFunctions" |
|
21 |
version="1.0"> |
|
22 |
|
|
23 |
<xsl:output omit-xml-declaration="yes" indent="yes"/> |
|
24 |
|
|
25 |
<xsl:template match="/"> |
|
26 |
|
|
27 |
<xsl:variable name="projectId" select="dnet:oafSplitId('project', //FIELD[@name = 'project'])"/> |
|
28 |
<xsl:variable name="organizationId" select="dnet:oafSplitId('organization', //FIELD[@name = 'resporganization'])"/> |
|
29 |
|
|
30 |
<ROWS> |
|
31 |
<xsl:if test="string-length($projectId) > 0 and string-length($organizationId) > 0"> |
|
32 |
|
|
33 |
<xsl:variable name="projectorganization" |
|
34 |
select="dnet:oafRel('projectOrganization', $projectId, $organizationId, //FIELD[not(@isNull)], 'hasParticipant', 'dnet:project_organization_relations')"/> |
|
35 |
<xsl:variable name="organizationproject" |
|
36 |
select="dnet:oafRel('projectOrganization', $organizationId, $projectId, //FIELD[not(@isNull)], 'isParticipant', 'dnet:project_organization_relations')"/> |
|
37 |
|
|
38 |
<ROW key="{$projectId}" columnFamily="projectOrganization_participation_hasParticipant"> |
|
39 |
<QUALIFIER name="{$organizationId}" type="base64"> |
|
40 |
<xsl:value-of select="$projectorganization"/> |
|
41 |
</QUALIFIER> |
|
42 |
</ROW> |
|
43 |
<ROW key="{$organizationId}" columnFamily="projectOrganization_participation_isParticipant"> |
|
44 |
<QUALIFIER name="{$projectId}" type="base64"> |
|
45 |
<xsl:value-of select="$organizationproject"/> |
|
46 |
</QUALIFIER> |
|
47 |
</ROW> |
|
48 |
</xsl:if> |
|
49 |
</ROWS> |
|
50 |
|
|
51 |
</xsl:template> |
|
52 |
|
|
53 |
</xsl:stylesheet> |
|
54 |
</CODE> |
|
55 |
</SCRIPT> |
|
56 |
</CONFIGURATION> |
|
57 |
<STATUS/> |
|
58 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
59 |
</BODY> |
|
60 |
</RESOURCE_PROFILE> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/tara_2_db.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="dc7d4798-a56b-496e-b330-7f98b90cb742_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2018-06-04T11:15:30+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<IMPORTED/> |
|
12 |
<SCRIPT> |
|
13 |
<TITLE>TARA to DB</TITLE> |
|
14 |
<CODE> |
|
15 |
<![CDATA[ |
|
16 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
17 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
|
18 |
exclude-result-prefixes="xs" version="2.0"> |
|
19 |
|
|
20 |
<xsl:param name="varDataSourceId"/> |
|
21 |
<xsl:variable name="namespacePrefix" select="string('taraexp_____')"/> |
|
22 |
|
|
23 |
<xsl:template match="/"> |
|
24 |
|
|
25 |
<xsl:variable name="funderId" select="string('taraexp_____::tara')"/> |
|
26 |
|
|
27 |
<record> |
|
28 |
|
|
29 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
30 |
|
|
31 |
<metadata> |
|
32 |
<ROWS> |
|
33 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='PROJECT ID']))"/> |
|
34 |
<xsl:variable name="startDate" select=".//column[@name='START DATE']"/> |
|
35 |
<xsl:variable name="endDate" select=".//column[@name='END DATE']"/> |
|
36 |
|
|
37 |
<ROW table="projects"> |
|
38 |
<FIELD name="_dnet_resource_identifier_"> |
|
39 |
<xsl:value-of select="$projectId"/> |
|
40 |
</FIELD> |
|
41 |
<FIELD name="id"> |
|
42 |
<xsl:value-of select="$projectId"/> |
|
43 |
</FIELD> |
|
44 |
<FIELD name="code"> |
|
45 |
<xsl:value-of select=".//column[@name='PROJECT ID']"/> |
|
46 |
</FIELD> |
|
47 |
<FIELD name="title"> |
|
48 |
<xsl:value-of select=".//column[@name='PROJECT TITLE']"/> |
|
49 |
</FIELD> |
|
50 |
<FIELD name="jsonextrainfo"> |
|
51 |
<xsl:value-of select=".//column[@name='DM KEYWORDS']"/> |
|
52 |
</FIELD> |
|
53 |
<FIELD name="startdate" type="date" format="yyyy"> |
|
54 |
<xsl:value-of select="$startDate"/> |
|
55 |
</FIELD> |
|
56 |
<FIELD name="enddate" type="date" format="yyyy"> |
|
57 |
<xsl:value-of select="$endDate"/> |
|
58 |
</FIELD> |
|
59 |
<FIELD name="collectedfrom"> |
|
60 |
<xsl:value-of select="$varDataSourceId"/> |
|
61 |
</FIELD> |
|
62 |
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD> |
|
63 |
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD> |
|
64 |
</ROW> |
|
65 |
|
|
66 |
<ROW table="project_fundingpath"> |
|
67 |
<FIELD name="_dnet_resource_identifier_"> |
|
68 |
<xsl:value-of select="concat($funderId, '@@', $projectId)"/> |
|
69 |
</FIELD> |
|
70 |
<FIELD name="funding"> |
|
71 |
<xsl:value-of select="$funderId"/> |
|
72 |
</FIELD> |
|
73 |
<FIELD name="project"> |
|
74 |
<xsl:value-of select="$projectId"/> |
|
75 |
</FIELD> |
|
76 |
<FIELD name="startdate" type="date" format="yyyy"> |
|
77 |
<xsl:value-of select="$startDate"/> |
|
78 |
</FIELD> |
|
79 |
<FIELD name="enddate" type="date" format="yyyy"> |
|
80 |
<xsl:value-of select="$endDate"/> |
|
81 |
</FIELD> |
|
82 |
</ROW> |
|
83 |
|
|
84 |
</ROWS> |
|
85 |
</metadata> |
|
86 |
</record> |
|
87 |
</xsl:template> |
|
88 |
|
|
89 |
</xsl:stylesheet> |
|
90 |
]]> |
|
91 |
</CODE> |
|
92 |
</SCRIPT> |
|
93 |
</CONFIGURATION> |
|
94 |
<STATUS/> |
|
95 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
96 |
</BODY> |
|
97 |
</RESOURCE_PROFILE> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/2hbase/oaf2hbase.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="43108eba-4b67-4d7a-8928-55ca09f1c8ff_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<SOURCE_METADATA_FORMAT name="oaf" layout="store" interpretation="cleaned"/> |
|
12 |
<SINK_METADATA_FORMAT name="oaf_hbase"/> |
|
13 |
<IMPORTED/> |
|
14 |
<SCRIPT> |
|
15 |
<TITLE>xslt_mapping_oaf2hbase</TITLE> |
|
16 |
<CODE> |
|
17 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
18 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dc="http://purl.org/dc/elements/1.1/" |
|
19 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
20 |
xmlns:dnet="eu.dnetlib.data.transform.xml.OafToHbaseXsltFunctions" |
|
21 |
xmlns:exslt="http://exslt.org/common" |
|
22 |
version="1.0" extension-element-prefixes="exslt" |
|
23 |
exclude-result-prefixes="xsl oaf dr dri dnet exslt"> |
|
24 |
|
|
25 |
<xsl:output omit-xml-declaration="yes" indent="yes"/> |
|
26 |
|
|
27 |
<xsl:param name="invisible" select="false()"/> |
|
28 |
<xsl:param name="trust" select="string('0.9')"/> |
|
29 |
<xsl:param name="provenance" select="string('sysimport:crosswalk:repository')"/> |
|
30 |
|
|
31 |
<xsl:template match="/*"> |
|
32 |
<xsl:variable name="about" select="/*[local-name() = 'record']/*[local-name() = 'about']"/> |
|
33 |
<xsl:variable name="dateofcollection" select="/*[local-name() = 'record']/*[local-name() = 'header']/*[local-name()='dateOfCollection' and text()][1]"/> |
|
34 |
<xsl:variable name="dateoftransformation" select="/*[local-name() = 'record']/*[local-name() = 'header']/*[local-name()='dateOfTransformation' and text()][1]"/> |
|
35 |
<xsl:variable name="metadata" select="exslt:node-set(/*[local-name() = 'record']/*[local-name()='metadata']/*)"/> |
|
36 |
<xsl:variable name="namespaceprefix"> |
|
37 |
<xsl:choose> |
|
38 |
|
|
39 |
<!-- TODO check namespaceprefix length is 12 --> |
|
40 |
<xsl:when test="string-length(//oaf:datasourceprefix) > 0"> |
|
41 |
<xsl:value-of select="//oaf:datasourceprefix"/> |
|
42 |
</xsl:when> |
|
43 |
<xsl:otherwise> |
|
44 |
<xsl:value-of select="unknown_"/> |
|
45 |
</xsl:otherwise> |
|
46 |
</xsl:choose> |
|
47 |
</xsl:variable> |
|
48 |
|
|
49 |
<xsl:choose> |
|
50 |
<!-- <xsl:when test="count($metadata) = 0 or string-length($namespaceprefix) = 0"> --> |
|
51 |
<xsl:when test="count($metadata) = 0"> |
|
52 |
<ROWS/> |
|
53 |
</xsl:when> |
|
54 |
<xsl:otherwise> |
|
55 |
|
|
56 |
<xsl:variable name="objIdentifier" select="//dri:objIdentifier"/> |
|
57 |
<xsl:variable name="resultId" select="dnet:oafSimpleId('result', //dri:objIdentifier)"/> |
|
58 |
|
|
59 |
<xsl:if test="string-length($resultId) > 0"> |
|
60 |
|
|
61 |
<xsl:variable name="cobjcategory" select="//dr:CobjCategory"/> |
|
62 |
<xsl:choose> |
|
63 |
<!-- check if we need to exclude datasets from an OAF MDStore--> |
|
64 |
<xsl:when test="$cobjcategory = '0021'"> |
|
65 |
<ROWS/> |
|
66 |
</xsl:when> |
|
67 |
<xsl:otherwise> |
|
68 |
<xsl:variable name="originalidTest" select="/*[local-name()='record']/*[local-name() = 'header']/*[local-name() = 'recordIdentifier']"/> |
|
69 |
<xsl:variable name="originalid"> |
|
70 |
<xsl:choose> |
|
71 |
<xsl:when test="contains($originalidTest, '::')"> |
|
72 |
<xsl:value-of select="substring-after($originalidTest, '::')"/> |
|
73 |
</xsl:when> |
|
74 |
<xsl:otherwise> |
|
75 |
<xsl:value-of select="$originalidTest"/> |
|
76 |
</xsl:otherwise> |
|
77 |
</xsl:choose> |
|
78 |
</xsl:variable> |
|
79 |
|
|
80 |
<xsl:variable name="result" |
|
81 |
select="dnet:oafResult($resultId, $invisible, $provenance, $trust, $about, $originalid, $dateofcollection, $dateoftransformation, $metadata)"/> |
|
82 |
|
|
83 |
<ROWS> |
|
84 |
<ROW key="{$resultId}" columnFamily="result"> |
|
85 |
<QUALIFIER name="body" type="base64"> |
|
86 |
<xsl:value-of select="$result"/> |
|
87 |
</QUALIFIER> |
|
88 |
</ROW> |
|
89 |
|
|
90 |
<xsl:for-each select="//*[local-name()='projectid']"> |
|
91 |
|
|
92 |
<xsl:variable name="projectId" select="dnet:oafSplitId('project', normalize-space(.))"/> |
|
93 |
|
|
94 |
<xsl:if test="string-length($projectId) > 0"> |
|
95 |
|
|
96 |
<xsl:variable name="resultproject" |
|
97 |
select="dnet:rel($resultId, $projectId, 'resultProject', 'outcome', 'isProducedBy', |
|
98 |
$metadata, $provenance, $trust, $about)"/> |
|
99 |
<xsl:variable name="projectresult" |
|
100 |
select="dnet:rel($projectId, $resultId, 'resultProject', 'outcome', 'produces', |
|
101 |
$metadata, $provenance, $trust, $about)"/> |
|
102 |
|
|
103 |
<ROW key="{$resultId}" columnFamily="resultProject_outcome_isProducedBy"> |
|
104 |
<QUALIFIER name="{$projectId}" type="base64"> |
|
105 |
<xsl:value-of select="$resultproject"/> |
|
106 |
</QUALIFIER> |
|
107 |
</ROW> |
|
108 |
<ROW key="{$projectId}" columnFamily="resultProject_outcome_produces"> |
|
109 |
<QUALIFIER name="{$resultId}" type="base64"> |
|
110 |
<xsl:value-of select="$projectresult"/> |
|
111 |
</QUALIFIER> |
|
112 |
</ROW> |
|
113 |
</xsl:if> |
|
114 |
</xsl:for-each> |
|
115 |
|
|
116 |
<xsl:for-each select="//*[local-name()='relatedDataset']"> |
|
117 |
|
|
118 |
<!-- relatedDataset ids must be in the openaire format --> |
|
119 |
<xsl:variable name="datasetId" select="dnet:oafSimpleId('result', normalize-space(./@id))"/> |
|
120 |
|
|
121 |
<xsl:if test="string-length($datasetId) > 0"> |
|
122 |
|
|
123 |
<xsl:variable name="resultDataset" |
|
124 |
select="dnet:rel($resultId, $datasetId, 'resultResult', 'publicationDataset', 'isRelatedTo', |
|
125 |
$metadata, $provenance, $trust, $about)"/> |
|
126 |
<xsl:variable name="datasetResult" |
|
127 |
select="dnet:rel($datasetId, $resultId, 'resultResult', 'publicationDataset', 'isRelatedTo', |
|
128 |
$metadata, $provenance, $trust, $about)"/> |
|
129 |
|
|
130 |
<ROW key="{$resultId}" columnFamily="resultResult_publicationDataset_isRelatedTo"> |
|
131 |
<QUALIFIER name="{$datasetId}" type="base64"> |
|
132 |
<xsl:value-of select="$resultDataset"/> |
|
133 |
</QUALIFIER> |
|
134 |
</ROW> |
|
135 |
<ROW key="{$datasetId}" columnFamily="resultResult_publicationDataset_isRelatedTo"> |
|
136 |
<QUALIFIER name="{$resultId}" type="base64"> |
|
137 |
<xsl:value-of select="$datasetResult"/> |
|
138 |
</QUALIFIER> |
|
139 |
</ROW> |
|
140 |
</xsl:if> |
|
141 |
</xsl:for-each> |
|
142 |
</ROWS> |
|
143 |
</xsl:otherwise> |
|
144 |
</xsl:choose> |
|
145 |
</xsl:if> |
|
146 |
</xsl:otherwise> |
|
147 |
</xsl:choose> |
|
148 |
</xsl:template> |
|
149 |
</xsl:stylesheet> |
|
150 |
</CODE> |
|
151 |
</SCRIPT> |
|
152 |
</CONFIGURATION> |
|
153 |
<STATUS/> |
|
154 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
155 |
</BODY> |
|
156 |
</RESOURCE_PROFILE> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/2hbase/organizations_2_hbase.xsl | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="4ef23346-95e3-4357-a4bf-e26d7c9c1b82_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<SOURCE_METADATA_FORMAT name="dbmf" layout="store" interpretation="cleaned"/> |
|
12 |
<SINK_METADATA_FORMAT name="oaf_hbase"/> |
|
13 |
<IMPORTED/> |
|
14 |
<SCRIPT> |
|
15 |
<TITLE>xslt_mapping_organizations2hbase</TITLE> |
|
16 |
<CODE> |
|
17 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
18 |
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
19 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oaa="http://namespace.openaire.eu/oaa" |
|
20 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dnet="eu.dnetlib.data.transform.xml.DbmfToHbaseXsltFunctions" |
|
21 |
version="1.0"> |
|
22 |
|
|
23 |
<xsl:output omit-xml-declaration="yes" indent="yes"/> |
|
24 |
|
|
25 |
<xsl:template match="/"> |
|
26 |
|
|
27 |
<xsl:variable name="originalid" select="//FIELD[@name = 'organizationid']"/> |
|
28 |
<xsl:variable name="organizationid" select="dnet:oafSplitId('organization', $originalid)"/> |
|
29 |
<xsl:variable name="dateofcollection" select="//FIELD[@name = 'dateofcollection']"/> |
|
30 |
<xsl:variable name="dateoftransformation" select="//FIELD[@name = 'dateoftransformation']"/> |
|
31 |
<xsl:variable name="collectedfromid" select="dnet:oafSplitId('datasource', //FIELD[@name = 'collectedfromid'])"/> |
|
32 |
<xsl:variable name="collectedfromname" select="//FIELD[@name = 'collectedfromname']"/> |
|
33 |
|
|
34 |
<xsl:variable name="organization" |
|
35 |
select="dnet:oafEntity('organization', $organizationid, $collectedfromid, $collectedfromname, $originalid, $dateofcollection, $dateoftransformation, //FIELD[not(@isNull)])"/> |
|
36 |
|
|
37 |
<ROWS> |
|
38 |
<xsl:if test="string-length($organizationid) > 0"> |
|
39 |
<ROW key="{$organizationid}" columnFamily="organization"> |
|
40 |
<QUALIFIER name="body" type="base64"> |
|
41 |
<xsl:value-of select="$organization"/> |
|
42 |
</QUALIFIER> |
|
43 |
</ROW> |
|
44 |
</xsl:if> |
|
45 |
</ROWS> |
|
46 |
|
|
47 |
</xsl:template> |
|
48 |
|
|
49 |
</xsl:stylesheet> |
|
50 |
</CODE> |
|
51 |
</SCRIPT> |
|
52 |
</CONFIGURATION> |
|
53 |
<STATUS/> |
|
54 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
55 |
</BODY> |
|
56 |
</RESOURCE_PROFILE> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/2hbase/projectcontactperson_2_hbase.xsl | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="9099673b-b46d-4aae-9f56-321607cbacba_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<SOURCE_METADATA_FORMAT name="dbmf" layout="store" interpretation="cleaned"/> |
|
12 |
<SINK_METADATA_FORMAT name="oaf_hbase"/> |
|
13 |
<IMPORTED/> |
|
14 |
<SCRIPT> |
|
15 |
<TITLE>xslt_mapping_projectContactperson2hbase</TITLE> |
|
16 |
<CODE> |
|
17 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
18 |
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
19 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oaa="http://namespace.openaire.eu/oaa" |
|
20 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dnet="eu.dnetlib.data.transform.xml.DbmfToHbaseXsltFunctions" |
|
21 |
version="1.0"> |
|
22 |
|
|
23 |
<xsl:output omit-xml-declaration="yes" indent="yes"/> |
|
24 |
|
|
25 |
<xsl:template match="/"> |
|
26 |
|
|
27 |
<xsl:variable name="projectId" select="dnet:oafSplitId('project', //FIELD[@name = 'project'])"/> |
|
28 |
<xsl:variable name="contactpersonId" select="dnet:oafSplitId('person', //FIELD[@name = 'contactperson'])"/> |
|
29 |
|
|
30 |
<ROWS> |
|
31 |
<xsl:if test="string-length($projectId) > 0 and string-length($contactpersonId) > 0"> |
|
32 |
|
|
33 |
<xsl:variable name="projectcontactperson" |
|
34 |
select="dnet:oafRel('projectPerson', $projectId, $contactpersonId, //FIELD[not(@isNull)], 'hasContact', 'dnet:project_person_relations')"/> |
|
35 |
<xsl:variable name="contactpersonproject" |
|
36 |
select="dnet:oafRel('projectPerson', $contactpersonId, $projectId, //FIELD[not(@isNull)], 'isContact', 'dnet:project_person_relations')"/> |
|
37 |
|
|
38 |
<ROW key="{$projectId}" columnFamily="projectPerson_contactPerson_hasContact"> |
|
39 |
<QUALIFIER name="{$contactpersonId}" type="base64"> |
|
40 |
<xsl:value-of select="$projectcontactperson"/> |
|
41 |
</QUALIFIER> |
|
42 |
</ROW> |
|
43 |
<ROW key="{$contactpersonId}" columnFamily="projectPerson_contactPerson_isContact"> |
|
44 |
<QUALIFIER name="{$projectId}" type="base64"> |
|
45 |
<xsl:value-of select="$contactpersonproject"/> |
|
46 |
</QUALIFIER> |
|
47 |
</ROW> |
|
48 |
</xsl:if> |
|
49 |
</ROWS> |
|
50 |
|
|
51 |
</xsl:template> |
|
52 |
|
|
53 |
</xsl:stylesheet> |
|
54 |
</CODE> |
|
55 |
</SCRIPT> |
|
56 |
</CONFIGURATION> |
|
57 |
<STATUS/> |
|
58 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
59 |
</BODY> |
|
60 |
</RESOURCE_PROFILE> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/2hbase/dissimilarity_2_hbase.xsl | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="a3a05526-a544-4087-b446-a53c22b06159_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<SOURCE_METADATA_FORMAT name="dbmf" layout="store" interpretation="cleaned"/> |
|
12 |
<SINK_METADATA_FORMAT name="oaf_hbase"/> |
|
13 |
<IMPORTED/> |
|
14 |
<SCRIPT> |
|
15 |
<TITLE>xslt_mapping_dissimilarity2hbase</TITLE> |
|
16 |
<CODE> |
|
17 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
18 |
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
19 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oaa="http://namespace.openaire.eu/oaa" |
|
20 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dnet="eu.dnetlib.data.transform.xml.DbmfToHbaseXsltFunctions" |
|
21 |
version="1.0"> |
|
22 |
|
|
23 |
<xsl:output omit-xml-declaration="yes" indent="yes"/> |
|
24 |
|
|
25 |
<xsl:template match="/"> |
|
26 |
|
|
27 |
<xsl:variable name="type" select="/ROW/FIELD[@name = 'entitytype']"/> |
|
28 |
<xsl:variable name="source" select="dnet:oafSimpleId($type, /ROW/FIELD[@name = 'id1'])"/> |
|
29 |
<xsl:variable name="target" select="dnet:oafSimpleId($type, /ROW/FIELD[@name = 'id2'])"/> |
|
30 |
|
|
31 |
<xsl:variable name="columnFamily"> |
|
32 |
<xsl:choose> |
|
33 |
<xsl:when test="$type = 'result'">resultResult_dedupSimilarity_isSimilarTo</xsl:when> |
|
34 |
<xsl:when test="$type = 'person'">personPerson_dedupSimilarity_isSimilarTo</xsl:when> |
|
35 |
<xsl:when test="$type = 'organization'">organizationOrganization_dedupSimilarity_isSimilarTo</xsl:when> |
|
36 |
</xsl:choose> |
|
37 |
</xsl:variable> |
|
38 |
|
|
39 |
<ROWS> |
|
40 |
<xsl:if test="string-length($source) > 0 and string-length($target) > 0 and string-length($columnFamily) > 0"> |
|
41 |
<ROW key="{$source}" columnFamily="{$columnFamily}"> |
|
42 |
<QUALIFIER name="{$target}" type="base64"></QUALIFIER> |
|
43 |
</ROW> |
|
44 |
<ROW key="{$target}" columnFamily="{$columnFamily}"> |
|
45 |
<QUALIFIER name="{$source}" type="base64"></QUALIFIER> |
|
46 |
</ROW> |
|
47 |
</xsl:if> |
|
48 |
</ROWS> |
|
49 |
|
|
50 |
</xsl:template> |
|
51 |
|
|
52 |
</xsl:stylesheet> |
|
53 |
|
|
54 |
</CODE> |
|
55 |
</SCRIPT> |
|
56 |
</CONFIGURATION> |
|
57 |
<STATUS/> |
|
58 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
59 |
</BODY> |
|
60 |
</RESOURCE_PROFILE> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/2hbase/oaf_publication2hbase.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="be2626f5-b879-4851-afa8-62f754889eaa_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU=" /> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType" /> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources" /> |
|
6 |
<RESOURCE_URI value="" /> |
|
7 |
<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<SOURCE_METADATA_FORMAT name="oaf" layout="store" interpretation="cleaned" /> |
|
12 |
<SINK_METADATA_FORMAT name="oaf_hbase" /> |
|
13 |
<IMPORTED/> |
|
14 |
<SCRIPT> |
|
15 |
<TITLE>xslt_mapping_oaf_publication2hbase</TITLE> |
|
16 |
<CODE> |
|
17 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
18 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dc="http://purl.org/dc/elements/1.1/" |
|
19 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
20 |
xmlns:dnet="eu.dnetlib.data.transform.xml.OafToHbaseXsltFunctions" |
|
21 |
xmlns:exslt="http://exslt.org/common" |
|
22 |
version="1.0" extension-element-prefixes="exslt" |
|
23 |
exclude-result-prefixes="xsl oaf dr dri dnet exslt"> |
|
24 |
|
|
25 |
<xsl:output omit-xml-declaration="yes" indent="yes"/> |
|
26 |
|
|
27 |
<xsl:param name="invisible" select="false()"/> |
|
28 |
<xsl:param name="trust" select="string('0.9')"/> |
|
29 |
<xsl:param name="provenance" select="string('sysimport:crosswalk:repository')"/> |
|
30 |
|
|
31 |
<xsl:template match="/*"> |
|
32 |
<xsl:variable name="about" select="/*[local-name() = 'record']/*[local-name() = 'about']"/> |
|
33 |
<xsl:variable name="dateofcollection" select="/*[local-name() = 'record']/*[local-name() = 'header']/*[local-name()='dateOfCollection' and text()][1]"/> |
|
34 |
<xsl:variable name="dateoftransformation" select="/*[local-name() = 'record']/*[local-name() = 'header']/*[local-name()='dateOfTransformation' and text()][1]"/> |
|
35 |
<xsl:variable name="metadata" select="exslt:node-set(/*[local-name() = 'record']/*[local-name()='metadata']/*)"/> |
|
36 |
<xsl:variable name="namespaceprefix"> |
|
37 |
<xsl:choose> |
|
38 |
|
|
39 |
<!-- TODO check namespaceprefix length is 12 --> |
|
40 |
<xsl:when test="string-length(//oaf:datasourceprefix) > 0"> |
|
41 |
<xsl:value-of select="//oaf:datasourceprefix"/> |
|
42 |
</xsl:when> |
|
43 |
<xsl:otherwise> |
|
44 |
<xsl:value-of select="unknown_"/> |
|
45 |
</xsl:otherwise> |
|
46 |
</xsl:choose> |
|
47 |
</xsl:variable> |
|
48 |
|
|
49 |
<xsl:choose> |
|
50 |
<!-- <xsl:when test="count($metadata) = 0 or string-length($namespaceprefix) = 0"> --> |
|
51 |
<xsl:when test="count($metadata) = 0"> |
|
52 |
<ROWS/> |
|
53 |
</xsl:when> |
|
54 |
<xsl:otherwise> |
|
55 |
|
|
56 |
<xsl:variable name="objIdentifier" select="//dri:objIdentifier"/> |
|
57 |
<xsl:variable name="resultId" select="dnet:oafSimpleId('result', //dri:objIdentifier)"/> |
|
58 |
|
|
59 |
<xsl:if test="string-length($resultId) > 0"> |
|
60 |
|
|
61 |
<xsl:variable name="cobjcategory" select="//dr:CobjCategory"/> |
|
62 |
<xsl:choose> |
|
63 |
<!-- check if we need to exclude datasets from an OAF MDStore--> |
|
64 |
<xsl:when test="$cobjcategory = '0021'"> |
|
65 |
<ROWS/> |
|
66 |
</xsl:when> |
|
67 |
<xsl:otherwise> |
|
68 |
<xsl:variable name="originalidTest" select="/*[local-name()='record']/*[local-name() = 'header']/*[local-name() = 'recordIdentifier']"/> |
|
69 |
<xsl:variable name="originalid"> |
|
70 |
<xsl:choose> |
|
71 |
<xsl:when test="contains($originalidTest, '::')"> |
|
72 |
<xsl:value-of select="substring-after($originalidTest, '::')"/> |
|
73 |
</xsl:when> |
|
74 |
<xsl:otherwise> |
|
75 |
<xsl:value-of select="$originalidTest"/> |
|
76 |
</xsl:otherwise> |
|
77 |
</xsl:choose> |
|
78 |
</xsl:variable> |
|
79 |
|
|
80 |
<xsl:variable name="result" |
|
81 |
select="dnet:oafResult($resultId, $invisible, $provenance, $trust, $about, $originalid, $dateofcollection, $dateoftransformation, $metadata)"/> |
|
82 |
|
|
83 |
<ROWS> |
|
84 |
<ROW key="{$resultId}" columnFamily="result"> |
|
85 |
<QUALIFIER name="body" type="base64"> |
|
86 |
<xsl:value-of select="$result"/> |
|
87 |
</QUALIFIER> |
|
88 |
</ROW> |
|
89 |
|
|
90 |
</ROWS> |
|
91 |
</xsl:otherwise> |
|
92 |
</xsl:choose> |
|
93 |
</xsl:if> |
|
94 |
</xsl:otherwise> |
|
95 |
</xsl:choose> |
|
96 |
</xsl:template> |
|
97 |
</xsl:stylesheet> |
|
98 |
</CODE> |
|
99 |
</SCRIPT> |
|
100 |
</CONFIGURATION> |
|
101 |
<STATUS /> |
|
102 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
103 |
</BODY> |
|
104 |
</RESOURCE_PROFILE> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/coreuk/core_springer2oaf.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="dff3a83e-97a3-4a8b-9e57-7aed12804f30_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2016-11-21T11:15:30+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<IMPORTED/> |
|
12 |
<SCRIPT> |
|
13 |
<TITLE>core_springer2oaf</TITLE> |
|
14 |
<CODE> |
|
15 |
<![CDATA[ |
|
16 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
17 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" |
|
18 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
19 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" |
|
20 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:date="http://exslt.org/dates-and-times" |
|
21 |
extension-element-prefixes="date" exclude-result-prefixes="xs" version="2.0"> |
|
22 |
|
|
23 |
<xsl:output omit-xml-declaration="yes" indent="yes"/> |
|
24 |
<xsl:param name="varOfficialName"/> |
|
25 |
<xsl:param name="varDataSourceId"/> |
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
<xsl:template match="publisher"> |
|
30 |
<dc:publisher> |
|
31 |
<xsl:value-of select="."/> |
|
32 |
</dc:publisher> |
|
33 |
</xsl:template> |
|
34 |
|
|
35 |
<xsl:template match="/"> |
|
36 |
<xsl:if test="not(.//error)"> |
|
37 |
<record> |
|
38 |
<header> |
|
39 |
<xsl:copy-of select="//*[local-name() = 'header']/*" copy-namespaces="no"/> |
|
40 |
<dr:dateOfTransformation> |
|
41 |
<xsl:value-of select="date:date-time()"/> |
|
42 |
</dr:dateOfTransformation> |
|
43 |
</header> |
|
44 |
<metadata> |
|
45 |
<dc:language>eng</dc:language> |
|
46 |
<oaf:accessrights>OPEN</oaf:accessrights> |
|
47 |
<oaf:hostedBy id="openaire____::SpringerOA" |
|
48 |
name="SpringerOpen"/> |
|
49 |
<!-- <oaf:accessrights>UNKNOWN</oaf:accessrights> |
|
50 |
<oaf:hostedBy id="openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18" |
|
51 |
name="Unknown Repository"/>--> |
|
52 |
<oaf:collectedFrom> |
|
53 |
<xsl:attribute name="name"> |
|
54 |
<xsl:value-of select="$varOfficialName"/> |
|
55 |
</xsl:attribute> |
|
56 |
<xsl:attribute name="id"> |
|
57 |
<xsl:value-of select="$varDataSourceId"/> |
|
58 |
</xsl:attribute> |
|
59 |
</oaf:collectedFrom> |
|
60 |
|
|
61 |
<xsl:apply-templates select=".//*"/> |
|
62 |
</metadata> |
|
63 |
<xsl:copy-of select="//*[local-name() = 'about']/*" copy-namespaces="no"/> |
|
64 |
</record> |
|
65 |
</xsl:if> |
|
66 |
|
|
67 |
</xsl:template> |
|
68 |
|
|
69 |
|
|
70 |
<xsl:template match="title"> |
|
71 |
<dc:title> |
|
72 |
<xsl:value-of select="normalize-space(.)"/> |
|
73 |
</dc:title> |
|
74 |
</xsl:template> |
|
75 |
|
|
76 |
<xsl:template match="author"> |
|
77 |
<dc:creator> |
|
78 |
<xsl:value-of select="concat(./family, ', ', ./given)"/> |
|
79 |
</dc:creator> |
|
80 |
</xsl:template> |
|
81 |
|
|
82 |
<xsl:template match="created"> |
|
83 |
<xsl:variable name="d"> |
|
84 |
<xsl:variable name="date" select=".//array"/> |
|
85 |
|
|
86 |
<xsl:value-of select="string-join(($date[1], $date[2], $date[3]), '-')"/> |
|
87 |
</xsl:variable> |
|
88 |
|
|
89 |
<dc:date> |
|
90 |
<xsl:value-of select="$d"/> |
|
91 |
</dc:date> |
|
92 |
|
|
93 |
|
|
94 |
</xsl:template> |
|
95 |
|
|
96 |
<xsl:template match="DOI"> |
|
97 |
<dc:identifier> |
|
98 |
<xsl:value-of select="concat('http://dx.doi.org/', .)"/> |
|
99 |
</dc:identifier> |
|
100 |
<oaf:identifier identifierType="doi"> |
|
101 |
<xsl:value-of select="."/> |
|
102 |
</oaf:identifier> |
|
103 |
</xsl:template> |
|
104 |
|
|
105 |
<xsl:template match="type"> |
|
106 |
<xsl:choose> |
|
107 |
<xsl:when test=". eq 'conference-paper'"> |
|
108 |
<dc:type> |
|
109 |
<xsl:value-of select="string('info:eu-repo/semantics/conferenceObject')"/> |
|
110 |
</dc:type> |
|
111 |
<dc:type> |
|
112 |
<xsl:value-of select="string('conference paper')"/> |
|
113 |
</dc:type> |
|
114 |
<dr:CobjCategory>0004</dr:CobjCategory> |
|
115 |
</xsl:when> |
|
116 |
<xsl:when test=". eq 'journal-article'"> |
|
117 |
<dc:type> |
|
118 |
<xsl:value-of select="string('info:eu-repo/semantics/article')"/> |
|
119 |
</dc:type> |
|
120 |
<dc:type> |
|
121 |
<xsl:value-of select="string('journal article')"/> |
|
122 |
</dc:type> |
|
123 |
|
|
124 |
<dr:CobjCategory>0001</dr:CobjCategory> |
|
125 |
<oaf:journal> |
|
126 |
<xsl:value-of select="normalize-space(../container-title)"/> |
|
127 |
</oaf:journal> |
|
128 |
</xsl:when> |
|
129 |
<xsl:when test=". eq book-chapter"> |
|
130 |
<dc:type> |
|
131 |
<xsl:value-of select="string('info:eu-repo/semantics/bookPart')"/> |
|
132 |
</dc:type> |
|
133 |
<dc:type> |
|
134 |
<xsl:value-of select="string('book chapter')"/> |
|
135 |
</dc:type> |
|
136 |
<dc:source> |
|
137 |
<xsl:value-of select="../container-title"/> |
|
138 |
</dc:source> |
|
139 |
<!-- <xsl:template match="content_item"> |
|
140 |
<dc:type> |
|
141 |
<xsl:value-of select="string('info:eu-repo/semantics/bookPart')"/> |
|
142 |
</dc:type> |
|
143 |
<dc:type> |
|
144 |
<xsl:value-of select="./@component_type"/> |
|
145 |
</dc:type> |
|
146 |
<xsl:choose> |
|
147 |
<xsl:when test="../book_series_metadata"> |
|
148 |
<dc:source> |
|
149 |
<xsl:value-of select="concat(normalize-space(../book_series_metadata/series_metadata/*/title), ' - ', normalize-space(../book_series_metadata/titles/title))"/> |
|
150 |
</dc:source> |
|
151 |
</xsl:when> |
|
152 |
<xsl:when test="../book_metadata"> |
|
153 |
<dc:source> |
|
154 |
<xsl:value-of select="normalize-space(../book_metadata/*/title)"/> |
|
155 |
</dc:source> |
|
156 |
</xsl:when> |
|
157 |
</xsl:choose> |
|
158 |
<dr:CobjCategory>0013</dr:CobjCategory> |
|
159 |
|
|
160 |
</xsl:template> --> |
|
161 |
<dr:CobjCategory>0013</dr:CobjCategory> |
|
162 |
</xsl:when> |
|
163 |
|
|
164 |
</xsl:choose> |
|
165 |
</xsl:template> |
|
166 |
|
|
167 |
<xsl:template match="downloadFileUrl"> |
|
168 |
<downloadFileUrl><xsl:value-of select="."/></downloadFileUrl> |
|
169 |
</xsl:template> |
|
170 |
|
|
171 |
<xsl:template match="subject"> |
|
172 |
<dc:subject> |
|
173 |
<xsl:value-of select="."/> |
|
174 |
</dc:subject> |
|
175 |
</xsl:template> |
|
176 |
|
|
177 |
<!-- Extend with new templates for additional types of publication --> |
|
178 |
|
|
179 |
<xsl:template match="* | @*"/> |
|
180 |
|
|
181 |
</xsl:stylesheet> |
|
182 |
|
|
183 |
]]> |
|
184 |
</CODE> |
|
185 |
</SCRIPT> |
|
186 |
</CONFIGURATION> |
|
187 |
<STATUS/> |
|
188 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
189 |
</BODY> |
|
190 |
</RESOURCE_PROFILE> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/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/tags/dnet-openaireplus-profiles-1.0.25/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/2hbase/datasourceorganization_2_hbase.xsl | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="760183e7-a5d4-4827-9218-3d49ff9fcbd1_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<SOURCE_METADATA_FORMAT name="dbmf" layout="store" interpretation="cleaned"/> |
|
12 |
<SINK_METADATA_FORMAT name="oaf_hbase"/> |
|
13 |
<IMPORTED/> |
|
14 |
<SCRIPT> |
|
15 |
<TITLE>xslt_mapping_datasourceOrganization2hbase</TITLE> |
|
16 |
<CODE> |
|
17 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
18 |
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
19 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oaa="http://namespace.openaire.eu/oaa" |
|
20 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dnet="eu.dnetlib.data.transform.xml.DbmfToHbaseXsltFunctions" |
|
21 |
version="1.0"> |
|
22 |
|
|
23 |
<xsl:output omit-xml-declaration="yes" indent="yes"/> |
|
24 |
|
|
25 |
<xsl:template match="/"> |
|
26 |
|
|
27 |
<xsl:variable name="datasourceId" select="dnet:oafSplitId('datasource', //FIELD[@name = 'datasource'])"/> |
|
28 |
<xsl:variable name="organizationId" select="dnet:oafSplitId('organization', //FIELD[@name = 'organization'])"/> |
|
29 |
|
|
30 |
<ROWS> |
|
31 |
<xsl:if test="string-length($datasourceId) > 0 and string-length($organizationId) > 0"> |
|
32 |
|
|
33 |
<xsl:variable name="datasourceorganization" |
|
34 |
select="dnet:oafRel('datasourceOrganization', $datasourceId, $organizationId, //FIELD[not(@isNull)], 'provides', 'dnet:datasources_organizations_typologies')"/> |
|
35 |
<xsl:variable name="organizationdatasource" |
|
36 |
select="dnet:oafRel('datasourceOrganization', $organizationId, $datasourceId, //FIELD[not(@isNull)], 'isProvidedBy', 'dnet:datasources_organizations_typologies')"/> |
|
37 |
|
|
38 |
<ROW key="{$datasourceId}" columnFamily="datasourceOrganization_provision_provides"> |
|
39 |
<QUALIFIER name="{$organizationId}" type="base64"> |
|
40 |
<xsl:value-of select="$datasourceorganization"/> |
|
41 |
</QUALIFIER> |
|
42 |
</ROW> |
|
43 |
<ROW key="{$organizationId}" columnFamily="datasourceOrganization_provision_isProvidedBy"> |
|
44 |
<QUALIFIER name="{$datasourceId}" type="base64"> |
|
45 |
<xsl:value-of select="$organizationdatasource"/> |
|
46 |
</QUALIFIER> |
|
47 |
</ROW> |
|
48 |
</xsl:if> |
|
49 |
</ROWS> |
|
50 |
|
|
51 |
</xsl:template> |
|
52 |
|
|
53 |
</xsl:stylesheet> |
|
54 |
</CODE> |
|
55 |
</SCRIPT> |
|
56 |
</CONFIGURATION> |
|
57 |
<STATUS/> |
|
58 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
59 |
</BODY> |
|
60 |
</RESOURCE_PROFILE> |
modules/dnet-openaireplus-profiles/tags/dnet-openaireplus-profiles-1.0.25/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> |
Also available in: Unified diff
[maven-release-plugin] copy for tag dnet-openaireplus-profiles-1.0.25