1 |
38509
|
michele.ar
|
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3 |
48139
|
alessia.ba
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
4 |
|
|
exclude-result-prefixes="xs" version="1.0">
|
5 |
38509
|
michele.ar
|
|
6 |
48139
|
alessia.ba
|
<xsl:param name="parentDatasourceId"/>
|
7 |
|
|
<xsl:param name="namespacePrefix"/>
|
8 |
|
|
|
9 |
38509
|
michele.ar
|
<xsl:template match="/">
|
10 |
|
|
|
11 |
48139
|
alessia.ba
|
<xsl:variable name="prefix" select="string('sfi_________')"/>
|
12 |
38509
|
michele.ar
|
|
13 |
48364
|
alessia.ba
|
<record>
|
14 |
38509
|
michele.ar
|
|
15 |
48139
|
alessia.ba
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
16 |
38509
|
michele.ar
|
|
17 |
|
|
<metadata>
|
18 |
|
|
<ROWS>
|
19 |
48139
|
alessia.ba
|
<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 |
38509
|
michele.ar
|
<ROW table="projects">
|
24 |
48139
|
alessia.ba
|
<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 |
38509
|
michele.ar
|
<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD>
|
46 |
48364
|
alessia.ba
|
<!-- oa_mandate_for_publications is true for projects started after 2005 -->
|
47 |
|
|
<xsl:choose>
|
48 |
|
|
<!-- Invalid date: we need at least YYYY -->
|
49 |
|
|
<xsl:when test="string-length($startDate) < 4">
|
50 |
|
|
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
|
51 |
|
|
</xsl:when>
|
52 |
|
|
<xsl:when test="xs:date($startDate) >= xs:date('2009-01-01')">
|
53 |
|
|
<FIELD name="oa_mandate_for_publications" type="boolean">true</FIELD>
|
54 |
|
|
</xsl:when>
|
55 |
|
|
<xsl:otherwise><FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD></xsl:otherwise>
|
56 |
|
|
</xsl:choose>
|
57 |
38509
|
michele.ar
|
</ROW>
|
58 |
48139
|
alessia.ba
|
|
59 |
|
|
<xsl:if test="normalize-space(.//column[@name='Programme Name'])">
|
60 |
|
|
<xsl:variable name="funderId" select="concat($prefix, '::SFI')"/>
|
61 |
|
|
<xsl:variable name="fundingId" select="concat($funderId, '::', normalize-space(.//column[@name='Programme Name']))"/>
|
62 |
38509
|
michele.ar
|
<ROW table="project_fundingpath">
|
63 |
48139
|
alessia.ba
|
<FIELD name="_dnet_resource_identifier_">
|
64 |
|
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
65 |
|
|
</FIELD>
|
66 |
|
|
<FIELD name="funding">
|
67 |
|
|
<xsl:value-of select="$fundingId"/>
|
68 |
|
|
</FIELD>
|
69 |
|
|
<FIELD name="project">
|
70 |
|
|
<xsl:value-of select="$projectId"/>
|
71 |
|
|
</FIELD>
|
72 |
|
|
<FIELD name="startdate" type="date" format="dd/MM/yyyy">
|
73 |
|
|
<xsl:value-of select="$startDate"/>
|
74 |
|
|
</FIELD>
|
75 |
|
|
<FIELD name="enddate" type="date" format="dd/MM/yyyy">
|
76 |
|
|
<xsl:value-of select="$endDate"/>
|
77 |
|
|
</FIELD>
|
78 |
38509
|
michele.ar
|
</ROW>
|
79 |
|
|
</xsl:if>
|
80 |
48139
|
alessia.ba
|
|
81 |
38537
|
michele.ar
|
<xsl:if test="normalize-space(.//column[@name='Research Body'])">
|
82 |
48139
|
alessia.ba
|
<xsl:variable name="organizationId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Research Body']))"/>
|
83 |
38509
|
michele.ar
|
<ROW table="organizations">
|
84 |
48139
|
alessia.ba
|
<FIELD name="_dnet_resource_identifier_">
|
85 |
|
|
<xsl:value-of select="$organizationId"/>
|
86 |
|
|
</FIELD>
|
87 |
|
|
<FIELD name="id">
|
88 |
|
|
<xsl:value-of select="$organizationId"/>
|
89 |
|
|
</FIELD>
|
90 |
|
|
<FIELD name="legalname">
|
91 |
|
|
<xsl:value-of select=".//column[@name='Research Body']"/>
|
92 |
|
|
</FIELD>
|
93 |
38509
|
michele.ar
|
<FIELD name="countryclass">IE</FIELD>
|
94 |
|
|
<FIELD name="countryscheme">dnet:countries</FIELD>
|
95 |
48139
|
alessia.ba
|
<FIELD name="collectedfrom">
|
96 |
|
|
<xsl:value-of select="$parentDatasourceId"/>
|
97 |
|
|
</FIELD>
|
98 |
38509
|
michele.ar
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
99 |
|
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
100 |
|
|
</ROW>
|
101 |
|
|
<ROW table="project_organization">
|
102 |
48139
|
alessia.ba
|
<FIELD name="_dnet_resource_identifier_">
|
103 |
|
|
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
|
104 |
|
|
</FIELD>
|
105 |
|
|
<FIELD name="project">
|
106 |
|
|
<xsl:value-of select="$projectId"/>
|
107 |
|
|
</FIELD>
|
108 |
|
|
<FIELD name="resporganization">
|
109 |
|
|
<xsl:value-of select="$organizationId"/>
|
110 |
|
|
</FIELD>
|
111 |
38509
|
michele.ar
|
<FIELD name="participantnumber" type="int">1</FIELD>
|
112 |
|
|
<FIELD name="semanticclass">coordinator</FIELD>
|
113 |
|
|
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
|
114 |
|
|
</ROW>
|
115 |
|
|
</xsl:if>
|
116 |
48139
|
alessia.ba
|
</xsl:if>
|
117 |
38509
|
michele.ar
|
</ROWS>
|
118 |
|
|
</metadata>
|
119 |
|
|
</record>
|
120 |
|
|
</xsl:template>
|
121 |
|
|
|
122 |
48139
|
alessia.ba
|
</xsl:stylesheet>
|