Project

General

Profile

1 52327 alessia.ba
<RESOURCE_PROFILE>
2
	<HEADER>
3 52416 alessia.ba
		<RESOURCE_IDENTIFIER value="e931caab-7bec-4b07-9e72-de15739b4f0d_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4 52327 alessia.ba
		<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>FWF to DB</TITLE>
14
				<CODE>
15 53143 alessia.ba
					<![CDATA[
16 48139 alessia.ba
<xsl:stylesheet xmlns:fwf="eu.dnetlib.data.transform.xml.FWFXsltFunctions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
17 26600 sandro.lab
18 52370 miriam.bag
	<xsl:param name="varDataSourceId"/>
19
	<xsl:variable name="namespacePrefix" select="string('fwf_________')"/>
20 26600 sandro.lab
21 44091 alessia.ba
	<xsl:variable name="funderID" select="concat($namespacePrefix, '::FWF')"/>
22 48139 alessia.ba
23 48959 claudio.at
	<xsl:variable name="projectFundingAndNumber" select="normalize-space(//column[@name='project number'])"/>
24
	<xsl:variable name="fundingCode" select="normalize-space(substring-before($projectFundingAndNumber, '–'))"/>
25
	<xsl:variable name="projectNumber" select="normalize-space(substring-after($projectFundingAndNumber, '–'))"/>
26
	<xsl:variable name="projectID" select="concat($namespacePrefix, '::', concat($fundingCode, '_', $projectNumber))"/>
27
	<xsl:variable name="projectTitle" select="//column[@name='project title']"/>
28 42419 alessia.ba
29 26600 sandro.lab
	<xsl:template match="/">
30 48959 claudio.at
		<record>
31
			<xsl:copy-of select=".//*[local-name()='header']"/>
32
			<metadata>
33
				<xsl:if test="string-length($projectTitle) &gt; 0 and
34 48940 alessia.ba
                      string-length($projectID) &gt; 0 and
35
                      //column[@name='status'] != 'canceled'">
36 48139 alessia.ba
37 48959 claudio.at
					<xsl:variable name="projectCode" select="concat($fundingCode,' ', $projectNumber)"/>
38
					<xsl:variable name="startDate" select=".//column[@name='from']"/>
39
					<xsl:variable name="endDate" select=".//column[@name='till']"/>
40
					<xsl:variable name="dateFormat" select="string('yyyy-MM-dd')"/>
41 53108 alessia.ba
					<xsl:variable name="organizationId" select="fwf:getMd5(normalize-space(.//column[@name='research place and institute']))"/>
42 48959 claudio.at
					<xsl:variable name="fundingID">
43
						<xsl:choose>
44
							<xsl:when test="string-length($fundingCode) &gt; 0">
45
								<xsl:value-of select="concat($funderID, '::', $fundingCode)"/>
46
							</xsl:when>
47
							<xsl:otherwise>
48
								<xsl:value-of select="$funderID"/>
49
							</xsl:otherwise>
50
						</xsl:choose>
51
					</xsl:variable>
52 48139 alessia.ba
53
					<ROWS>
54 42419 alessia.ba
						<ROW table="projects">
55
							<FIELD name="_dnet_resource_identifier_">
56
								<xsl:value-of select="$projectID"/>
57
							</FIELD>
58
							<FIELD name="id">
59
								<xsl:value-of select="$projectID"/>
60
							</FIELD>
61
							<FIELD name="code">
62 48139 alessia.ba
								<xsl:value-of select="$projectCode"/>
63 42419 alessia.ba
							</FIELD>
64
							<FIELD name="startdate" type="date" format="{$dateFormat}">
65
								<xsl:value-of select="$startDate"/>
66
							</FIELD>
67
							<FIELD name="enddate" type="date" format="{$dateFormat}">
68
								<xsl:value-of select="$endDate"/>
69
							</FIELD>
70
							<FIELD name="title">
71 48139 alessia.ba
								<xsl:value-of select="$projectTitle"/>
72 42419 alessia.ba
							</FIELD>
73 48947 miriam.bag
							<FIELD name ="contactfullname">
74 48959 claudio.at
								<xsl:value-of select="normalize-space(.//column[@name='project lead'])"/>
75 48947 miriam.bag
							</FIELD>
76 48139 alessia.ba
							<FIELD name="keywords">
77
								<xsl:value-of select=".//column[@name='keywords']"/>
78
							</FIELD>
79
							<FIELD name="optional1">
80
								<xsl:variable name="grantAmount" select=".//column[@name='grants awarded']"/>
81
								<xsl:variable name="tmp" select="substring(normalize-space($grantAmount),1,1)"/>
82
								<xsl:value-of select="concat($tmp,' ',substring-after($grantAmount,$tmp))"/>
83
							</FIELD>
84
85 42419 alessia.ba
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
86
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
87 48139 alessia.ba
							<FIELD name="collectedfrom">
88 52372 miriam.bag
								<xsl:value-of select="$varDataSourceId"/>
89 48139 alessia.ba
							</FIELD>
90 52337 miriam.bag
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
91 42419 alessia.ba
						</ROW>
92
						<ROW table="project_fundingpath">
93
							<FIELD name="_dnet_resource_identifier_">
94 44408 alessia.ba
95 42419 alessia.ba
								<xsl:value-of select="concat($fundingID,'@@', $projectID)"/>
96
							</FIELD>
97
							<FIELD name="funding">
98
								<xsl:value-of select="$fundingID"/>
99
							</FIELD>
100
							<FIELD name="project">
101
								<xsl:value-of select="$projectID"/>
102
							</FIELD>
103
							<FIELD name="startdate" type="date" format="{$dateFormat}">
104
								<xsl:value-of select="$startDate"/>
105
							</FIELD>
106
							<FIELD name="enddate" type="date" format="{$dateFormat}">
107
								<xsl:value-of select="$endDate"/>
108
							</FIELD>
109
						</ROW>
110 48139 alessia.ba
						<xsl:if test="string-length($organizationId) &gt; 0">
111 52332 miriam.bag
							<ROW table="dsm_organizations">
112 48139 alessia.ba
113
								<FIELD name="_dnet_resource_identifier_">
114 53108 alessia.ba
									<xsl:value-of select="concat($namespacePrefix, '::',$organizationId)"/>
115 48139 alessia.ba
								</FIELD>
116
								<FIELD name="id">
117 53108 alessia.ba
									<xsl:value-of select="concat($namespacePrefix, '::',$organizationId)"/>
118 48139 alessia.ba
								</FIELD>
119
								<FIELD name="legalname">
120
									<xsl:variable name="orgName" select="normalize-space(.//column[@name='research place and institute'])"/>
121
									<xsl:choose>
122
										<xsl:when test="string-length( $orgName) &gt; 255">
123
											<xsl:value-of select="substring($orgName,0,254)"/>
124
										</xsl:when>
125
										<xsl:otherwise>
126
											<xsl:value-of select="normalize-space($orgName)"/>
127
										</xsl:otherwise>
128
									</xsl:choose>
129
								</FIELD>
130 53335 miriam.bag
								<FIELD name="country">
131
									<xsl:value-of select="string('AT')"/>
132
								</FIELD>
133 48139 alessia.ba
								<FIELD name="collectedfrom">
134 52372 miriam.bag
									<xsl:value-of select="$varDataSourceId"/>
135 48139 alessia.ba
								</FIELD>
136 52337 miriam.bag
								<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
137
138
								 <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
139 48139 alessia.ba
							</ROW>
140
						</xsl:if>
141
						<xsl:if test="string-length($organizationId) &gt; 0">
142
							<ROW table="project_organization">
143
								<FIELD name="_dnet_resource_identifier_">
144 53129 alessia.ba
									<xsl:value-of select="concat($projectID, '@@', concat($namespacePrefix, '::',$organizationId))"/>
145 48139 alessia.ba
								</FIELD>
146
								<FIELD name="project">
147
									<xsl:value-of select="$projectID"/>
148
								</FIELD>
149 52369 miriam.bag
								<FIELD name="resporganization">
150 53108 alessia.ba
									<xsl:value-of select="concat($namespacePrefix, '::',$organizationId)"/>
151 48139 alessia.ba
								</FIELD>
152 52369 miriam.bag
								<FIELD name="semanticclass">participant</FIELD>
153 52334 miriam.bag
154 48139 alessia.ba
							</ROW>
155
						</xsl:if>
156
					</ROWS>
157 48959 claudio.at
				</xsl:if>
158
			</metadata>
159
		</record>
160 26600 sandro.lab
	</xsl:template>
161
</xsl:stylesheet>
162 53143 alessia.ba
]]>
163
				</CODE>
164
			</SCRIPT>
165 52327 alessia.ba
		</CONFIGURATION>
166 53143 alessia.ba
		<STATUS/>
167
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
168
	</BODY>
169
</RESOURCE_PROFILE>