1 |
26600
|
sandro.lab
|
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
48139
|
alessia.ba
|
<xsl:stylesheet xmlns:fwf="eu.dnetlib.data.transform.xml.FWFXsltFunctions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
3 |
26600
|
sandro.lab
|
|
4 |
42419
|
alessia.ba
|
<xsl:param name="parentDatasourceId"/>
|
5 |
|
|
<xsl:param name="namespacePrefix"/>
|
6 |
26600
|
sandro.lab
|
|
7 |
44091
|
alessia.ba
|
<xsl:variable name="funderID" select="concat($namespacePrefix, '::FWF')"/>
|
8 |
48139
|
alessia.ba
|
|
9 |
48959
|
claudio.at
|
<xsl:variable name="projectFundingAndNumber" select="normalize-space(//column[@name='project number'])"/>
|
10 |
|
|
<xsl:variable name="fundingCode" select="normalize-space(substring-before($projectFundingAndNumber, '–'))"/>
|
11 |
|
|
<xsl:variable name="projectNumber" select="normalize-space(substring-after($projectFundingAndNumber, '–'))"/>
|
12 |
|
|
<xsl:variable name="projectID" select="concat($namespacePrefix, '::', concat($fundingCode, '_', $projectNumber))"/>
|
13 |
|
|
<xsl:variable name="projectTitle" select="//column[@name='project title']"/>
|
14 |
42419
|
alessia.ba
|
|
15 |
26600
|
sandro.lab
|
<xsl:template match="/">
|
16 |
48959
|
claudio.at
|
<record>
|
17 |
|
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
18 |
|
|
<metadata>
|
19 |
|
|
<xsl:if test="string-length($projectTitle) > 0 and
|
20 |
48940
|
alessia.ba
|
string-length($projectID) > 0 and
|
21 |
|
|
//column[@name='status'] != 'canceled'">
|
22 |
48139
|
alessia.ba
|
|
23 |
48959
|
claudio.at
|
<xsl:variable name="projectCode" select="concat($fundingCode,' ', $projectNumber)"/>
|
24 |
|
|
<xsl:variable name="startDate" select=".//column[@name='from']"/>
|
25 |
|
|
<xsl:variable name="endDate" select=".//column[@name='till']"/>
|
26 |
|
|
<xsl:variable name="dateFormat" select="string('yyyy-MM-dd')"/>
|
27 |
|
|
<xsl:variable name="organizationId" select="concat($namespacePrefix, '::', fwf:getMd5(normalize-space(.//column[@name='research place and institute'])))"/>
|
28 |
|
|
<xsl:variable name="fundingID">
|
29 |
|
|
<xsl:choose>
|
30 |
|
|
<xsl:when test="string-length($fundingCode) > 0">
|
31 |
|
|
<xsl:value-of select="concat($funderID, '::', $fundingCode)"/>
|
32 |
|
|
</xsl:when>
|
33 |
|
|
<xsl:otherwise>
|
34 |
|
|
<xsl:value-of select="$funderID"/>
|
35 |
|
|
</xsl:otherwise>
|
36 |
|
|
</xsl:choose>
|
37 |
|
|
</xsl:variable>
|
38 |
48139
|
alessia.ba
|
|
39 |
|
|
<ROWS>
|
40 |
42419
|
alessia.ba
|
<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 |
48139
|
alessia.ba
|
<xsl:value-of select="$projectCode"/>
|
49 |
42419
|
alessia.ba
|
</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 |
48139
|
alessia.ba
|
<xsl:value-of select="$projectTitle"/>
|
58 |
42419
|
alessia.ba
|
</FIELD>
|
59 |
48947
|
miriam.bag
|
<FIELD name ="contactfullname">
|
60 |
48959
|
claudio.at
|
<xsl:value-of select="normalize-space(.//column[@name='project lead'])"/>
|
61 |
48947
|
miriam.bag
|
</FIELD>
|
62 |
48139
|
alessia.ba
|
<FIELD name="keywords">
|
63 |
|
|
<xsl:value-of select=".//column[@name='keywords']"/>
|
64 |
|
|
</FIELD>
|
65 |
|
|
<FIELD name="optional1">
|
66 |
|
|
<xsl:variable name="grantAmount" select=".//column[@name='grants awarded']"/>
|
67 |
|
|
<xsl:variable name="tmp" select="substring(normalize-space($grantAmount),1,1)"/>
|
68 |
|
|
<xsl:value-of select="concat($tmp,' ',substring-after($grantAmount,$tmp))"/>
|
69 |
|
|
</FIELD>
|
70 |
|
|
|
71 |
42419
|
alessia.ba
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
72 |
|
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
73 |
48139
|
alessia.ba
|
<FIELD name="collectedfrom">
|
74 |
|
|
<xsl:value-of select="$parentDatasourceId"/>
|
75 |
|
|
</FIELD>
|
76 |
42419
|
alessia.ba
|
</ROW>
|
77 |
|
|
<ROW table="project_fundingpath">
|
78 |
|
|
<FIELD name="_dnet_resource_identifier_">
|
79 |
44408
|
alessia.ba
|
|
80 |
42419
|
alessia.ba
|
<xsl:value-of select="concat($fundingID,'@@', $projectID)"/>
|
81 |
|
|
</FIELD>
|
82 |
|
|
<FIELD name="funding">
|
83 |
|
|
<xsl:value-of select="$fundingID"/>
|
84 |
|
|
</FIELD>
|
85 |
|
|
<FIELD name="project">
|
86 |
|
|
<xsl:value-of select="$projectID"/>
|
87 |
|
|
</FIELD>
|
88 |
|
|
<FIELD name="startdate" type="date" format="{$dateFormat}">
|
89 |
|
|
<xsl:value-of select="$startDate"/>
|
90 |
|
|
</FIELD>
|
91 |
|
|
<FIELD name="enddate" type="date" format="{$dateFormat}">
|
92 |
|
|
<xsl:value-of select="$endDate"/>
|
93 |
|
|
</FIELD>
|
94 |
|
|
</ROW>
|
95 |
48139
|
alessia.ba
|
<xsl:if test="string-length($organizationId) > 0">
|
96 |
|
|
<ROW table="organizations">
|
97 |
|
|
|
98 |
|
|
<FIELD name="_dnet_resource_identifier_">
|
99 |
|
|
<xsl:value-of select="$organizationId"/>
|
100 |
|
|
</FIELD>
|
101 |
|
|
<FIELD name="id">
|
102 |
|
|
<xsl:value-of select="$organizationId"/>
|
103 |
|
|
</FIELD>
|
104 |
|
|
<FIELD name="legalname">
|
105 |
|
|
<xsl:variable name="orgName" select="normalize-space(.//column[@name='research place and institute'])"/>
|
106 |
|
|
<xsl:choose>
|
107 |
|
|
<xsl:when test="string-length( $orgName) > 255">
|
108 |
|
|
<xsl:value-of select="substring($orgName,0,254)"/>
|
109 |
|
|
</xsl:when>
|
110 |
|
|
<xsl:otherwise>
|
111 |
|
|
<xsl:value-of select="normalize-space($orgName)"/>
|
112 |
|
|
</xsl:otherwise>
|
113 |
|
|
</xsl:choose>
|
114 |
|
|
</FIELD>
|
115 |
|
|
<FIELD name="collectedfrom">
|
116 |
|
|
<xsl:value-of select="$parentDatasourceId"/>
|
117 |
|
|
</FIELD>
|
118 |
|
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
119 |
|
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
120 |
|
|
</ROW>
|
121 |
|
|
</xsl:if>
|
122 |
|
|
<xsl:if test="string-length($organizationId) > 0">
|
123 |
|
|
<ROW table="project_organization">
|
124 |
|
|
<FIELD name="_dnet_resource_identifier_">
|
125 |
|
|
<xsl:value-of select='concat($projectID, "@@", $organizationId)'/>
|
126 |
|
|
</FIELD>
|
127 |
|
|
<FIELD name="project">
|
128 |
|
|
<xsl:value-of select="$projectID"/>
|
129 |
|
|
</FIELD>
|
130 |
|
|
<FIELD name="resporganization">
|
131 |
|
|
<xsl:value-of select="$organizationId"/>
|
132 |
|
|
</FIELD>
|
133 |
|
|
<FIELD name="semanticclass">participant</FIELD>
|
134 |
|
|
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
|
135 |
|
|
</ROW>
|
136 |
|
|
</xsl:if>
|
137 |
|
|
</ROWS>
|
138 |
48959
|
claudio.at
|
</xsl:if>
|
139 |
|
|
</metadata>
|
140 |
|
|
</record>
|
141 |
26600
|
sandro.lab
|
</xsl:template>
|
142 |
|
|
</xsl:stylesheet>
|