Project

General

Profile

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

    
22
    <xsl:variable name="dateFormat" select="string('dd-MM-yy')"/>
23
    <xsl:variable name="funderID" select="concat($namespacePrefix, '::INNOVIRIS')"/>
24
    <xsl:variable name="fundingId">
25
        <xsl:value-of
26
            select="concat($funderID, '::', translate(.//column[@name = 'FUNDING_STREAM'], ' ', ''))"
27
        />
28
    </xsl:variable>
29
<xsl:param name="quote">"</xsl:param>
30
    <xsl:variable name="organizationId" select="concat($namespacePrefix,'::',utils:md5(.//column[@name='PROJECT_PARTNER/BENEFICIARY']))"/>
31

    
32
    <xsl:template match="/">
33
        <record>
34

    
35
            <xsl:copy-of select=".//*[local-name() = 'header']"/>
36

    
37
            <metadata>
38
                <ROWS>
39
                    <xsl:variable name="projectId"
40
                        select="concat($namespacePrefix, '::', normalize-space(.//column[@name = 'PROJECT_ID']))"/>
41
                    <xsl:variable name="startDate"
42
                        select=".//column[@name = 'PROJECT_START_DATE']"/>
43
                    <xsl:variable name="endDate"
44
                        select=".//column[@name = 'PROJECT_END_DATE']"/>
45
                    <ROW table="projects">
46
                        <FIELD name="_dnet_resource_identifier_">
47
                            <xsl:value-of select="$projectId"/>
48
                        </FIELD>
49
                        <FIELD name="id">
50
                            <xsl:value-of select="$projectId"/>
51
                        </FIELD>
52
                        <FIELD name="code">
53
                            <xsl:value-of
54
                                select="normalize-space(.//column[@name = 'PROJECT_ID'])"/>
55
                        </FIELD>
56
                        <FIELD name="title">
57
                            <xsl:value-of select=".//column[@name = 'PROJECT_TITLE']"/>
58
                        </FIELD>
59

    
60
                        <FIELD name="startdate" type="date" format="{$dateFormat}">
61
                            <xsl:value-of select="$startDate"/>
62
                        </FIELD>
63
                        <FIELD name="enddate" type="date" format="{$dateFormat}">
64
                            <xsl:value-of select="$endDate"/>
65
                        </FIELD>
66
                        <FIELD name="duration" type="int">
67
                            <xsl:value-of select=".//column[@name = 'PROJECT_DURATION']"/>
68
                        </FIELD>
69
                        <FIELD name="collectedfrom">
70
                            <xsl:value-of select="$parentDatasourceId"/>
71
                        </FIELD>
72
                        <FIELD name="provenanceActionClass"
73
                            >sysimport:crosswalk:entityregistry</FIELD>
74
                        <FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
75
                        <FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
76
                    </ROW>
77
                    <ROW table="project_fundingpath">
78
                        <FIELD name="_dnet_resource_identifier_">
79
                            <xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
80
                        </FIELD>
81
                        <FIELD name="funding">
82
                            <xsl:value-of select="$fundingId"/>
83
                        </FIELD>
84
                        <FIELD name="project">
85
                            <xsl:value-of select="$projectId"/>
86
                        </FIELD>
87
                        <FIELD name="startdate" type="date" format="{$dateFormat}">
88
                            <xsl:value-of select="$startDate"/>
89
                        </FIELD>
90
                        <FIELD name="enddate" type="date" format="{$dateFormat}">
91
                            <xsl:value-of select="$endDate"/>
92
                        </FIELD>
93
                    </ROW>
94
                    <ROW table="dsm_organizations">
95

    
96
                        <FIELD name="_dnet_resource_identifier_">
97
                            <xsl:value-of select="$organizationId" />
98
                        </FIELD>
99
                        <FIELD name="id">
100
                            <xsl:value-of select="$organizationId" />
101
                        </FIELD>
102
                        <FIELD name="legalname">
103
                            <xsl:value-of select="normalize-space(.//column[@name='PROJECT_PARTNER/BENEFICIARY'])" />
104
                        </FIELD>
105
                        <FIELD name="country">
106
                            <xsl:value-of select="string('BE')" />
107
                        </FIELD>
108
                        <FIELD name="collectedfrom">
109
                            <xsl:value-of select="$parentDatasourceId" />
110
                        </FIELD>
111
                        <FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
112
                        <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
113
                    </ROW>
114
                    <ROW table="project_organization">
115
                        <FIELD name="_dnet_resource_identifier_">
116
                            <xsl:value-of select='concat($projectId, "@@", $organizationId)' />
117
                        </FIELD>
118
                        <FIELD name="project">
119
                            <xsl:value-of select="$projectId" />
120
                        </FIELD>
121
                        <FIELD name="resporganization">
122
                            <xsl:value-of select="$organizationId" />
123
                        </FIELD>
124

    
125
                        <FIELD name="semanticclass">partecipant</FIELD>
126
                    </ROW>
127
                </ROWS>
128
            </metadata>
129
        </record>
130
    </xsl:template>
131
</xsl:stylesheet>
132

    
133
]]>
134
                </CODE>
135
            </SCRIPT>
136
        </CONFIGURATION>
137
        <STATUS/>
138
        <SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
139
    </BODY>
140
</RESOURCE_PROFILE>
(11-11/23)