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"
|
4
|
exclude-result-prefixes="xs" version="2.0">
|
5
|
|
6
|
<xsl:param name="parentDatasourceId"/>
|
7
|
<xsl:param name="namespacePrefix"/>
|
8
|
|
9
|
<xsl:template match="/">
|
10
|
|
11
|
<xsl:variable name="prefix" select="string('sfi_________')"/>
|
12
|
|
13
|
<record>
|
14
|
|
15
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
16
|
|
17
|
<metadata>
|
18
|
<ROWS>
|
19
|
<xsl:if test="normalize-space(.//column[@name='Proposal ID']) and normalize-space(.//column[@name='Project Title'])">
|
20
|
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Proposal ID']))"/>
|
21
|
<xsl:variable name="startDate" select=".//column[@name='Start Date']"/>
|
22
|
<xsl:variable name="endDate" select=".//column[@name='End Date']"/>
|
23
|
<ROW table="projects">
|
24
|
<FIELD name="_dnet_resource_identifier_">
|
25
|
<xsl:value-of select="$projectId"/>
|
26
|
</FIELD>
|
27
|
<FIELD name="id">
|
28
|
<xsl:value-of select="$projectId"/>
|
29
|
</FIELD>
|
30
|
<FIELD name="code">
|
31
|
<xsl:value-of select=".//column[@name='Proposal ID']"/>
|
32
|
</FIELD>
|
33
|
<FIELD name="title">
|
34
|
<xsl:value-of select=".//column[@name='Project Title']"/>
|
35
|
</FIELD>
|
36
|
<FIELD name="startdate" type="date" format="dd/MM/yyyy">
|
37
|
<xsl:value-of select="$startDate"/>
|
38
|
</FIELD>
|
39
|
<FIELD name="enddate" type="date" format="dd/MM/yyyy">
|
40
|
<xsl:value-of select="$endDate"/>
|
41
|
</FIELD>
|
42
|
<FIELD name="collectedfrom">
|
43
|
<xsl:value-of select="$parentDatasourceId"/>
|
44
|
</FIELD>
|
45
|
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD>
|
46
|
<!-- 30/06/2016 must be converted into 2016-06-30-->
|
47
|
<xsl:variable name="date" select="xs:date(concat(
|
48
|
substring($startDate,7,4),'-',
|
49
|
substring($startDate,4,2),'-',
|
50
|
substring($startDate,1,2)))"/>
|
51
|
<FIELD name="oa_mandate_for_publications" type="boolean"><xsl:value-of select="$date >= xs:date('2009-01-01')"/> </FIELD>
|
52
|
</ROW>
|
53
|
|
54
|
<xsl:if test="normalize-space(.//column[@name='Programme Name'])">
|
55
|
<xsl:variable name="funderId" select="concat($prefix, '::SFI')"/>
|
56
|
<xsl:variable name="fundingId" select="concat($funderId, '::', normalize-space(.//column[@name='Programme Name']))"/>
|
57
|
<ROW table="project_fundingpath">
|
58
|
<FIELD name="_dnet_resource_identifier_">
|
59
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
60
|
</FIELD>
|
61
|
<FIELD name="funding">
|
62
|
<xsl:value-of select="$fundingId"/>
|
63
|
</FIELD>
|
64
|
<FIELD name="project">
|
65
|
<xsl:value-of select="$projectId"/>
|
66
|
</FIELD>
|
67
|
<FIELD name="startdate" type="date" format="dd/MM/yyyy">
|
68
|
<xsl:value-of select="$startDate"/>
|
69
|
</FIELD>
|
70
|
<FIELD name="enddate" type="date" format="dd/MM/yyyy">
|
71
|
<xsl:value-of select="$endDate"/>
|
72
|
</FIELD>
|
73
|
</ROW>
|
74
|
</xsl:if>
|
75
|
|
76
|
<xsl:if test="normalize-space(.//column[@name='Research Body'])">
|
77
|
<xsl:variable name="organizationId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Research Body']))"/>
|
78
|
<ROW table="organizations">
|
79
|
<FIELD name="_dnet_resource_identifier_">
|
80
|
<xsl:value-of select="$organizationId"/>
|
81
|
</FIELD>
|
82
|
<FIELD name="id">
|
83
|
<xsl:value-of select="$organizationId"/>
|
84
|
</FIELD>
|
85
|
<FIELD name="legalname">
|
86
|
<xsl:value-of select=".//column[@name='Research Body']"/>
|
87
|
</FIELD>
|
88
|
<FIELD name="countryclass">IE</FIELD>
|
89
|
<FIELD name="countryscheme">dnet:countries</FIELD>
|
90
|
<FIELD name="collectedfrom">
|
91
|
<xsl:value-of select="$parentDatasourceId"/>
|
92
|
</FIELD>
|
93
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
94
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
95
|
</ROW>
|
96
|
<ROW table="project_organization">
|
97
|
<FIELD name="_dnet_resource_identifier_">
|
98
|
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
|
99
|
</FIELD>
|
100
|
<FIELD name="project">
|
101
|
<xsl:value-of select="$projectId"/>
|
102
|
</FIELD>
|
103
|
<FIELD name="resporganization">
|
104
|
<xsl:value-of select="$organizationId"/>
|
105
|
</FIELD>
|
106
|
<FIELD name="participantnumber" type="int">1</FIELD>
|
107
|
<FIELD name="semanticclass">coordinator</FIELD>
|
108
|
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
|
109
|
</ROW>
|
110
|
</xsl:if>
|
111
|
</xsl:if>
|
112
|
</ROWS>
|
113
|
</metadata>
|
114
|
</record>
|
115
|
</xsl:template>
|
116
|
|
117
|
</xsl:stylesheet>
|