Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER
4
                value="1a760618-54b0-47e3-84ca-ec4565b54886_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
5
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
6
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
7
		<RESOURCE_URI value=""/>
8
		<DATE_OF_CREATION value="2014-11-19T11:05:55+01:00"/>
9
	</HEADER>
10
	<BODY>
11
		<CONFIGURATION>
12
			<IMPORTED/>
13
			<SCRIPT>
14
				<TITLE>DLI: OAI_Datacite to DMF transform</TITLE>
15
				<CODE><![CDATA[<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
16
                xmlns:dnet="eu.dnetlib.dli.DLIUtils"
17
                xmlns:oaf="http://namespace.dnet.eu/oaf" version="2.0" exclude-result-prefixes="xsl dnet">
18
    <xsl:template match="/">
19
        <xsl:param name="check">
20
            <xsl:value-of select="count(//*[local-name()='relatedIdentifier' and normalize-space()])"/>
21
        </xsl:param>
22
        <xsl:choose>
23
            <xsl:when test="$check=0 or //*[local-name() = 'resourceType']/@resourceTypeGeneral = 'Paper'">
24
                <junk/>
25
            </xsl:when>
26
            <xsl:otherwise>
27
                <oai:record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
28
                            xmlns:oai="http://www.openarchives.org/OAI/2.0/"
29
                            xmlns:dri="http://www.driver-repository.eu/namespace/dri">
30
                    <xsl:copy-of select="//oai:header"/>
31
                    <oai:metadata>
32
                        <resource xmlns="http://datacite.org/schema/kernel-3"
33
                                  xmlns:oaf="http://namespace.dnet.eu/oaf"
34
                                  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
35
                            <identifier>
36
                                <xsl:attribute name="identifierType">
37
                                    <xsl:value-of select="lower-case(//*[local-name()='resource']/*[local-name()='identifier']/@identifierType)"/>
38
                                </xsl:attribute>
39
                                <xsl:value-of select="lower-case(//*[local-name()='resource']/*[local-name()='identifier'])"/>
40
                            </identifier>
41
                            <xsl:copy-of select="//*[local-name()='titles']"/>
42
                            <xsl:copy-of select="//*[local-name()='publisher']"/>
43
                            <xsl:copy-of select="//*[local-name()='publicationYear']"/>
44
                            <xsl:copy-of select="//*[local-name()='dates']"/>
45
                            <xsl:copy-of select="//*[local-name()='creators']"/>
46
                            <xsl:copy-of select="//*[local-name()='subjects']"/>
47
                            <xsl:copy-of select="//*[local-name()='descriptions']"/>
48
                            <resourceType resourceTypeGeneral="Dataset"/>
49

    
50
                            <relatedIdentifiers>
51
                                <xsl:for-each select="//*[local-name()='relatedIdentifier']">
52
                                    <xsl:choose>
53
                                        <xsl:when test="string-length(normalize-space(./@relatedIdentifierType)) &gt; 0 and string-length(normalize-space(./@relationType)) &gt; 0 and string-length(normalize-space(.)) &gt; 0">
54
                                            <relatedIdentifier>
55
                                                <xsl:attribute name="relatedIdentifierType"><xsl:value-of select="dnet:geussPidType(./@relatedIdentifierType, .)"/></xsl:attribute>
56
                                                <xsl:attribute name="relationType"><xsl:value-of select="dnet:normalizeRelation(./@relationType)"/></xsl:attribute>
57
                                                <xsl:attribute name="inverseRelationType"><xsl:value-of select="dnet:getInverse(./@relationType)"/></xsl:attribute>
58
                                                <xsl:value-of select="dnet:geussPidValue(.)"/>
59
                                            </relatedIdentifier>
60
                                        </xsl:when>
61
                                    </xsl:choose>
62
                                </xsl:for-each>
63
                            </relatedIdentifiers>
64
                        </resource>
65
                    </oai:metadata>
66
                    <oaf:about>
67
                        <oaf:datainfo>
68
                            <xsl:variable name="datasourcePrefix">
69
                                <xsl:value-of select="//dri:datasourceprefix/text()"/>
70
                            </xsl:variable>
71
                            <oaf:collectedFrom completionStatus="complete">
72
                                <xsl:attribute name="id">
73
                                    <xsl:value-of select="dnet:getIdFromDataSourcePrefix($datasourcePrefix)"/>
74
                                </xsl:attribute>
75
                                <xsl:attribute name="name">
76
                                    <xsl:value-of select="dnet:getNameFromDataSourcePrefix($datasourcePrefix)"/>
77
                                </xsl:attribute>
78
                            </oaf:collectedFrom>
79
                            <oaf:completionStatus>complete</oaf:completionStatus>
80
                            <oaf:provisionMode>collected</oaf:provisionMode>
81
                        </oaf:datainfo>
82
                    </oaf:about>
83
                </oai:record>
84
            </xsl:otherwise>
85
        </xsl:choose>
86
    </xsl:template>
87
</xsl:stylesheet>]]>
88
				</CODE>
89
			</SCRIPT>
90
		</CONFIGURATION>
91
		<STATUS/>
92
		<SECURITY_PARAMETERS/>
93
	</BODY>
94
</RESOURCE_PROFILE>
(13-13/19)