Revision 48139
Added by Alessia Bardi almost 7 years ago
arc_2_db.xsl | ||
---|---|---|
1 | 1 |
<?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 |
xmlns:ands="http://ands.org.au/standards/rif-cs/registryObjects"> |
|
5 |
|
|
2 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
3 |
xmlns:ands="http://ands.org.au/standards/rif-cs/registryObjects"> |
|
4 |
|
|
6 | 5 |
<xsl:output indent="yes"/> |
7 |
|
|
8 |
<xsl:param name="parentDatasourceId" />
|
|
9 |
|
|
6 |
|
|
7 |
<xsl:param name="parentDatasourceId"/> |
|
8 |
|
|
10 | 9 |
<xsl:template match="/"> |
11 |
<record xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
12 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" |
|
13 |
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
14 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"> |
|
15 |
|
|
10 |
<record |
|
11 |
> |
|
12 |
|
|
16 | 13 |
<xsl:copy-of select=".//*[local-name()='header']"/> |
17 |
|
|
14 |
|
|
18 | 15 |
<metadata> |
19 | 16 |
<ROWS> |
20 | 17 |
<xsl:for-each select="//ands:registryObject[@group='Australian Research Council']/ands:activity[@type='grant']"> |
... | ... | |
31 | 28 |
</xsl:variable> |
32 | 29 |
|
33 | 30 |
<ROW table="projects"> |
34 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="$projectId" /></FIELD> |
|
35 |
<FIELD name="id"><xsl:value-of select="$projectId" /></FIELD> |
|
36 |
<FIELD name="code"><xsl:value-of select="normalize-space(.//ands:identifier[@type='arc'])" /></FIELD> |
|
37 |
<FIELD name="title"><xsl:value-of select="./ands:name[@type='primary']/ands:namePart" /></FIELD> |
|
38 |
<FIELD name="websiteurl"><xsl:value-of select="./ands:identifier[@type='purl']"/></FIELD> |
|
39 |
|
|
31 |
<FIELD name="_dnet_resource_identifier_"> |
|
32 |
<xsl:value-of select="$projectId"/> |
|
33 |
</FIELD> |
|
34 |
<FIELD name="id"> |
|
35 |
<xsl:value-of select="$projectId"/> |
|
36 |
</FIELD> |
|
37 |
<FIELD name="code"> |
|
38 |
<xsl:value-of select="normalize-space(.//ands:identifier[@type='arc'])"/> |
|
39 |
</FIELD> |
|
40 |
<FIELD name="title"> |
|
41 |
<xsl:value-of select="./ands:name[@type='primary']/ands:namePart"/> |
|
42 |
</FIELD> |
|
43 |
<FIELD name="websiteurl"> |
|
44 |
<xsl:value-of select="./ands:identifier[@type='purl']"/> |
|
45 |
</FIELD> |
|
46 |
|
|
40 | 47 |
<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']"> |
41 |
<FIELD name="startdate" type="date" format="dd-MM-yyyy"><xsl:value-of select="concat('01-01-', normalize-space(.))" /></FIELD> |
|
48 |
<FIELD name="startdate" type="date" format="dd-MM-yyyy"> |
|
49 |
<xsl:value-of select="concat('01-01-', normalize-space(.))"/> |
|
50 |
</FIELD> |
|
42 | 51 |
</xsl:for-each> |
43 | 52 |
<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']"> |
44 |
<FIELD name="enddate" type="date" format="dd-MM-yyyy"><xsl:value-of select="concat('31-12-', normalize-space(.))" /></FIELD> |
|
53 |
<FIELD name="enddate" type="date" format="dd-MM-yyyy"> |
|
54 |
<xsl:value-of select="concat('31-12-', normalize-space(.))"/> |
|
55 |
</FIELD> |
|
45 | 56 |
</xsl:for-each> |
46 |
|
|
57 |
|
|
47 | 58 |
<xsl:variable name="keywords"> |
48 | 59 |
<xsl:for-each select="./ands:subject[@type='local']"> |
49 |
<xsl:if test="position() != 1">, </xsl:if>
|
|
60 |
<xsl:if test="position() != 1">,</xsl:if> |
|
50 | 61 |
<xsl:value-of select="."/> |
51 | 62 |
</xsl:for-each> |
52 | 63 |
</xsl:variable> |
53 |
<FIELD name="keywords"><xsl:value-of select="normalize-space($keywords)" /></FIELD> |
|
54 |
<FIELD name="collectedfrom"><xsl:value-of select="$parentDatasourceId" /></FIELD> |
|
64 |
<FIELD name="keywords"> |
|
65 |
<xsl:value-of select="normalize-space($keywords)"/> |
|
66 |
</FIELD> |
|
67 |
<FIELD name="collectedfrom"> |
|
68 |
<xsl:value-of select="$parentDatasourceId"/> |
|
69 |
</FIELD> |
|
55 | 70 |
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD> |
56 | 71 |
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD> |
57 | 72 |
</ROW> |
58 |
|
|
73 |
|
|
59 | 74 |
<ROW table="project_fundingpath"> |
60 |
<FIELD name="_dnet_resource_identifier_"><xsl:value-of select="concat($fundingId, '@@', $projectId)" /></FIELD> |
|
61 |
<FIELD name="funding"><xsl:value-of select="$fundingId" /></FIELD> |
|
62 |
<FIELD name="project"><xsl:value-of select="$projectId" /></FIELD> |
|
75 |
<FIELD name="_dnet_resource_identifier_"> |
|
76 |
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/> |
|
77 |
</FIELD> |
|
78 |
<FIELD name="funding"> |
|
79 |
<xsl:value-of select="$fundingId"/> |
|
80 |
</FIELD> |
|
81 |
<FIELD name="project"> |
|
82 |
<xsl:value-of select="$projectId"/> |
|
83 |
</FIELD> |
|
63 | 84 |
<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']"> |
64 |
<FIELD name="startdate" type="date" format="dd-MM-yyyy"><xsl:value-of select="concat('01-01-', normalize-space(.))" /></FIELD> |
|
85 |
<FIELD name="startdate" type="date" format="dd-MM-yyyy"> |
|
86 |
<xsl:value-of select="concat('01-01-', normalize-space(.))"/> |
|
87 |
</FIELD> |
|
65 | 88 |
</xsl:for-each> |
66 | 89 |
<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']"> |
67 |
<FIELD name="enddate" type="date" format="dd-MM-yyyy"><xsl:value-of select="concat('31-12-', normalize-space(.))" /></FIELD> |
|
90 |
<FIELD name="enddate" type="date" format="dd-MM-yyyy"> |
|
91 |
<xsl:value-of select="concat('31-12-', normalize-space(.))"/> |
|
92 |
</FIELD> |
|
68 | 93 |
</xsl:for-each> |
69 | 94 |
</ROW> |
70 |
|
|
95 |
|
|
71 | 96 |
</xsl:for-each> |
72 | 97 |
</ROWS> |
73 | 98 |
</metadata> |
Also available in: Unified diff
integrated (hopefully) all required changes from dnet40