1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="59a88ce6-8352-4106-8629-bbfd29453714_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>SFI to DB</TITLE>
|
14
|
<CODE>
|
15
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
16
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
17
|
exclude-result-prefixes="xs" version="2.0">
|
18
|
|
19
|
<xsl:param name="varDataSourceId"/>
|
20
|
<xsl:variable name="namespacePrefix" select="string('sfi_________')"/>
|
21
|
|
22
|
<xsl:template match="/">
|
23
|
<record>
|
24
|
|
25
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
26
|
|
27
|
<metadata>
|
28
|
<ROWS>
|
29
|
<xsl:if test="normalize-space(.//column[@name='Proposal ID']) and normalize-space(.//column[@name='Project Title'])">
|
30
|
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Proposal ID']))"/>
|
31
|
<xsl:variable name="startDate" select=".//column[@name='Start Date']"/>
|
32
|
<xsl:variable name="endDate" select=".//column[@name='End Date']"/>
|
33
|
<ROW table="projects">
|
34
|
<FIELD name="_dnet_resource_identifier_">
|
35
|
<xsl:value-of select="$projectId"/>
|
36
|
</FIELD>
|
37
|
<FIELD name="id">
|
38
|
<xsl:value-of select="$projectId"/>
|
39
|
</FIELD>
|
40
|
<FIELD name="code">
|
41
|
<xsl:value-of select=".//column[@name='Proposal ID']"/>
|
42
|
</FIELD>
|
43
|
<FIELD name="title">
|
44
|
<xsl:value-of select=".//column[@name='Project Title']"/>
|
45
|
</FIELD>
|
46
|
<FIELD name="startdate" type="date" format="dd/MM/yyyy">
|
47
|
<xsl:value-of select="$startDate"/>
|
48
|
</FIELD>
|
49
|
<FIELD name="enddate" type="date" format="dd/MM/yyyy">
|
50
|
<xsl:value-of select="$endDate"/>
|
51
|
</FIELD>
|
52
|
<FIELD name="collectedfrom">
|
53
|
<xsl:value-of select="$varDataSourceId"/>
|
54
|
</FIELD>
|
55
|
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD>
|
56
|
<!-- 30/06/2016 must be converted into 2016-06-30-->
|
57
|
<xsl:variable name="date" select="xs:date(concat(
|
58
|
substring($startDate,7,4),'-',
|
59
|
substring($startDate,4,2),'-',
|
60
|
substring($startDate,1,2)))"/>
|
61
|
<FIELD name="oa_mandate_for_publications" type="boolean"><xsl:value-of select="$date >= xs:date('2009-01-01')"/> </FIELD>
|
62
|
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
|
63
|
</ROW>
|
64
|
|
65
|
<xsl:if test="normalize-space(.//column[@name='Programme Name'])">
|
66
|
<xsl:variable name="funderId" select="concat($namespacePrefix, '::SFI')"/>
|
67
|
<xsl:variable name="fundingId" select="concat($funderId, '::', normalize-space(.//column[@name='Programme Name']))"/>
|
68
|
<ROW table="project_fundingpath">
|
69
|
<FIELD name="_dnet_resource_identifier_">
|
70
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
71
|
</FIELD>
|
72
|
<FIELD name="funding">
|
73
|
<xsl:value-of select="$fundingId"/>
|
74
|
</FIELD>
|
75
|
<FIELD name="project">
|
76
|
<xsl:value-of select="$projectId"/>
|
77
|
</FIELD>
|
78
|
<FIELD name="startdate" type="date" format="dd/MM/yyyy">
|
79
|
<xsl:value-of select="$startDate"/>
|
80
|
</FIELD>
|
81
|
<FIELD name="enddate" type="date" format="dd/MM/yyyy">
|
82
|
<xsl:value-of select="$endDate"/>
|
83
|
</FIELD>
|
84
|
</ROW>
|
85
|
</xsl:if>
|
86
|
|
87
|
<xsl:if test="normalize-space(.//column[@name='Research Body'])">
|
88
|
<xsl:variable name="organizationId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Research Body']))"/>
|
89
|
<ROW table="dsm_organizations">
|
90
|
<FIELD name="_dnet_resource_identifier_">
|
91
|
<xsl:value-of select="$organizationId"/>
|
92
|
</FIELD>
|
93
|
<FIELD name="id">
|
94
|
<xsl:value-of select="$organizationId"/>
|
95
|
</FIELD>
|
96
|
<FIELD name="legalname">
|
97
|
<xsl:value-of select=".//column[@name='Research Body']"/>
|
98
|
</FIELD>
|
99
|
<FIELD name="countryclass">IE</FIELD>
|
100
|
<FIELD name="countryscheme">dnet:countries</FIELD>
|
101
|
<FIELD name="collectedfrom">
|
102
|
<xsl:value-of select="$varDataSourceId"/>
|
103
|
</FIELD>
|
104
|
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
|
105
|
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
|
106
|
</ROW>
|
107
|
<ROW table="project_organization">
|
108
|
<FIELD name="_dnet_resource_identifier_">
|
109
|
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
|
110
|
</FIELD>
|
111
|
<FIELD name="project">
|
112
|
<xsl:value-of select="$projectId"/>
|
113
|
</FIELD>
|
114
|
<FIELD name="resporganization">
|
115
|
<xsl:value-of select="$organizationId"/>
|
116
|
</FIELD>
|
117
|
<FIELD name="participantnumber" type="int">1</FIELD>
|
118
|
<FIELD name="semanticclass">coordinator</FIELD>
|
119
|
</ROW>
|
120
|
</xsl:if>
|
121
|
</xsl:if>
|
122
|
</ROWS>
|
123
|
</metadata>
|
124
|
</record>
|
125
|
</xsl:template>
|
126
|
|
127
|
</xsl:stylesheet>
|
128
|
</CODE>
|
129
|
</SCRIPT>
|
130
|
</CONFIGURATION>
|
131
|
<STATUS/>
|
132
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
133
|
</BODY>
|
134
|
</RESOURCE_PROFILE>
|