Revision 49040
Added by Miriam Baglioni about 7 years ago
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/aff2db.xsl | ||
---|---|---|
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" xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions" |
|
4 |
exclude-result-prefixes="xs" version="2.0"> |
|
5 |
|
|
6 |
<xsl:param name="parentDatasourceId"/> |
|
7 |
<xsl:param name="namespacePrefix"/> |
|
8 |
<xsl:param name="quote">"</xsl:param> |
|
9 |
|
|
10 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::AFF')"/> |
|
11 |
|
|
12 |
|
|
13 |
<xsl:variable name="stream" select="normalize-space(.//column[@name='FUNDING STREAM(S)'])"/> |
|
14 |
<xsl:variable name="fundingID"> |
|
15 |
|
|
16 |
<xsl:value-of select="$funderID"/> |
|
17 |
</xsl:variable> |
|
18 |
|
|
19 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Decision No.']))"/> |
|
20 |
|
|
21 |
<xsl:variable name="fundingPeriod" select="tokenize(.//column[@name='Funding period'],'-')"/> |
|
22 |
<xsl:variable name="startDate" select="normalize-space($fundingPeriod[1])"/> |
|
23 |
<xsl:variable name="endDate" select="normalize-space($fundingPeriod[2])"/> |
|
24 |
|
|
25 |
<xsl:variable name="dateFormat" select="string('dd.MM.yyyy')"/> |
|
26 |
<xsl:variable name="projectTitle" select="normalize-space(.//column[@name='Project title'])"/> |
|
27 |
|
|
28 |
<xsl:template match="/"> |
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
<record> |
|
33 |
|
|
34 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
35 |
<metadata> |
|
36 |
<xsl:if test="string-length($projectTitle) > 0 and string-length($projectId) > 0"> |
|
37 |
<ROWS> |
|
38 |
|
|
39 |
<ROW table="projects"> |
|
40 |
<FIELD name="_dnet_resource_identifier_"> |
|
41 |
<xsl:value-of select="$projectId"/> |
|
42 |
</FIELD> |
|
43 |
<FIELD name="id"> |
|
44 |
<xsl:value-of select="$projectId"/> |
|
45 |
</FIELD> |
|
46 |
<FIELD name="code"> |
|
47 |
<xsl:value-of select="normalize-space(.//column[@name='Decision No.'])"/> |
|
48 |
</FIELD> |
|
49 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
50 |
<xsl:value-of select="$startDate"/> |
|
51 |
</FIELD> |
|
52 |
<FIELD name="enddate" type="date" format="{$dateFormat}"> |
|
53 |
<xsl:value-of select="$endDate"/> |
|
54 |
</FIELD> |
|
55 |
<FIELD name="title"> |
|
56 |
<xsl:value-of select="$projectTitle"/> |
|
57 |
</FIELD> |
|
58 |
<FIELD name="call_identifier"> |
|
59 |
<xsl:value-of select=".//column[@name='Call']"/> |
|
60 |
</FIELD> |
|
61 |
<FIELD name="contactfullname"> |
|
62 |
<xsl:value-of select=".//column[@name='Name']"/> |
|
63 |
</FIELD> |
|
64 |
<FIELD name="optional1"> |
|
65 |
<xsl:value-of select="concat(.//column[@name='Funding'], ' €')"/> |
|
66 |
</FIELD> |
|
67 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
68 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
69 |
<FIELD name="collectedfrom"> |
|
70 |
<xsl:value-of select="$parentDatasourceId"/> |
|
71 |
</FIELD> |
|
72 |
|
|
73 |
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD> |
|
74 |
|
|
75 |
</ROW> |
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
<ROW table="project_fundingpath"> |
|
80 |
<FIELD name="_dnet_resource_identifier_"> |
|
81 |
<xsl:value-of select="concat($fundingID,'@@', $projectId)"/> |
|
82 |
</FIELD> |
|
83 |
<FIELD name="funding"> |
|
84 |
<xsl:value-of select="$fundingID"/> |
|
85 |
</FIELD> |
|
86 |
<FIELD name="project"> |
|
87 |
<xsl:value-of select="$projectId"/> |
|
88 |
</FIELD> |
|
89 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
90 |
<xsl:value-of select="$startDate"/> |
|
91 |
</FIELD> |
|
92 |
<FIELD name="enddate" type="date" format="{$dateFormat}"> |
|
93 |
<xsl:value-of select="$endDate"/> |
|
94 |
</FIELD> |
|
95 |
</ROW> |
|
96 |
<xsl:variable name="organizationId" select="concat($namespacePrefix,'::',utils:md5(normalize-space(.//column[@name='Organisation'])))"/> |
|
97 |
<ROW table = "organizations"> |
|
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:value-of select="normalize-space(.//column[@name='Organisation'])"/> |
|
106 |
</FIELD> |
|
107 |
<FIELD name="collectedfrom"> |
|
108 |
<xsl:value-of select="$parentDatasourceId"/> |
|
109 |
</FIELD> |
|
110 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
111 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
112 |
</ROW> |
|
113 |
<ROW table="project_organization"> |
|
114 |
<FIELD name="_dnet_resource_identifier_"> |
|
115 |
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/> |
|
116 |
</FIELD> |
|
117 |
<FIELD name="project"> |
|
118 |
<xsl:value-of select="$projectId"/> |
|
119 |
</FIELD> |
|
120 |
<FIELD name="resporganization"> |
|
121 |
<xsl:value-of select="$organizationId"/> |
|
122 |
</FIELD> |
|
123 |
|
|
124 |
|
|
125 |
<FIELD name="semanticclass">participant</FIELD> |
|
126 |
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD> |
|
127 |
</ROW> |
|
128 |
</ROWS> |
|
129 |
</xsl:if> |
|
130 |
</metadata> |
|
131 |
</record> |
|
132 |
|
|
133 |
</xsl:template> |
|
134 |
</xsl:stylesheet> |
Also available in: Unified diff
transformation for Academy of Finland funder