1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
3
|
|
4
|
<xsl:param name="parentDatasourceId"/>
|
5
|
<xsl:param name="namespacePrefix" select="string('snsf_________')"/>
|
6
|
<xsl:param name="quote">"</xsl:param>
|
7
|
|
8
|
<xsl:template match="/">
|
9
|
<record>
|
10
|
|
11
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
12
|
<metadata>
|
13
|
<ROWS>
|
14
|
<xsl:if test="string-length(normalize-space(.//column[@name='Project Title'])) > 0 and string-length(normalize-space(.//column[@name='Project Number'])) > 0">
|
15
|
|
16
|
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Project Number']))"/>
|
17
|
|
18
|
<xsl:variable name="orgId" select="concat($namespacePrefix, '::', translate(normalize-space(.//column[@name='Institution']), ' ,.', '___'))"/>
|
19
|
|
20
|
<xsl:variable name="startDate" select=".//column[@name='Start Date']"/>
|
21
|
<xsl:variable name="endDate" select=".//column[@name='End Date']"/>
|
22
|
|
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="normalize-space(.//column[@name='Project Number String'])"/>
|
32
|
</FIELD>
|
33
|
<FIELD name="startdate" type="date" format="dd.MM.yyyy">
|
34
|
<xsl:value-of select="$startDate"/>
|
35
|
</FIELD>
|
36
|
<FIELD name="enddate" type="date" format="dd.MM.yyyy">
|
37
|
<xsl:value-of select="$endDate"/>
|
38
|
</FIELD>
|
39
|
<FIELD name="title">
|
40
|
<xsl:value-of select=".//column[@name='Project Title']"/>
|
41
|
</FIELD>
|
42
|
<FIELD name="acronym"></FIELD>
|
43
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
44
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
45
|
<FIELD name="collectedfrom">
|
46
|
<xsl:value-of select="$parentDatasourceId"/>
|
47
|
</FIELD>
|
48
|
<!-- <FIELD name="???"><xsl:value-of select=".//AbstractNarration" /></FIELD> -->
|
49
|
</ROW>
|
50
|
|
51
|
<ROW table="organizations">
|
52
|
<FIELD name="_dnet_resource_identifier_">
|
53
|
<xsl:value-of select="$orgId"/>
|
54
|
</FIELD>
|
55
|
<FIELD name="id">
|
56
|
<xsl:value-of select="$orgId"/>
|
57
|
</FIELD>
|
58
|
<FIELD name="legalname">
|
59
|
<xsl:value-of select=".//column[@name='Institution']"/>
|
60
|
</FIELD>
|
61
|
<FIELD name="collectedfrom">
|
62
|
<xsl:value-of select="$parentDatasourceId"/>
|
63
|
</FIELD>
|
64
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
65
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
66
|
<FIELD name="optional1">
|
67
|
<xsl:value-of select=".//column[@name='University']"/>
|
68
|
</FIELD>
|
69
|
</ROW>
|
70
|
|
71
|
<!-- personId built from projectId to handle homonyms -->
|
72
|
<xsl:variable name="personName" select="normalize-space(.//column[@name='Responsible Applicant'])"/>
|
73
|
<xsl:variable name="personId" select="concat($projectId, '::', translate($personName, ' ,.', '___'))"/>
|
74
|
|
75
|
<xsl:if test="string-length($personName) > 0">
|
76
|
<ROW table="persons">
|
77
|
<FIELD name="_dnet_resource_identifier_">
|
78
|
<xsl:value-of select="$personId"/>
|
79
|
</FIELD>
|
80
|
<FIELD name="id">
|
81
|
<xsl:value-of select="$personId"/>
|
82
|
</FIELD>
|
83
|
<FIELD name="firstname">
|
84
|
<xsl:value-of select="$personName"/>
|
85
|
</FIELD>
|
86
|
<FIELD name="collectedfrom">
|
87
|
<xsl:value-of select="$parentDatasourceId"/>
|
88
|
</FIELD>
|
89
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
90
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
91
|
</ROW>
|
92
|
</xsl:if>
|
93
|
|
94
|
<ROW table="project_organization">
|
95
|
<FIELD name="_dnet_resource_identifier_">
|
96
|
<xsl:value-of select="concat($projectId, '@@', $orgId)"/>
|
97
|
</FIELD>
|
98
|
<FIELD name="participantnumber" type="int">1</FIELD>
|
99
|
<FIELD name="startdate" type="date" format="dd.MM.yyyy">
|
100
|
<xsl:value-of select="$startDate"/>
|
101
|
</FIELD>
|
102
|
<FIELD name="enddate" type="date" format="dd.MM.yyyy">
|
103
|
<xsl:value-of select="$endDate"/>
|
104
|
</FIELD>
|
105
|
<FIELD name="project">
|
106
|
<xsl:value-of select="$projectId"/>
|
107
|
</FIELD>
|
108
|
<FIELD name="resporganization">
|
109
|
<xsl:value-of select="$orgId"/>
|
110
|
</FIELD>
|
111
|
<xsl:if test="string-length($personName) > 0">
|
112
|
<FIELD name="contactperson">
|
113
|
<xsl:value-of select="concat($projectId, '::', translate($personName, ' ,.', '___'))"/>
|
114
|
</FIELD>
|
115
|
</xsl:if>
|
116
|
<FIELD name="semanticclass">coordinator</FIELD>
|
117
|
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
|
118
|
</ROW>
|
119
|
|
120
|
<xsl:variable name="p0" select="normalize-space(.//column[@name='Funding Instrument Hierarchy'])"/>
|
121
|
<xsl:variable name="p1" select="normalize-space(.//column[@name='Funding Instrument'])"/>
|
122
|
|
123
|
<xsl:variable name="fundingId">
|
124
|
<xsl:choose>
|
125
|
<xsl:when test="(string-length($p0) > 0) and (string-length($p1) > 0)">
|
126
|
<xsl:value-of select="concat($namespacePrefix, '::SNSF::', $p0, '::', $p1)"/>
|
127
|
</xsl:when>
|
128
|
<xsl:when test="string-length($p0) > 0">
|
129
|
<xsl:value-of select="concat($namespacePrefix, '::SNSF::', $p0)"/>
|
130
|
</xsl:when>
|
131
|
<xsl:when test="string-length($p1) > 0">
|
132
|
<xsl:value-of select="concat($namespacePrefix, '::SNSF::', $p1)"/>
|
133
|
</xsl:when>
|
134
|
</xsl:choose>
|
135
|
</xsl:variable>
|
136
|
|
137
|
<ROW table="project_fundingpath">
|
138
|
<FIELD name="_dnet_resource_identifier_">
|
139
|
<xsl:value-of select="concat(normalize-space($fundingId),'@@', $projectId)"/>
|
140
|
</FIELD>
|
141
|
<FIELD name="funding">
|
142
|
<xsl:value-of select="normalize-space($fundingId)"/>
|
143
|
</FIELD>
|
144
|
<FIELD name="project">
|
145
|
<xsl:value-of select="$projectId"/>
|
146
|
</FIELD>
|
147
|
<FIELD name="startdate" type="date" format="dd.MM.yyyy">
|
148
|
<xsl:value-of select="$startDate"/>
|
149
|
</FIELD>
|
150
|
<FIELD name="enddate" type="date" format="dd.MM.yyyy">
|
151
|
<xsl:value-of select="$endDate"/>
|
152
|
</FIELD>
|
153
|
</ROW>
|
154
|
|
155
|
</xsl:if>
|
156
|
</ROWS>
|
157
|
</metadata>
|
158
|
</record>
|
159
|
</xsl:template>
|
160
|
|
161
|
</xsl:stylesheet>
|