Project

General

Profile

« Previous | Next » 

Revision 58051

#5297: mappings for the European Environment Agency

View differences:

modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/entityreg-contexts/xsl/european_environment_agency_context.xsl
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3

  
4
    <xsl:output indent="yes"/>
5

  
6
    <xsl:template match="/">
7
        <fundings>
8
            <fundingtree>
9
                <funder>
10
                    <id>euenvagency_::EEA</id>
11
                    <shortname>EEA</shortname>
12
                    <name>European Environment Agency</name>
13
                    <originalname>European Environment Agency</originalname>
14
                    <jurisdiction>EU</jurisdiction>
15
                </funder>
16
            </fundingtree>
17
        </fundings>
18
    </xsl:template>
19
</xsl:stylesheet>
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/european_environment_agency2db.xml
1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="fc9edb48-2c51-47ee-8820-01da49058668_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2019-09-26T15:17:56+02:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <IMPORTED/>
12
            <SCRIPT>
13
                <TITLE>Europan Environment Agency to DB</TITLE>
14
                <CODE><![CDATA[
15
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
16
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions"
17
    exclude-result-prefixes="xs" version="2.0">
18

  
19
     <xsl:param name="varDataSourceId"/>
20

  
21
    <xsl:param name="quote">"</xsl:param>
22
    <xsl:variable name="namespacePrefix" select="string('euenvagency_')"/>
23
    <xsl:variable name="funderID" select="concat($namespacePrefix, '::EEA')"/>
24

  
25
    <xsl:variable name="fundingID">
26
        <xsl:value-of select="$funderID"/>
27
    </xsl:variable>
28

  
29
    <xsl:variable name="projectId" select="concat($namespacePrefix, '::',  normalize-space(.//column[@name='Project identifier']))"/>
30
    <xsl:variable name="startDate" select="normalize-space(.//column[@name='Start date'])"/>
31
    <xsl:variable name="endDate" select="normalize-space(.//column[@name='End date'])"/>
32
    <xsl:variable name="dateFormat" select="string('dd/MM/YYYY')"/>
33
    <xsl:variable name="projectTitle" select="normalize-space(.//column[@name='Project title'])"/>
34
    <xsl:variable name="projectAcronym" select="normalize-space(.//column[@name='Project acronym'])"/>
35

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

  
43
                        <ROW table="projects">
44
                            <FIELD name="_dnet_resource_identifier_">
45
                                <xsl:value-of select="$projectId"/>
46
                            </FIELD>
47
                            <FIELD name="id">
48
                                <xsl:value-of select="$projectId"/>
49
                            </FIELD>
50
                            <FIELD name="code">
51
                                <xsl:value-of select="$projectAcronym"/>
52
                            </FIELD>
53
                            <FIELD name="acronym"><xsl:value-of select="$projectAcronym"/></FIELD>
54
                             <FIELD name="title">
55
                                <xsl:value-of select="$projectTitle"/>
56
                            </FIELD>
57
                            <FIELD name="startdate" type="date" format="{$dateFormat}">
58
                                <xsl:value-of select="$startDate"/>
59
                            </FIELD>
60
                            <FIELD name="enddate" type="date" format="{$dateFormat}">
61
                                <xsl:value-of select="$endDate"/>
62
                            </FIELD>
63
                            <!-- only from 2020: all these projects started before -->
64
                            <FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
65
                            <FIELD name="summary">
66
                                <xsl:value-of select=".//column[@name='Projects description']"/>
67
                            </FIELD>
68
                             <FIELD name="collectedfrom">
69
                                <xsl:value-of select="$varDataSourceId"/>
70
                            </FIELD>
71
                            <FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
72
                            <FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
73
                        </ROW>
74

  
75
                        <ROW table="project_fundingpath">
76
                            <FIELD name="_dnet_resource_identifier_">
77
                                <xsl:value-of select="concat($fundingID,'@@', $projectId)"/>
78
                            </FIELD>
79
                            <FIELD name="funding">
80
                                <xsl:value-of select="$fundingID"/>
81
                            </FIELD>
82
                            <FIELD name="project">
83
                                <xsl:value-of select="$projectId"/>
84
                            </FIELD>
85
                            <FIELD name="startdate" type="date" format="{$dateFormat}">
86
                                <xsl:value-of select="$startDate"/>
87
                            </FIELD>
88
                            <FIELD name="enddate" type="date" format="{$dateFormat}">
89
                                <xsl:value-of select="$endDate"/>
90
                            </FIELD>
91
                        </ROW>
92

  
93
                        <xsl:variable name="organizationName" select="normalize-space(.//column[@name='organisations involved (Name)'])"/>
94
                        <xsl:variable name="organizationId" select="concat($namespacePrefix,'::',utils:md5($organizationName))"/>
95
                        <ROW table = "dsm_organizations">
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:choose>
104
                                <xsl:when test="string-length($organizationName) > 255">
105
                                    <xsl:value-of select="substring($organizationName,0,254)"/>
106
                                </xsl:when>
107
                                <xsl:otherwise>
108
                                    <xsl:value-of select="$organizationName"/>
109
                                </xsl:otherwise>
110
                            </xsl:choose>
111
                        </FIELD>
112
                        <FIELD name="country">
113
                            <xsl:value-of select="tokenize(.//column[@name='organisations involved (address of coordinator)'],' ')[last()]"/>
114
                        </FIELD>
115
                        <FIELD name="collectedfrom">
116
                            <xsl:value-of select="$varDataSourceId"/>
117
                        </FIELD>
118
                        <FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
119
                    </ROW>
120
                    <ROW table="project_organization">
121
                        <FIELD name="_dnet_resource_identifier_">
122
                            <xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
123
                        </FIELD>
124
                        <FIELD name="project">
125
                            <xsl:value-of select="$projectId"/>
126
                        </FIELD>
127
                        <FIELD name="resporganization">
128
                            <xsl:value-of select="$organizationId"/>
129
                        </FIELD>
130
                        <FIELD name="semanticclass">coordinator</FIELD>
131
                    </ROW>
132
                </ROWS>
133
                </xsl:if>
134
            </metadata>
135
        </record>
136

  
137
    </xsl:template>
138
</xsl:stylesheet>
139
                ]]>
140

  
141
                </CODE>
142
            </SCRIPT>
143
        </CONFIGURATION>
144
        <STATUS/>
145
        <SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
146
    </BODY>
147
</RESOURCE_PROFILE>

Also available in: Unified diff