1 |
52333
|
miriam.bag
|
<RESOURCE_PROFILE>
|
2 |
|
|
<HEADER>
|
3 |
52349
|
alessia.ba
|
<RESOURCE_IDENTIFIER value="1af2a06a-2485-4b3b-8109-49bfd2aa7883_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4 |
52333
|
miriam.bag
|
<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>MIUR to DB</TITLE>
|
14 |
53218
|
miriam.bag
|
<CODE><![CDATA[
|
15 |
52333
|
miriam.bag
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
16 |
|
|
xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions">
|
17 |
|
|
|
18 |
52370
|
miriam.bag
|
<xsl:param name="varDataSourceId"/>
|
19 |
|
|
<xsl:variable name="namespacePrefix" select="string('miur________')"/>
|
20 |
52333
|
miriam.bag
|
|
21 |
|
|
<xsl:variable name="dateFormat" select="string('yyyy-MM-dd')"/>
|
22 |
|
|
<xsl:variable name="funderID" select="concat($namespacePrefix, '::MIUR')"/>
|
23 |
|
|
<xsl:variable name="fundingId">
|
24 |
|
|
<xsl:value-of
|
25 |
|
|
select="concat($funderID, '::', translate(.//column[@name = 'FUNDING_STREAM'], ' ', ''))"
|
26 |
|
|
/>
|
27 |
|
|
</xsl:variable>
|
28 |
53946
|
miriam.bag
|
<xsl:variable name="quot">"</xsl:variable>
|
29 |
|
|
<xsl:variable name="organizationId" select="concat($namespacePrefix,'::',utils:md5(.//column[@name='ORGANIZATION_INVOLVED']))"/>
|
30 |
52333
|
miriam.bag
|
|
31 |
|
|
<xsl:template match="/">
|
32 |
|
|
<record>
|
33 |
|
|
|
34 |
|
|
<xsl:copy-of select=".//*[local-name() = 'header']"/>
|
35 |
|
|
|
36 |
|
|
<metadata>
|
37 |
|
|
<ROWS>
|
38 |
|
|
<xsl:variable name="projectId"
|
39 |
|
|
select="concat($namespacePrefix, '::', normalize-space(.//column[@name = 'PROJECT_IDENTIFIER']))"/>
|
40 |
|
|
<xsl:variable name="startDate"
|
41 |
|
|
select="replace(.//column[@name = 'START_DATE'], '/', '-')"/>
|
42 |
|
|
<xsl:variable name="endDate"
|
43 |
53946
|
miriam.bag
|
select="replace(.//column[@name = 'END_DATE'], '/', '-')"/>
|
44 |
52333
|
miriam.bag
|
<xsl:variable name="contact" select="tokenize(.//column[@name='PRINCIPAL_INVESTIGATOR'],' ')"/>
|
45 |
|
|
|
46 |
|
|
<ROW table="projects">
|
47 |
|
|
<FIELD name="_dnet_resource_identifier_">
|
48 |
|
|
<xsl:value-of select="$projectId"/>
|
49 |
|
|
</FIELD>
|
50 |
|
|
<FIELD name="id">
|
51 |
|
|
<xsl:value-of select="$projectId"/>
|
52 |
|
|
</FIELD>
|
53 |
|
|
<FIELD name="code">
|
54 |
|
|
<xsl:value-of
|
55 |
|
|
select="normalize-space(.//column[@name = 'PROJECT_IDENTIFIER'])"/>
|
56 |
|
|
</FIELD>
|
57 |
|
|
<FIELD name="title">
|
58 |
|
|
<xsl:value-of select=".//column[@name = 'PROJECT_TITLE']"/>
|
59 |
|
|
</FIELD>
|
60 |
53946
|
miriam.bag
|
<xsl:if test=".//column[@name = 'ACRONYM']!=''">
|
61 |
52333
|
miriam.bag
|
<FIELD name="acronym">
|
62 |
|
|
<xsl:value-of select=".//column[@name = 'ACRONYM']"/>
|
63 |
53946
|
miriam.bag
|
</FIELD></xsl:if>
|
64 |
52333
|
miriam.bag
|
<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="duration" type="int">
|
71 |
|
|
<xsl:value-of select=".//column[@name = 'DURATION_MONTHS']"/>
|
72 |
53946
|
miriam.bag
|
</FIELD>
|
73 |
|
|
<xsl:if test=".//column[@name='PRINCIPAL_INVESTIGATOR']!=''">
|
74 |
52333
|
miriam.bag
|
<FIELD name="contactfullname">
|
75 |
|
|
<xsl:value-of select="concat($contact[1],', ', $contact[2])"/>
|
76 |
|
|
</FIELD>
|
77 |
53946
|
miriam.bag
|
</xsl:if>
|
78 |
|
|
<xsl:if test=".//column[@name='SETTORE']!=''">
|
79 |
52333
|
miriam.bag
|
<FIELD name="jsonextrainfo">
|
80 |
53946
|
miriam.bag
|
<xsl:value-of select="concat('{',$quot,'settore',$quot,':',$quot,.//column[@name='SETTORE'],$quot,'}')"/>
|
81 |
52333
|
miriam.bag
|
</FIELD>
|
82 |
53946
|
miriam.bag
|
</xsl:if>
|
83 |
52333
|
miriam.bag
|
<FIELD name="collectedfrom">
|
84 |
52372
|
miriam.bag
|
<xsl:value-of select="$varDataSourceId"/>
|
85 |
52333
|
miriam.bag
|
</FIELD>
|
86 |
|
|
<FIELD name="provenanceactionclass"
|
87 |
|
|
>sysimport:crosswalk:entityregistry</FIELD>
|
88 |
53946
|
miriam.bag
|
<FIELD name="provenanceactionscheme">dnet:provenanceActions</FIELD>
|
89 |
|
|
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
|
90 |
|
|
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
|
91 |
|
|
</ROW>
|
92 |
52333
|
miriam.bag
|
<ROW table="project_fundingpath">
|
93 |
|
|
<FIELD name="_dnet_resource_identifier_">
|
94 |
|
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
95 |
|
|
</FIELD>
|
96 |
|
|
<FIELD name="funding">
|
97 |
|
|
<xsl:value-of select="$fundingId"/>
|
98 |
|
|
</FIELD>
|
99 |
|
|
<FIELD name="project">
|
100 |
|
|
<xsl:value-of select="$projectId"/>
|
101 |
|
|
</FIELD>
|
102 |
|
|
<FIELD name="startdate" type="date" format="{$dateFormat}">
|
103 |
|
|
<xsl:value-of select="$startDate"/>
|
104 |
|
|
</FIELD>
|
105 |
|
|
<FIELD name="enddate" type="date" format="{$dateFormat}">
|
106 |
|
|
<xsl:value-of select="$endDate"/>
|
107 |
|
|
</FIELD>
|
108 |
|
|
</ROW>
|
109 |
53946
|
miriam.bag
|
<xsl:if test=".//column[@name='ORGANIZATION_INVOLVED']!=''">
|
110 |
52333
|
miriam.bag
|
<ROW table="dsm_organizations">
|
111 |
|
|
|
112 |
|
|
<FIELD name="_dnet_resource_identifier_">
|
113 |
|
|
<xsl:value-of select="$organizationId" />
|
114 |
|
|
</FIELD>
|
115 |
|
|
<FIELD name="id">
|
116 |
|
|
<xsl:value-of select="$organizationId" />
|
117 |
|
|
</FIELD>
|
118 |
|
|
<FIELD name="legalname">
|
119 |
|
|
<xsl:value-of select="normalize-space(.//column[@name='ORGANIZATION_INVOLVED'])" />
|
120 |
53946
|
miriam.bag
|
</FIELD>
|
121 |
53335
|
miriam.bag
|
<FIELD name="country">
|
122 |
|
|
<xsl:value-of select="string('IT')" />
|
123 |
53946
|
miriam.bag
|
</FIELD>
|
124 |
52333
|
miriam.bag
|
<FIELD name="collectedfrom">
|
125 |
52372
|
miriam.bag
|
<xsl:value-of select="$varDataSourceId" />
|
126 |
52333
|
miriam.bag
|
</FIELD>
|
127 |
|
|
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
|
128 |
52337
|
miriam.bag
|
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
|
129 |
52333
|
miriam.bag
|
</ROW>
|
130 |
|
|
<ROW table="project_organization">
|
131 |
|
|
<FIELD name="_dnet_resource_identifier_">
|
132 |
|
|
<xsl:value-of select='concat($projectId, "@@", $organizationId)' />
|
133 |
|
|
</FIELD>
|
134 |
|
|
<FIELD name="project">
|
135 |
|
|
<xsl:value-of select="$projectId" />
|
136 |
|
|
</FIELD>
|
137 |
53946
|
miriam.bag
|
<FIELD name="resporganization">
|
138 |
52333
|
miriam.bag
|
<xsl:value-of select="$organizationId" />
|
139 |
|
|
</FIELD>
|
140 |
52369
|
miriam.bag
|
<FIELD name="semanticclass">coordinator</FIELD>
|
141 |
52333
|
miriam.bag
|
</ROW>
|
142 |
53946
|
miriam.bag
|
</xsl:if>
|
143 |
52333
|
miriam.bag
|
</ROWS>
|
144 |
|
|
</metadata>
|
145 |
|
|
</record>
|
146 |
|
|
</xsl:template>
|
147 |
|
|
</xsl:stylesheet>
|
148 |
53218
|
miriam.bag
|
]]>
|
149 |
52333
|
miriam.bag
|
</CODE>
|
150 |
|
|
</SCRIPT>
|
151 |
|
|
</CONFIGURATION>
|
152 |
|
|
<STATUS/>
|
153 |
|
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
154 |
|
|
</BODY>
|
155 |
|
|
</RESOURCE_PROFILE>
|