Revision 49165
Added by Miriam Baglioni over 6 years ago
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/dfg2db.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions" |
|
3 |
> |
|
4 |
|
|
5 |
<xsl:param name="parentDatasourceId"/> |
|
6 |
<xsl:param name="namespacePrefix"/> |
|
7 |
|
|
8 |
<xsl:variable name="dateFormat" select="string('yyyy')"/> |
|
9 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::DFGF')"/> |
|
10 |
<xsl:variable name="fundingId"> |
|
11 |
<xsl:value-of select="concat($funderID,'::',utils:md5(.//column[@name='Funding Programme']))"/> |
|
12 |
</xsl:variable> |
|
13 |
|
|
14 |
|
|
15 |
<xsl:template match="/"> |
|
16 |
<record> |
|
17 |
|
|
18 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
|
19 |
|
|
20 |
<metadata> |
|
21 |
<ROWS> |
|
22 |
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Project ID']))"/> |
|
23 |
<xsl:variable name="startDate" select="replace(.//column[@name='Funding Start Year'],'/','-')"/> |
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
<ROW table="projects"> |
|
28 |
|
|
29 |
<FIELD name="_dnet_resource_identifier_"> |
|
30 |
<xsl:value-of select="$projectId"/> |
|
31 |
</FIELD> |
|
32 |
<FIELD name="id"> |
|
33 |
<xsl:value-of select="$projectId"/> |
|
34 |
</FIELD> |
|
35 |
<FIELD name="code"> |
|
36 |
<xsl:value-of select="normalize-space(.//column[@name='Project ID'])"/> |
|
37 |
</FIELD> |
|
38 |
<FIELD name="title"> |
|
39 |
<xsl:value-of select=".//column[@name='Project Title English**']"/> |
|
40 |
</FIELD> |
|
41 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
42 |
<xsl:value-of select="$startDate"/> |
|
43 |
</FIELD> |
|
44 |
|
|
45 |
|
|
46 |
<FIELD name="collectedfrom"> |
|
47 |
<xsl:value-of select="$parentDatasourceId"/> |
|
48 |
</FIELD> |
|
49 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
|
50 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
|
51 |
|
|
52 |
|
|
53 |
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD> |
|
54 |
</ROW> |
|
55 |
<ROW table="project_fundingpath"> |
|
56 |
<FIELD name="_dnet_resource_identifier_"> |
|
57 |
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/> |
|
58 |
</FIELD> |
|
59 |
<FIELD name="funding"> |
|
60 |
<xsl:value-of select="$fundingId"/> |
|
61 |
</FIELD> |
|
62 |
<FIELD name="project"> |
|
63 |
<xsl:value-of select="$projectId"/> |
|
64 |
</FIELD> |
|
65 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
66 |
<xsl:value-of select="$startDate"/> |
|
67 |
</FIELD> |
|
68 |
|
|
69 |
</ROW> |
|
70 |
</ROWS> |
|
71 |
</metadata> |
|
72 |
</record> |
|
73 |
</xsl:template> |
|
74 |
</xsl:stylesheet> |
Also available in: Unified diff
transformation for dfg funder