Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<RESOURCE_PROFILE>
3
	<HEADER>
4
		<RESOURCE_IDENTIFIER value="eab4c820-e11f-4406-8b01-d31cfcccdf5f_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
5
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
6
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
7
		<RESOURCE_URI value=""/>
8
		<DATE_OF_CREATION value="2016-05-08T23:27:01+01:00"/>
9
	</HEADER>
10
	<BODY>
11
		<CONFIGURATION>
12
			<IMPORTED/>
13
			<SCRIPT>
14
				<TITLE>xslt_opentrials_datacite</TITLE>
15
				<CODE>
16
					<![CDATA[
17
<xsl:stylesheet xmlns:openTrials="eu.dnetlib.data.transform.xml.OpenTrialsXsltFunctions" xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:date="http://exslt.org/dates-and-times" xmlns:dr="http://www.driver-repository.eu/namespace/dr" exclude-result-prefixes="xsl" extension-element-prefixes="openTrials date" version="2.0">
18
                        <xsl:output indent="yes"/>
19
                        <xsl:param name="varOfficialName"/>
20
                        <xsl:param name="varDataSourceId"/>
21
                        <xsl:param name="quote">"</xsl:param>
22
                        <xsl:variable name="baseURL" select="string('http://explorer.opentrials.net/trials/')"/>
23
                        <xsl:template match="/">
24
                            <xsl:call-template name="createRecord"/>
25
                        </xsl:template>
26
                        <xsl:template name="createRecord">
27
                            <xsl:variable name="opentrialID" select="//column[./@name = 'id']/text()"/>
28
                            <oai:record>
29
                                <oai:header>
30
                                    <xsl:copy-of copy-namespaces="no" select="//*[local-name() = 'header']/*"/>
31
                                    <dr:dateOfTransformation>
32
                                        <xsl:value-of select="date:date-time()"/>
33
                                    </dr:dateOfTransformation>
34
                                </oai:header>
35
                                <oai:metadata>
36
                                    <resource xmlns="http://datacite.org/schema/kernel-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
37
                    <!--
38
                        In order to the web URL to be properly set in the OAF final record, the main id must be an URL.
39
                        Primary and secondary ids + identifiers can be set as alternate identifiers.
40
                        We want the URL to be the OpenTrial URL
41
                    -->
42
                    <!--
43
                    <identifier identifierType="URL">
44
                        <xsl:value-of select="concat($baseURL, $opentrialID)"/>
45
                    </identifier>
46
                    -->
47
                    <!-- Temporary using the original URL of the trial because OpenTrials changed ids -->
48
                                        <identifier identifierType="URL">
49
                                            <xsl:value-of select="openTrials:getPrimaryRecordUrl(//column[@name = 'records']/text())"/>
50
                                        </identifier>
51
                                        <xsl:variable name="primaryId" select="openTrials:getPrimaryRecordIdentifier(//column[./@name = 'records']/text())"/>
52
                                        <alternateIdentifiers>
53

    
54

    
55
                        <!-- remove '{' and '}' -->
56
                                            <xsl:variable name="cleanedIds" select="replace(replace(//column[@name = 'identifiers'], '\{', ''), '\}', '')"/>
57
                                            <xsl:for-each select="tokenize($cleanedIds, ',')">
58
                                                <xsl:variable name="pair" select="tokenize(.,':')"/>
59
                                                <alternateIdentifier alternateIdentifierType="{translate($pair[1],$quote,'')}">
60
                                                    <xsl:value-of select="normalize-space(translate($pair[2],$quote,''))"/>
61
                                                </alternateIdentifier>
62
                                            </xsl:for-each>
63
                                        </alternateIdentifiers>
64
                    <!-- No creators available -->
65
                                        <creators/>
66
                                        <titles>
67
                                            <xsl:variable name="scientificTitle" select="normalize-space(//column[@name = 'scientific_title'])"/>
68
                                            <xsl:variable name="publicTitle" select="normalize-space(//column[@name = 'public_title'])"/>
69
                                            <xsl:if test="string-length($scientificTitle) &gt; 0">
70
                                                <title>
71
                                                    <xsl:value-of select="$scientificTitle"/>
72
                                                </title>
73
                                            </xsl:if>
74
                                            <xsl:if test="string-length($publicTitle) &gt; 0">
75
                                                <title>
76
                                                    <xsl:value-of select="$publicTitle"/>
77
                                                </title>
78
                                            </xsl:if>
79
                                        </titles>
80
                                        <publisher>
81
                                            <xsl:value-of select="$primaryId"/>
82
                                        </publisher>
83
                                        <resourceType resourceTypeGeneral="clinicalTrial">Clinical Trial</resourceType>
84
                                        <descriptions>
85
                                            <xsl:variable name="description" select="normalize-space(//column[@name = 'description'])"/>
86
                                            <xsl:variable name="summary" select="normalize-space(//column[@name = 'brief_summary'])"/>
87
                                            <xsl:if test="string-length($description) &gt; 0">
88
                                                <description descriptionType="Abstract">
89
                                                    <xsl:value-of select="$description"/>
90
                                                </description>
91
                                            </xsl:if>
92
                                            <xsl:if test="string-length($summary) &gt; 0">
93
                                                <description descriptionType="Abstract">
94
                                                    <xsl:value-of select="$summary"/>
95
                                                </description>
96
                                            </xsl:if>
97
                                        </descriptions>
98
                                        <xsl:if test="string-length(//column[@name = 'target_sample_size']) &gt; 0">
99
                                            <sizes>
100
                                                <size>
101
                                                    <xsl:value-of select="concat('Target sample size: ', //column[@name = 'target_sample_size'])"/>
102
                                                </size>
103
                                            </sizes>
104
                                        </xsl:if>
105
                                        <oaf:accessrights>UNKNOWN</oaf:accessrights>
106
                                        <dr:CobjCategory>clinical trial</dr:CobjCategory>
107
                                        <oaf:dateAccepted>
108
                                            <xsl:value-of select="//column[@name = 'registration_date']"/>
109
                                        </oaf:dateAccepted>
110
                    <!-- We'll need to do something to patch it, if possible, looking at the jsonProv source name and id -->
111
                                        <oaf:hostedBy>
112
                                            <xsl:attribute name="name">
113
                                                <xsl:value-of select="$varOfficialName"/>
114
                                            </xsl:attribute>
115
                                            <xsl:attribute name="id">
116
                                                <xsl:value-of select="$varDataSourceId"/>
117
                                            </xsl:attribute>
118
                                        </oaf:hostedBy>
119
                                        <oaf:collectedFrom>
120
                                            <xsl:attribute name="name">
121
                                                <xsl:value-of select="$varOfficialName"/>
122
                                            </xsl:attribute>
123
                                            <xsl:attribute name="id">
124
                                                <xsl:value-of select="$varDataSourceId"/>
125
                                            </xsl:attribute>
126
                                        </oaf:collectedFrom>
127
                                        <oaf:about>
128
                                            <oaf:datainfo>
129
                                                <oaf:inferred>false</oaf:inferred>
130
                                                <oaf:deletedbyinference>false</oaf:deletedbyinference>
131
                                                <oaf:trust>0.9</oaf:trust>
132
                                                <oaf:inferenceprovenance/>
133
                                                <oaf:provenanceaction classid="sysimport:crosswalk:datasetarchive" classname="sysimport:crosswalk:datasetarchive" schemeid="dnet:provenanceActions" schemename="dnet:provenanceActions"/>
134
                                            </oaf:datainfo>
135
                                        </oaf:about>
136
                                    </resource>
137
                                </oai:metadata>
138
                                <xsl:copy-of select="//*[local-name() = 'about']"/>
139
                            </oai:record>
140
                        </xsl:template>
141
                    </xsl:stylesheet>
142

    
143
]]>
144
</CODE>
145
			</SCRIPT>
146
		</CONFIGURATION>
147
		<STATUS/>
148
		<SECURITY_PARAMETERS/>
149
	</BODY>
150
</RESOURCE_PROFILE>
151

    
(71-71/85)