Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="be2626f5-b879-4851-afa8-62f754889eaa_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU=" />
4
		<RESOURCE_TYPE value="TransformationRuleDSResourceType" />
5
		<RESOURCE_KIND value="TransformationRuleDSResources" />
6
		<RESOURCE_URI value="" />
7
		<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/>
8
	</HEADER>
9
	<BODY>
10
        <CONFIGURATION>
11
			<SOURCE_METADATA_FORMAT name="oaf" layout="store" interpretation="cleaned" />
12
			<SINK_METADATA_FORMAT name="oaf_hbase" />   
13
            <IMPORTED/>
14
            <SCRIPT>
15
                <TITLE>xslt_mapping_oaf_publication2hbase</TITLE>
16
                <CODE>
17
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
18
                xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dc="http://purl.org/dc/elements/1.1/"
19
                xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:dr="http://www.driver-repository.eu/namespace/dr"
20
                xmlns:dnet="eu.dnetlib.data.transform.xml.OafToHbaseXsltFunctions"
21
                xmlns:exslt="http://exslt.org/common"
22
                version="1.0" extension-element-prefixes="exslt"
23
                exclude-result-prefixes="xsl oaf dr dri dnet exslt">
24

    
25
    <xsl:output omit-xml-declaration="yes" indent="yes"/>
26

    
27
    <xsl:param name="writeCoAuthors" select="false()"/>
28

    
29
    <xsl:template match="/*">
30
        <xsl:variable name="about" select="/*[local-name() = 'record']/*[local-name() = 'about']"/>
31
        <xsl:variable name="dateofcollection" select="//dr:dateOfCollection"/>
32
        <xsl:variable name="dateoftransformation" select="//dr:dateOfTransformation"/>
33

    
34
        <xsl:variable name="trust" select="string('0.9')"/>
35
        <xsl:variable name="provenance" select="string('sysimport:crosswalk:repository')"/>
36

    
37
        <xsl:variable name="metadata" select="exslt:node-set(//*[local-name()='metadata']/*)"/>
38
        <xsl:variable name="namespaceprefix">
39
            <xsl:choose>
40

    
41
                <!-- TODO check namespaceprefix length is 12 -->
42
                <xsl:when test="string-length(//oaf:datasourceprefix) &gt; 0">
43
	                <xsl:value-of select="//oaf:datasourceprefix"/>
44
                </xsl:when>
45
                <xsl:otherwise>
46
	                <xsl:value-of select="unknown_"/>
47
                </xsl:otherwise>
48
            </xsl:choose>
49
        </xsl:variable>
50

    
51
        <xsl:choose>
52
            <!-- 			<xsl:when test="count($metadata) = 0 or string-length($namespaceprefix) = 0"> -->
53
            <xsl:when test="count($metadata) = 0">
54
                <ROWS/>
55
            </xsl:when>
56
            <xsl:otherwise>
57

    
58
                <xsl:variable name="objIdentifier" select="//dri:objIdentifier"/>
59
                <xsl:variable name="publicationId" select="dnet:oafSimpleId('publication', //dri:objIdentifier)"/>
60

    
61
                <xsl:if test="string-length($publicationId) &gt; 0">
62

    
63
	                <xsl:variable name="collectedfromid" select="dnet:oafSplitId('datasource', //oaf:collectedFrom/@id)"/>
64
	                <xsl:variable name="collectedfromname" select="//oaf:collectedFrom/@name"/>
65

    
66
	                <xsl:variable name="hostedbyid" select="dnet:oafSplitId('datasource', //oaf:hostedBy/@id)"/>
67
	                <xsl:variable name="hostedbyname" select="//oaf:hostedBy/@name"/>
68

    
69
	                <xsl:variable name="originalidTest" select="/record/*[local-name() = 'header']/*[local-name() = 'recordIdentifier']"/>
70
	                <xsl:variable name="originalid">
71
		                <xsl:choose>
72
			                <xsl:when test="contains($originalidTest, '::')">
73
				                <xsl:value-of select="substring-after($originalidTest, '::')"/>
74
			                </xsl:when>
75
			                <xsl:otherwise>
76
				                <xsl:value-of select="$originalidTest"/>
77
			                </xsl:otherwise>
78
		                </xsl:choose>
79
	                </xsl:variable>
80
	                <ROWS>
81
		                <ROW>
82
			                <xsl:attribute name="value">
83
				                <xsl:value-of select="dnet:oafPublication($publicationId, $provenance, $trust, $about, $hostedbyid, $hostedbyname,
84
				                $collectedfromid, $collectedfromname, $originalid, $dateofcollection, $dateoftransformation, $metadata)"/>
85
			                </xsl:attribute>
86
		                </ROW>
87
	                </ROWS>
88
                </xsl:if>
89
            </xsl:otherwise>
90
        </xsl:choose>
91
    </xsl:template>
92
</xsl:stylesheet>
93
			</CODE>
94
        </SCRIPT>
95
        </CONFIGURATION>
96
		<STATUS />
97
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
98
	</BODY>
99
</RESOURCE_PROFILE>
(54-54/70)