1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="e7f565dd-b55f-4155-af79-ecab860c76c4_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2018-09-20T11:15:30+00:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>INNOVIRIS to DB</TITLE>
|
14
|
<CODE>
|
15
|
<![CDATA[
|
16
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
17
|
xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions">
|
18
|
|
19
|
<xsl:param name="parentDatasourceId"/>
|
20
|
<xsl:variable name="namespacePrefix" select="string('innoviris___')"/>
|
21
|
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
|
22
|
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
|
23
|
<xsl:variable name="dateFormat" select="string('yyyy-MM-dd')"/>
|
24
|
<xsl:variable name="funderID" select="concat($namespacePrefix, '::INNOVIRIS')"/>
|
25
|
<xsl:variable name="fundingId">
|
26
|
<xsl:value-of
|
27
|
select="concat($funderID, '::', translate(.//column[@name = 'FUNDING_STREAM'], ' ', ''))"
|
28
|
/>
|
29
|
</xsl:variable>
|
30
|
<xsl:param name="quote">"</xsl:param>
|
31
|
<xsl:variable name="org_normalized" select="translate(translate(.//column[@name='PROJECT_PARTNER/BENEFICIARY'],' ',''),$uppercase,$lowercase)"/>
|
32
|
<xsl:variable name="organizationId" select="concat($namespacePrefix,'::',utils:md5($org_normalized))"/>
|
33
|
|
34
|
<xsl:template match="/">
|
35
|
<record>
|
36
|
|
37
|
<xsl:copy-of select=".//*[local-name() = 'header']"/>
|
38
|
|
39
|
<metadata>
|
40
|
<ROWS>
|
41
|
<xsl:variable name="projectId"
|
42
|
select="concat($namespacePrefix, '::', normalize-space(.//column[@name = 'PROJECT_ID']))"/>
|
43
|
<xsl:variable name="startDate"
|
44
|
select=".//column[@name = 'PROJECT_START_DATE']"/>
|
45
|
<xsl:variable name="endDate"
|
46
|
select=".//column[@name = 'PROJECT_END_DATE']"/>
|
47
|
<ROW table="projects">
|
48
|
<FIELD name="_dnet_resource_identifier_">
|
49
|
<xsl:value-of select="$projectId"/>
|
50
|
</FIELD>
|
51
|
<FIELD name="id">
|
52
|
<xsl:value-of select="$projectId"/>
|
53
|
</FIELD>
|
54
|
<FIELD name="code">
|
55
|
<xsl:value-of
|
56
|
select="normalize-space(.//column[@name = 'PROJECT_ID'])"/>
|
57
|
</FIELD>
|
58
|
<FIELD name="title">
|
59
|
<xsl:value-of select=".//column[@name = 'PROJECT_TITLE']"/>
|
60
|
</FIELD>
|
61
|
|
62
|
<FIELD name="startdate" type="date" format="{$dateFormat}">
|
63
|
<xsl:value-of select="$startDate"/>
|
64
|
</FIELD>
|
65
|
<FIELD name="enddate" type="date" format="{$dateFormat}">
|
66
|
<xsl:value-of select="$endDate"/>
|
67
|
</FIELD>
|
68
|
<FIELD name="duration" type="int">
|
69
|
<xsl:value-of select=".//column[@name = 'PROJECT_DURATION']"/>
|
70
|
</FIELD>
|
71
|
<FIELD name="collectedfrom">
|
72
|
<xsl:value-of select="$parentDatasourceId"/>
|
73
|
</FIELD>
|
74
|
<FIELD name="provenanceActionClass"
|
75
|
>sysimport:crosswalk:entityregistry</FIELD>
|
76
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
77
|
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
|
78
|
</ROW>
|
79
|
<ROW table="project_fundingpath">
|
80
|
<FIELD name="_dnet_resource_identifier_">
|
81
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
82
|
</FIELD>
|
83
|
<FIELD name="funding">
|
84
|
<xsl:value-of select="$fundingId"/>
|
85
|
</FIELD>
|
86
|
<FIELD name="project">
|
87
|
<xsl:value-of select="$projectId"/>
|
88
|
</FIELD>
|
89
|
<FIELD name="startdate" type="date" format="{$dateFormat}">
|
90
|
<xsl:value-of select="$startDate"/>
|
91
|
</FIELD>
|
92
|
<FIELD name="enddate" type="date" format="{$dateFormat}">
|
93
|
<xsl:value-of select="$endDate"/>
|
94
|
</FIELD>
|
95
|
</ROW>
|
96
|
<ROW table="dsm_organizations">
|
97
|
|
98
|
<FIELD name="_dnet_resource_identifier_">
|
99
|
<xsl:value-of select="$organizationId" />
|
100
|
</FIELD>
|
101
|
<FIELD name="id">
|
102
|
<xsl:value-of select="$organizationId" />
|
103
|
</FIELD>
|
104
|
<FIELD name="legalname">
|
105
|
<xsl:value-of select="normalize-space(.//column[@name='PROJECT_PARTNER/BENEFICIARY'])" />
|
106
|
</FIELD>
|
107
|
<FIELD name="country">
|
108
|
<xsl:value-of select="string('BE')" />
|
109
|
</FIELD>
|
110
|
<FIELD name="collectedfrom">
|
111
|
<xsl:value-of select="$parentDatasourceId" />
|
112
|
</FIELD>
|
113
|
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
|
114
|
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
|
115
|
</ROW>
|
116
|
<ROW table="project_organization">
|
117
|
<FIELD name="_dnet_resource_identifier_">
|
118
|
<xsl:value-of select='concat($projectId, "@@", $organizationId)' />
|
119
|
</FIELD>
|
120
|
<FIELD name="project">
|
121
|
<xsl:value-of select="$projectId" />
|
122
|
</FIELD>
|
123
|
<FIELD name="resporganization">
|
124
|
<xsl:value-of select="$organizationId" />
|
125
|
</FIELD>
|
126
|
|
127
|
<FIELD name="semanticclass">partecipant</FIELD>
|
128
|
</ROW>
|
129
|
</ROWS>
|
130
|
</metadata>
|
131
|
</record>
|
132
|
</xsl:template>
|
133
|
</xsl:stylesheet>
|
134
|
|
135
|
]]>
|
136
|
</CODE>
|
137
|
</SCRIPT>
|
138
|
</CONFIGURATION>
|
139
|
<STATUS/>
|
140
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
141
|
</BODY>
|
142
|
</RESOURCE_PROFILE>
|