Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr"
3
                xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oaa="http://namespace.openaire.eu/oaa" xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:fn="http://www.w3.org/2005/xpath-functions">
4

    
5
	<xsl:param name="parentDatasourceId" />
6

    
7
	<xsl:template name="dateCorda">
8
		<xsl:param name="datename" />
9
		<xsl:param name="datevalue" />
10
		<FIELD name="{$datename}" type="date" format="dd-MMM-yyyy"><xsl:value-of select="concat(substring($datevalue, 1, 2),'-',substring($datevalue,3,3),'-',substring($datevalue,6,4))" /></FIELD>
11
	</xsl:template>
12

    
13
	<xsl:variable name="namespacePrefix" select="string('ec__________')" />
14
	<xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')" />
15

    
16
	<xsl:template match="/">
17
		<record xmlns:dr="http://www.driver-repository.eu/namespace/dr"
18
		        xmlns:dri="http://www.driver-repository.eu/namespace/dri"
19
		        xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20
		        xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
21

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

    
24
			<metadata>
25
				<ROWS>
26
					<xsl:for-each select="//Project">
27

    
28
						<xsl:variable name="toaCode" select="./ProjectTOACode"/>
29
						<xsl:variable name="fundingId">
30
							<xsl:choose>
31
								<xsl:when test="$toaCode and starts-with($toaCode, 'ERC-')">
32
									<xsl:value-of select="concat($funderID, '::H2020::ERC::', $toaCode)"/>
33
								</xsl:when>
34
								<xsl:when test="$toaCode and not(starts-with($toaCode, 'ERC-'))">
35
									<xsl:value-of select="concat($funderID, '::H2020::', $toaCode)"/>
36
								</xsl:when>
37
								<xsl:otherwise>
38
									<xsl:value-of select="concat($funderID, '::H2020')"/>
39
								</xsl:otherwise>
40
							</xsl:choose>
41
						</xsl:variable>
42
						<xsl:variable name="projectId" select="concat('corda__h2020::', normalize-space(./ProjectId))"/>
43

    
44
						<ROW table="projects">
45
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectId" /></FIELD>
46
							<FIELD name="id"><xsl:value-of select="$projectId" /></FIELD>
47
							<FIELD name="code"><xsl:value-of select="./ProjectId" /></FIELD>
48
							<FIELD name="acronym"><xsl:value-of select="./ProjectAcronym" /></FIELD>
49
							<FIELD name="title"><xsl:value-of select="./ProjectTitle" /></FIELD>
50
							<xsl:call-template name="dateCorda">
51
								<xsl:with-param name="datename">startdate</xsl:with-param>
52
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
53
							</xsl:call-template>
54
							<xsl:call-template name="dateCorda">
55
								<xsl:with-param name="datename">enddate</xsl:with-param>
56
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
57
							</xsl:call-template>
58
							<FIELD name="call_identifier"><xsl:value-of select="./ProjectCallIdentifier" /></FIELD>
59
							<FIELD name="oa_mandate_for_publications" type="boolean">true</FIELD>
60
							<FIELD name="ec_article29_3" type="boolean"><xsl:value-of select="./Article29-3" /></FIELD>
61
							<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
62
							<FIELD name="contracttypeclass"><xsl:value-of select="./ProjectTOACode" /></FIELD>
63
							<FIELD name="contracttypescheme">ec:h2020toas</FIELD>
64
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
65
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
66
							<FIELD name="websiteurl"><xsl:value-of select="./ProjectInternetAddress" /></FIELD>
67
							<FIELD name="optional1"><xsl:value-of select="./ProjectTopicCode" /></FIELD>
68
							<FIELD name="optional2"><xsl:value-of select="./ProjectTopicDescr" /></FIELD>
69
						</ROW>
70

    
71
						<xsl:for-each select="./CoordinatorContactPerson">
72
							<xsl:if test="string-length(./PersonFirstName) &gt; 0 and string-length(./PersonLastName) &gt; 0">
73
								<xsl:variable name="personId" select="concat('corda__h2020::', ../ProjectId, '::', ./PersonFirstName, '_', ./PersonLastName)"></xsl:variable>
74
								<ROW table="persons">
75
									<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$personId" /></FIELD>
76
									<FIELD name="id"><xsl:value-of select="$personId" /></FIELD>
77
									<FIELD name="firstname"><xsl:value-of select="./PersonFirstName" /></FIELD>
78
									<FIELD name="secondnames"><xsl:value-of select="./PersonLastName" /></FIELD>
79
									<FIELD name="email"><xsl:value-of select="./ContactEmail" /></FIELD>
80
									<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
81
									<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
82
									<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
83
								</ROW>
84
							</xsl:if>
85
						</xsl:for-each>
86

    
87
						<xsl:for-each select="./OrganisationParticipant">
88
							<xsl:variable name="organizationId" select="concat('corda__h2020::', ./OrganisationPIC)" />
89

    
90
							<xsl:variable name="whitelist" select="'0123456789'"/>
91
							<ROW table="organizations">
92
								<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$organizationId" /></FIELD>
93
								<FIELD name="id"><xsl:value-of select="$organizationId" /></FIELD>
94
								<FIELD name="legalshortname"><xsl:value-of select="./OrganisationShortName" /></FIELD>
95
								<FIELD name="legalname"><xsl:value-of select="./OrganisationLegalName" /></FIELD>
96
								<FIELD name="websiteurl">
97
									<xsl:choose>
98
										<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')">
99
											<xsl:value-of select="./OrganisationWebPage" />
100
										</xsl:when>
101
										<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) &gt; 0">
102
											<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))" />
103
										</xsl:when>
104
									</xsl:choose>
105
								</FIELD>
106
								<FIELD name="ec_legalbody" type="boolean"><xsl:value-of select="./PublicBody" /></FIELD>
107
								<FIELD name="ec_legalperson" type="boolean"><xsl:value-of select="./LegalPerson" /></FIELD>
108
								<FIELD name="ec_nonprofit" type="boolean"><xsl:value-of select="./NonProfit" /></FIELD>
109
								<FIELD name="ec_researchorganization" type="boolean"><xsl:value-of select="./ResearchOrganisation" /></FIELD>
110
								<FIELD name="ec_highereducation" type="boolean"><xsl:value-of select="./HigherEducation" /></FIELD>
111
								<FIELD name="ec_internationalorganizationeurinterests" type="boolean"><xsl:value-of select="./InternationalOrgEurInterest" /></FIELD>
112
								<FIELD name="ec_internationalorganization" type="boolean"><xsl:value-of select="./InternationalOrgEurInterest" /></FIELD>
113
								<FIELD name="ec_smevalidated" type="boolean"><xsl:value-of select="./SMEValidated" /></FIELD>
114
								<FIELD name="countryclass"><xsl:value-of select="./OrganisationCountry" /></FIELD>
115
								<FIELD name="countryscheme">dnet:countries</FIELD>
116
								<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
117
								<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
118
								<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
119
								<FIELD name="trust" type="float"><xsl:value-of select="0.92" /></FIELD>
120
							</ROW>
121

    
122
							<ROW table="project_organization">
123
								<FIELD name="_dnet_resource_identifier_"><xsl:value-of select='concat($projectId, "@@", $organizationId)' /></FIELD>
124
								<xsl:choose>
125
									<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0" >
126
										<FIELD name="participantnumber" type="int">9999</FIELD>
127
									</xsl:when>
128
									<xsl:otherwise>
129
										<FIELD name="participantnumber" type="int"><xsl:value-of select="./ParticipantOrder" /></FIELD>
130
									</xsl:otherwise>
131
								</xsl:choose>
132
								<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
133
								<FIELD name="resporganization"><xsl:value-of select="$organizationId" /></FIELD>
134
								<xsl:choose>
135
									<xsl:when test="./ParticipantOrder = 1">
136
										<FIELD name="contactperson"><xsl:value-of select="concat($projectId, '::', ..//CoordinatorContactPerson/PersonFirstName, '_', ../CoordinatorContactPerson/PersonLastName)"></xsl:value-of></FIELD>
137
										<FIELD name="semanticclass">coordinator</FIELD>
138
									</xsl:when>
139
									<xsl:otherwise>
140
										<FIELD name="contactperson"></FIELD>
141
										<FIELD name="semanticclass">participant</FIELD>
142
									</xsl:otherwise>
143
								</xsl:choose>
144
								<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
145
							</ROW>
146
						</xsl:for-each>
147

    
148
						<ROW table="subjects">
149
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))" /></FIELD>
150
							<FIELD name="id"><xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))" /></FIELD>
151
							<FIELD name="name"><xsl:value-of select="./ProjectTopicDescr" /></FIELD>
152
							<FIELD name="semanticclass">ec:h2020topics</FIELD>
153
							<FIELD name="semanticscheme">dnet:subject_classification_typologies</FIELD>
154
						</ROW>
155

    
156
						<ROW table="project_subject">
157
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($projectId, '@@corda__h2020::', normalize-space(./ProjectTopicCode))" /></FIELD>
158
							<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
159
							<FIELD name="subject"><xsl:value-of select="concat('corda__h2020::', normalize-space(./ProjectTopicCode))" /></FIELD>
160
						</ROW>
161

    
162
						<ROW table="project_fundingpath">
163
							<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($fundingId, '@@', $projectId)" /></FIELD>
164
							<FIELD name="funding"><xsl:value-of select="$fundingId" /></FIELD>
165
							<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
166
							<xsl:call-template name="dateCorda">
167
								<xsl:with-param name="datename">startdate</xsl:with-param>
168
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
169
							</xsl:call-template>
170
							<xsl:call-template name="dateCorda">
171
								<xsl:with-param name="datename">enddate</xsl:with-param>
172
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
173
							</xsl:call-template>
174
							<FIELD name="semanticclass"><xsl:value-of select="./ProjectTOACode" /></FIELD>
175
							<FIELD name="semanticscheme">ec:h2020toas</FIELD>
176
						</ROW>
177
					</xsl:for-each>
178

    
179
				</ROWS>
180
			</metadata>
181
		</record>
182
	</xsl:template>
183
</xsl:stylesheet>
(6-6/31)