Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
6
		<RESOURCE_URI value=""/>
7
		<DATE_OF_CREATION value="2018-06-04T11:15:30+00:00"/>
8
	</HEADER>
9
	<BODY>
10
		<CONFIGURATION>
11
			<IMPORTED/>
12
			<SCRIPT>
13
				<TITLE>ARC to DB</TITLE>
14
				<CODE>
15
					<![CDATA[
16
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
                xmlns:ands="http://ands.org.au/standards/rif-cs/registryObjects">
18

    
19
	<xsl:output indent="yes"/>
20

    
21
	<xsl:param name="parentDatasourceId"/>
22

    
23
	<xsl:template match="/">
24
		<record>
25

    
26
			<xsl:copy-of select=".//*[local-name()='header']"/>
27

    
28
			<metadata>
29
				<ROWS>
30
					<xsl:for-each select="//ands:registryObject[@group='Australian Research Council']/ands:activity[@type='grant']">
31
						<xsl:variable name="projectId" select="concat('arc_________::', normalize-space(./ands:identifier[@type='arc']))"/>
32
						<xsl:variable name="fundingId">
33
							<xsl:choose>
34
								<xsl:when test="string-length(./ands:description[@type='fundingScheme']) &gt; 0">
35
									<xsl:value-of select="concat('arc_________::ARC::', normalize-space(./ands:description[@type='fundingScheme']))"/>
36
								</xsl:when>
37
								<xsl:otherwise>
38
									<xsl:value-of select="string('arc_________::ARC')"/>
39
								</xsl:otherwise>
40
							</xsl:choose>
41
						</xsl:variable>
42

    
43
						<ROW table="projects">
44
							<FIELD name="_dnet_resource_identifier_">
45
								<xsl:value-of select="$projectId"/>
46
							</FIELD>
47
							<FIELD name="id">
48
								<xsl:value-of select="$projectId"/>
49
							</FIELD>
50
							<FIELD name="code">
51
								<xsl:value-of select="normalize-space(.//ands:identifier[@type='arc'])"/>
52
							</FIELD>
53
							<FIELD name="title">
54
								<xsl:value-of select="./ands:name[@type='primary']/ands:namePart"/>
55
							</FIELD>
56
							<FIELD name="websiteurl">
57
								<xsl:value-of select="./ands:identifier[@type='purl']"/>
58
							</FIELD>
59

    
60
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
61
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
62
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
63
								</FIELD>
64
							</xsl:for-each>
65
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
66
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
67
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
68
								</FIELD>
69
							</xsl:for-each>
70

    
71
							<xsl:variable name="keywords">
72
								<xsl:for-each select="./ands:subject[@type='local']">
73
									<xsl:if test="position() != 1">,</xsl:if>
74
									<xsl:value-of select="."/>
75
								</xsl:for-each>
76
							</xsl:variable>
77
							<FIELD name="keywords">
78
								<xsl:value-of select="normalize-space($keywords)"/>
79
							</FIELD>
80
							<FIELD name="collectedfrom">
81
								<xsl:value-of select="$parentDatasourceId"/>
82
							</FIELD>
83
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
84
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
85
						</ROW>
86

    
87
						<ROW table="project_fundingpath">
88
							<FIELD name="_dnet_resource_identifier_">
89
								<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
90
							</FIELD>
91
							<FIELD name="funding">
92
								<xsl:value-of select="$fundingId"/>
93
							</FIELD>
94
							<FIELD name="project">
95
								<xsl:value-of select="$projectId"/>
96
							</FIELD>
97
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
98
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
99
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
100
								</FIELD>
101
							</xsl:for-each>
102
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
103
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
104
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
105
								</FIELD>
106
							</xsl:for-each>
107
						</ROW>
108

    
109
					</xsl:for-each>
110
				</ROWS>
111
			</metadata>
112
		</record>
113
	</xsl:template>
114
</xsl:stylesheet>
115
		]]>
116
		</CODE>
117
		</SCRIPT>
118
		</CONFIGURATION>
119
<STATUS/>
120
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
121
		</BODY>
122
		</RESOURCE_PROFILE>
(2-2/20)