1 |
39178
|
michele.ar
|
<?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="formatDate">
|
8 |
|
|
<xsl:param name="datename" />
|
9 |
|
|
<xsl:param name="datevalue" />
|
10 |
|
|
<xsl:choose>
|
11 |
|
|
<xsl:when test="string-length($datevalue) = 4 and $datename = 'startdate'">
|
12 |
|
|
<FIELD name="{$datename}" type="date" format="yyyy-MM-dd"><xsl:value-of select="concat($datevalue, '-01-01')" /></FIELD>
|
13 |
|
|
</xsl:when>
|
14 |
|
|
<xsl:when test="string-length($datevalue) = 4 and $datename = 'enddate'">
|
15 |
|
|
<FIELD name="{$datename}" type="date" format="yyyy-MM-dd"><xsl:value-of select="concat($datevalue, '-12-31')" /></FIELD>
|
16 |
|
|
</xsl:when>
|
17 |
|
|
<xsl:when test="string-length($datevalue) = 10">
|
18 |
|
|
<FIELD name="{$datename}" type="date" format="yyyy-MM-dd"><xsl:value-of select="$datevalue" /></FIELD>
|
19 |
|
|
</xsl:when>
|
20 |
|
|
</xsl:choose>
|
21 |
|
|
</xsl:template>
|
22 |
|
|
|
23 |
|
|
<xsl:variable name="namespacePrefix" select="string('irb_hr______')" />
|
24 |
|
|
|
25 |
|
|
<xsl:template match="/">
|
26 |
|
|
<record xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
27 |
|
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
28 |
|
|
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
29 |
|
|
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
|
30 |
|
|
|
31 |
|
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
32 |
|
|
|
33 |
|
|
<metadata>
|
34 |
|
|
<ROWS>
|
35 |
|
|
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(//column[@name = 'PROJECT_IDENTIFIER']))"/>
|
36 |
|
|
|
37 |
|
|
<xsl:variable name="fundingIdTmp">
|
38 |
|
|
<xsl:choose>
|
39 |
39194
|
michele.ar
|
<xsl:when test="contains(//column[@name='FUNDER_NAME'], 'MSES')">
|
40 |
39178
|
michele.ar
|
<xsl:value-of select="concat($namespacePrefix, '::MSES::fundingStream')" />
|
41 |
|
|
</xsl:when>
|
42 |
39194
|
michele.ar
|
<xsl:when test="contains(//column[@name='FUNDER_NAME'], 'CSF')">
|
43 |
39178
|
michele.ar
|
<xsl:value-of select="concat($namespacePrefix, '::CSF::fundingStream')" />
|
44 |
|
|
</xsl:when>
|
45 |
|
|
</xsl:choose>
|
46 |
|
|
</xsl:variable>
|
47 |
|
|
|
48 |
|
|
<xsl:variable name="fundingId" select="normalize-space($fundingIdTmp)" />
|
49 |
|
|
|
50 |
|
|
<ROW table="projects">
|
51 |
|
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectId" /></FIELD>
|
52 |
|
|
<FIELD name="id"><xsl:value-of select="$projectId" /></FIELD>
|
53 |
|
|
<FIELD name="code"><xsl:value-of select="//column[@name = 'PROJECT_IDENTIFIER']" /></FIELD>
|
54 |
|
|
<FIELD name="title"><xsl:value-of select="//column[@name = 'PROJECT_TITLE']" /></FIELD>
|
55 |
|
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
56 |
|
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
57 |
|
|
<xsl:call-template name="formatDate">
|
58 |
|
|
<xsl:with-param name="datename">startdate</xsl:with-param>
|
59 |
|
|
<xsl:with-param name="datevalue" select="//column[@name = 'START_DATE']"></xsl:with-param>
|
60 |
|
|
</xsl:call-template>
|
61 |
|
|
<xsl:call-template name="formatDate">
|
62 |
|
|
<xsl:with-param name="datename">enddate</xsl:with-param>
|
63 |
|
|
<xsl:with-param name="datevalue" select="//column[@name = 'END_DATE']"></xsl:with-param>
|
64 |
|
|
</xsl:call-template>
|
65 |
|
|
</ROW>
|
66 |
|
|
|
67 |
|
|
<xsl:if test="string-length(normalize-space(//column[@name = 'ORGANIZATION_INVOLVED'])) > 0">
|
68 |
|
|
|
69 |
|
|
<xsl:variable name="organizationId" select="concat($namespacePrefix, '::', normalize-space(//column[@name = 'ORGANIZATION_INVOLVED']))" />
|
70 |
|
|
|
71 |
|
|
<ROW table="organizations">
|
72 |
|
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$organizationId" /></FIELD>
|
73 |
|
|
<FIELD name="id"><xsl:value-of select="$organizationId" /></FIELD>
|
74 |
|
|
<FIELD name="legalname"><xsl:value-of select="//column[@name = 'ORGANIZATION_INVOLVED']" /></FIELD>
|
75 |
|
|
<FIELD name="countryclass">HR</FIELD>
|
76 |
|
|
<FIELD name="countryscheme">dnet:countries</FIELD>
|
77 |
|
|
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD>
|
78 |
|
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
79 |
|
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
80 |
|
|
</ROW>
|
81 |
|
|
|
82 |
|
|
<ROW table="project_organization">
|
83 |
|
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select='concat($projectId, "@@", $organizationId)' /></FIELD>
|
84 |
|
|
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
|
85 |
|
|
<FIELD name="resporganization"><xsl:value-of select="$organizationId" /></FIELD>
|
86 |
|
|
<FIELD name="participantnumber" type="int">1</FIELD>
|
87 |
|
|
<FIELD name="semanticclass">coordinator</FIELD>
|
88 |
|
|
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
|
89 |
|
|
</ROW>
|
90 |
|
|
</xsl:if>
|
91 |
|
|
|
92 |
|
|
<xsl:if test="string-length($fundingId) > 0">
|
93 |
|
|
<ROW table="project_fundingpath">
|
94 |
|
|
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($fundingId, '@@', $projectId)" /></FIELD>
|
95 |
|
|
<FIELD name="funding"><xsl:value-of select="$fundingId" /></FIELD>
|
96 |
|
|
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD>
|
97 |
|
|
<xsl:call-template name="formatDate">
|
98 |
|
|
<xsl:with-param name="datename">startdate</xsl:with-param>
|
99 |
|
|
<xsl:with-param name="datevalue" select="//column[@name = 'START_DATE']"></xsl:with-param>
|
100 |
|
|
</xsl:call-template>
|
101 |
|
|
<xsl:call-template name="formatDate">
|
102 |
|
|
<xsl:with-param name="datename">enddate</xsl:with-param>
|
103 |
|
|
<xsl:with-param name="datevalue" select="//column[@name = 'END_DATE']"></xsl:with-param>
|
104 |
|
|
</xsl:call-template>
|
105 |
|
|
</ROW>
|
106 |
|
|
</xsl:if>
|
107 |
|
|
</ROWS>
|
108 |
|
|
</metadata>
|
109 |
|
|
</record>
|
110 |
|
|
</xsl:template>
|
111 |
|
|
</xsl:stylesheet>
|