Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions"
4
                exclude-result-prefixes="xs" version="2.0">
5

    
6
    <xsl:param name="parentDatasourceId"/>
7
    <xsl:param name="namespacePrefix"/>
8
    <xsl:param name="quote">"</xsl:param>
9

    
10
    <xsl:variable name="funderID" select="concat($namespacePrefix, '::AKA')"/>
11

    
12

    
13

    
14
    <xsl:variable name="stream" select="normalize-space(.//column[@name='FUNDING STREAM(S)'])"/>
15
    <xsl:variable name="fundingID">
16

    
17
        <xsl:value-of select="$funderID"/>
18
    </xsl:variable>
19

    
20
    <xsl:variable name="projectId" select="concat($namespacePrefix, '::',  normalize-space(.//column[@name='Decision No.']))"/>
21

    
22
    <xsl:variable name="fundingPeriod" select="tokenize(.//column[@name='Funding period'],'-')"/>
23
    <xsl:variable name="startDate" select="normalize-space($fundingPeriod[1])"/>
24
    <xsl:variable name="endDate" select="normalize-space($fundingPeriod[2])"/>
25

    
26
    <xsl:variable name="dateFormat" select="string('dd.MM.yyyy')"/>
27
    <xsl:variable name="projectTitle" select="normalize-space(.//column[@name='Project title'])"/>
28

    
29
    <xsl:template match="/">
30

    
31

    
32

    
33
        <record>
34

    
35
            <xsl:copy-of select=".//*[local-name()='header']"/>
36
            <metadata>
37
                <xsl:if test="string-length($projectTitle) &gt; 0 and string-length($projectId) &gt; 0">
38
                    <ROWS>
39

    
40
                        <ROW table="projects">
41
                            <FIELD name="_dnet_resource_identifier_">
42
                                <xsl:value-of select="$projectId"/>
43
                            </FIELD>
44
                            <FIELD name="id">
45
                                <xsl:value-of select="$projectId"/>
46
                            </FIELD>
47
                            <FIELD name="code">
48
                                <xsl:value-of select="normalize-space(.//column[@name='Decision No.'])"/>
49
                            </FIELD>
50
                            <FIELD name="startdate" type="date" format="{$dateFormat}">
51
                                <xsl:value-of select="$startDate"/>
52
                            </FIELD>
53
                            <FIELD name="enddate" type="date" format="{$dateFormat}">
54
                                <xsl:value-of select="$endDate"/>
55
                            </FIELD>
56
                            <FIELD name="title">
57
                                <xsl:value-of select="$projectTitle"/>
58
                            </FIELD>
59
                            <FIELD name="call_identifier">
60
                                <xsl:value-of select=".//column[@name='Call']"/>
61
                            </FIELD>
62
                       <!--     <FIELD name="contactfullname">
63
                                <xsl:value-of select=".//column[@name='Name']"/>
64
                            </FIELD> -->
65
                            <FIELD name="optional1">
66
                                <xsl:value-of select="concat(.//column[@name='Funding'], ' €')"/>
67
                            </FIELD>
68
                            <FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
69
                            <FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
70
                            <FIELD name="collectedfrom">
71
                                <xsl:value-of select="$parentDatasourceId"/>
72
                            </FIELD>
73

    
74
                            <FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
75

    
76
                        </ROW>
77

    
78

    
79

    
80
                        <ROW table="project_fundingpath">
81
                            <FIELD name="_dnet_resource_identifier_">
82
                                <xsl:value-of select="concat($fundingID,'@@', $projectId)"/>
83
                            </FIELD>
84
                            <FIELD name="funding">
85
                                <xsl:value-of select="$fundingID"/>
86
                            </FIELD>
87
                            <FIELD name="project">
88
                                <xsl:value-of select="$projectId"/>
89
                            </FIELD>
90
                            <FIELD name="startdate" type="date" format="{$dateFormat}">
91
                                <xsl:value-of select="$startDate"/>
92
                            </FIELD>
93
                            <FIELD name="enddate" type="date" format="{$dateFormat}">
94
                                <xsl:value-of select="$endDate"/>
95
                            </FIELD>
96
                        </ROW>
97
                        <xsl:variable name="organizationId" select="concat($namespacePrefix,'::',utils:md5(normalize-space(.//column[@name='Organisation'])))"/>
98
                        <ROW table = "organizations">
99
                            <FIELD name="_dnet_resource_identifier_">
100
                                <xsl:value-of select="$organizationId"/>
101
                            </FIELD>
102
                            <FIELD name="id">
103
                                <xsl:value-of select="$organizationId"/>
104
                            </FIELD>
105
                            <FIELD name="legalname">
106
                                <xsl:value-of select="normalize-space(.//column[@name='Organisation'])"/>
107
                            </FIELD>
108
                            <FIELD name="collectedfrom">
109
                                <xsl:value-of select="$parentDatasourceId"/>
110
                            </FIELD>
111
                            <FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
112
                            <FIELD name="provenanceActionScheme">dnet:provenanceActions</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

    
126
                            <FIELD name="semanticclass">participant</FIELD>
127
                            <FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
128
                        </ROW>
129
                    </ROWS>
130
                </xsl:if>
131
            </metadata>
132
        </record>
133

    
134
    </xsl:template>
135
</xsl:stylesheet>
(1-1/31)