Project

General

Profile

1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER
4
                value="b703be53-e2e9-4de3-ba94-210ea4a96b82_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
5
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
6
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
7
        <RESOURCE_URI value=""/>
8
        <DATE_OF_CREATION value="2019-06-21T12:30:02+00:00"/>
9
    </HEADER>
10
    <BODY>
11
        <CONFIGURATION>
12
            <IMPORTED/>
13
            <SCRIPT>
14
                <TITLE>xslt_cleaning_ORP-biotools</TITLE>
15
                <CODE>
16
                    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
                                    xmlns:oaf="http://namespace.openaire.eu/oaf"
18
                                    xmlns:datacite="http://datacite.org/schema/kernel-4"
19
                                    xmlns:functx="http://www.functx.com" xmlns:xs="http://www.w3.org/2001/XMLSchema"
20
                                    xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy"
21
                                    xmlns:dr="http://www.driver-repository.eu/namespace/dr"
22
                                    exclude-result-prefixes="TransformationFunction"
23
                                    extension-element-prefixes="TransformationFunction" version="2.0">
24
                        <xsl:function as="xs:anyAtomicType*" name="functx:value-intersect">
25
                            <xsl:param as="xs:anyAtomicType*" name="arg1"/>
26
                            <xsl:param as="xs:anyAtomicType*" name="arg2"/>
27
                            <xsl:sequence select=" distinct-values($arg1[.=$arg2]) "/>
28
                        </xsl:function>
29
                        <xsl:param name="varOfficialName"/>
30
                        <xsl:param name="varDsType"/>
31
                        <xsl:param name="varDataSourceId"/>
32
                        <xsl:param name="index" select="0"/>
33
                        <xsl:param name="transDate" select="current-dateTime()"/>
34
                        <xsl:variable name="tf" select="TransformationFunction:getInstance()"/>
35
                        <xsl:template match="/">
36
                            <xsl:variable name="datasourcePrefix" select="normalize-space(//oaf:datasourceprefix)"/>
37
                            <xsl:call-template name="validRecord"/>
38
                        </xsl:template>
39
                        <xsl:template name="terminate">
40
                            <xsl:message terminate="yes">record is not compliant, transformation is interrupted.
41
                            </xsl:message>
42
                        </xsl:template>
43
                        <xsl:template name="validRecord">
44
                            <record>
45
                                <xsl:apply-templates select="//*[local-name() = 'header']"/>
46
                                <metadata><!--
47
									<xsl:apply-templates select="//*[local-name() = 'metadata']//*[local-name() = 'list']"/>
48
									-->
49
                                    <datacite:resource>
50
                                        <datacite:resourceType>
51
                                            <xsl:attribute name="resourceTypeGeneral" select="'Software'"/>
52
                                            <xsl:value-of select="//*[local-name() = 'toolType']"/>
53
                                        </datacite:resourceType>
54
                                        <xsl:for-each select="//*[local-name() = 'language']">
55
                                            <datacite:format>
56
                                                <xsl:value-of select="."/>
57
                                            </datacite:format>
58
                                        </xsl:for-each><!-- DOE CODE does not state languages; projects/funding: funders not known to OpenAIRE
59
										-->
60
                                        <datacite:publisher>
61
                                            <xsl:value-of select="$varOfficialName"/>
62
                                        </datacite:publisher>
63
                                        <datacite:relatedIdentifiers>
64
                                            <xsl:for-each
65
                                                    select="//*[local-name() = 'documentation'][not(./*[local-name() = 'type'] = ('Terms of use', 'Citation instructions', 'Contributions policy', 'Governance'))]">
66
                                                <datacite:relatedIdentifier>
67
                                                    <xsl:attribute name="relatedIdentifierType" select="'URL'"/>
68
                                                    <xsl:attribute name="relationType" select="'IsDocumentedBy'"/>
69
                                                    <xsl:value-of select="./*[local-name() = 'url']"/>
70
                                                </datacite:relatedIdentifier>
71
                                            </xsl:for-each><!-- paper references -->
72
                                            <xsl:call-template name="relatedPaper"/>
73
                                        </datacite:relatedIdentifiers>
74
                                        <datacite:alternateIdentifiers><!-- landing page, documentation, distribution -->
75
                                            <datacite:alternateIdentifier>
76
                                                <xsl:attribute name="alternateIdentifierType" select="'LandingPage'"/>
77
                                                <xsl:value-of
78
                                                        select="concat('https://bio.tools/', //*[local-name() = 'biotoolsID'][0])"/>
79
                                            </datacite:alternateIdentifier><!--
80
											<xsl:for-each select="distinct-values((//*[local-name() = 'link'][./*[local-name() = 'type' and . = 'Repository']]/*[local-name() = 'url'], //*[local-name() = 'link'][./*[local-name() = 'url' and starts-with(., 'https://github.com/')]]/*[local-name() = 'url']/replace(., '(https://github.com/[^/]*/[^/]*)(/.*)?', '$1')))">
81
											-->
82
                                            <xsl:for-each
83
                                                    select="distinct-values((//*[local-name() = 'link'][./*[local-name() = 'type' and . = 'Repository']]/*[local-name() = 'url'], //*[starts-with(., 'https://github.com/') and contains(., concat('/', //*[local-name() = 'id']))]/replace(., '(https://github.com/[^/]*/[^/]*)(/.*)?', '$1')))">
84
                                                <datacite:alternateIdentifier>
85
                                                    <xsl:attribute name="alternateIdentifierType"
86
                                                                   select="'DistributionLocation'"/>
87
                                                    <xsl:value-of select="."/>
88
                                                </datacite:alternateIdentifier>
89
                                            </xsl:for-each>
90
                                        </datacite:alternateIdentifiers>
91
                                        <datacite:identifier>
92
                                            <xsl:attribute name="identifierType" select="'URL'"/>
93
                                            <xsl:value-of
94
                                                    select="concat('https://bio.tools/', //*[local-name() = 'biotoolsID'][0])"/>
95
                                        </datacite:identifier><!-- title -->
96
                                        <datacite:titles>
97
                                            <datacite:title>
98
                                                <xsl:value-of
99
                                                        select="//*[local-name() = 'list']/*[local-name() = 'name']"/>
100
                                            </datacite:title>
101
                                        </datacite:titles><!-- version -->
102
                                        <xsl:if test="//*[local-name() = 'list']/*[local-name() = 'version'][not(. = 'null')]">
103
                                            <datacite:version>
104
                                                <xsl:value-of
105
                                                        select="//*[local-name() = 'list']/*[local-name() = 'version'][not(. = 'null')]"/>
106
                                            </datacite:version>
107
                                        </xsl:if><!-- bio.tools' credit/typeRole Developer/... is not identical with statements on GitHub ??? (Scoary) -->
108
                                        <xsl:call-template name="authors"/>
109
                                        <datacite:contributors>
110
                                            <xsl:for-each
111
                                                    select="//*[local-name() = 'contact']/*[local-name() = 'name' and not(. = 'null')]">
112
                                                <xsl:variable name="varContributorName"
113
                                                              select="TransformationFunction:convertString($tf, ., 'Person')"/>
114
                                                <datacite:contributor>
115
                                                    <xsl:attribute name="contributorType" select="'ContactPerson'"/>
116
                                                    <datacite:contributorName>
117
                                                        <xsl:value-of select="$varContributorName"/>
118
                                                    </datacite:contributorName>
119
                                                    <datacite:givenName>
120
                                                        <xsl:value-of
121
                                                                select="substring-after($varContributorName, ', ')"/>
122
                                                    </datacite:givenName>
123
                                                    <datacite:familyName>
124
                                                        <xsl:value-of
125
                                                                select="substring-before($varContributorName, ', ')"/>
126
                                                    </datacite:familyName>
127
                                                </datacite:contributor>
128
                                            </xsl:for-each>
129
                                        </datacite:contributors>
130
                                        <datacite:descriptions>
131
                                            <datacite:description>
132
                                                <xsl:attribute name="descriptionType">
133
                                                    <xsl:value-of select="'Abstract'"/>
134
                                                </xsl:attribute>
135
                                                <xsl:value-of select="//*[local-name() = 'description']"/>
136
                                            </datacite:description><!--
137
											<xsl:for-each select="//*[local-name() = 'operatingSystem'], //*[local-name() = 'function']/*[local-name() = 'comment' and not(. = 'null')]">
138
											-->
139
                                            <xsl:for-each
140
                                                    select="//*[local-name() = 'function']/*[local-name() = 'comment' and not(. = 'null')]">
141
                                                <datacite:description>
142
                                                    <xsl:attribute name="descriptionType" select="'Abstract'"/>
143
                                                    <xsl:value-of select="."/>
144
                                                </datacite:description>
145
                                            </xsl:for-each>
146
                                            <xsl:for-each select="//*[local-name() = 'operatingSystem']">
147
                                                <datacite:description>
148
                                                    <xsl:attribute name="descriptionType" select="'TechnicalInfo'"/>
149
                                                    <xsl:value-of select="."/>
150
                                                </datacite:description>
151
                                            </xsl:for-each>
152
                                        </datacite:descriptions><!-- subject --><!-- dropping duplicate topics - funny that this seemingly works -->
153
                                        <datacite:subjects>
154
                                            <xsl:for-each
155
                                                    select="//*[local-name() = 'topic'][index-of(distinct-values(//*[local-name() = 'topic']/*[local-name() = 'uri']), ./*[local-name() = 'uri'])]">
156
                                                <xsl:if test=".">
157
                                                    <datacite:subject>
158
                                                        <xsl:attribute name="subjectScheme" select="'EDAM Ontology'"/>
159
                                                        <xsl:attribute name="schemeURI"
160
                                                                       select="'http://edamontology.org'"/>
161
                                                        <xsl:attribute name="valueURI"
162
                                                                       select="./*[local-name() = 'uri']"/>
163
                                                        <xsl:value-of select="./*[local-name() = 'term']"/>
164
                                                    </datacite:subject>
165
                                                </xsl:if>
166
                                            </xsl:for-each>
167
                                        </datacite:subjects>
168
                                    </datacite:resource><!--
169
									CobjCategory, SuperType
170
									-->
171
                                    <xsl:variable name="varCobjCategory" select="'0029'"/>
172
                                    <xsl:variable name="varSuperType"
173
                                                  select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/>
174
                                    <dr:CobjCategory>
175
                                        <xsl:attribute name="type" select="$varSuperType"/>
176
                                        <xsl:value-of select="$varCobjCategory"/>
177
                                    </dr:CobjCategory><!--
178
									access rights, licenses
179
									-->
180
                                    <xsl:for-each
181
                                            select="//*[local-name() = ('license', 'accessibility') and not(. = 'null')]">
182
                                        <oaf:accessrights>
183
                                            <xsl:variable name="varAccessRights"
184
                                                          select="TransformationFunction:convertString($tf, ., 'AccessRights')"/>
185
                                            <xsl:choose>
186
                                                <xsl:when
187
                                                        test="$varAccessRights = ('OPEN', 'OPEN SOURCE') and $varSuperType = 'software'">
188
                                                    <xsl:value-of select="'OPEN SOURCE'"/>
189
                                                </xsl:when>
190
                                                <xsl:otherwise>
191
                                                    <xsl:value-of select="$varAccessRights"/>
192
                                                </xsl:otherwise>
193
                                            </xsl:choose>
194
                                        </oaf:accessrights>
195
                                    </xsl:for-each>
196
                                    <xsl:for-each select="//*[local-name() = 'license' and not(. = 'null')]">
197
                                        <oaf:license>
198
                                            <xsl:value-of select="."/>
199
                                        </oaf:license>
200
                                    </xsl:for-each>
201
                                    <oaf:hostedBy>
202
                                        <xsl:attribute name="name" select="$varOfficialName"/>
203
                                        <xsl:attribute name="id" select="$varDataSourceId"/>
204
                                    </oaf:hostedBy>
205
                                    <oaf:collectedFrom>
206
                                        <xsl:attribute name="name" select="$varOfficialName"/>
207
                                        <xsl:attribute name="id" select="$varDataSourceId"/>
208
                                    </oaf:collectedFrom><!-- Check for person emails, tool name and elixirNode if we can set the concept for ELIXIR-GR -->
209
                                    <xsl:variable name="elixirGRAuthorMails"
210
                                                  select="('achatzi@eie.gr','artemis.hatzigeorgiou@gmail.com','balomenos@upatras.gr','bezer@upatras.gr','D.R.Westhead@leeds.ac.uk','diwis@imis.athena-innovation.gr','epilalis@eie.gr','fpsom@issel.ee.auth.gr','geo.papoutsoglou@gmail.com','gpatrinos@upatras.gr','ikavakiotis@gmail.com','iliopj@med.uoc.gr','imichalop@bioacademy.gr','keklikoglou@hcmr.gr','lygerou@upatras.gr','mklapa@iceht.forth.gr','moulos@fleming.gr','mtheodo@biol.uoa.gr','mtsagris@yahoo.gr','n_moschonas@med.upatras.gr','nikolaou@uoc.gr','npapand@biol.uoa.gr','pbagos@compgen.org','ppaschou@mbg.duth.gr','secretariat@goldenhelix.org','sonja.althammer@gmail.com','thkoutsandreas@eie.gr','tsamard.it@gmail.com','vbur@iceht.forth.gr')"/><!-- List of tools provided by Elixir-GR RCD manager -->
211
                                    <xsl:variable name="elixirGRTools"
212
                                                  select="('3DMem-enzyme','ACT','Align Paths','AMYL-PRED 2','ANASTASIA','BioTextQuest(+)','BioTranslator','BiP finder','BPM','BUFET','CHRONOS','DEsubs','DIANA-LNCBase','DIANA-microT','DIANA-mirExTra','DIANA-mirExTra v2.0','DIANA-miRGen','DIANA-miRGen v3.0','DIANA-mirPath','DIANA-miRPath v3','DruGeVar','easyFRAP','ePGA','FINDbase','g-Class','G-Class','GprotPRED','GWAR','GWAS Training','haplotypeAnalysisPipeline','M-IOLITE','MESBL GC-MS metabolite peak database','METAGEN','metaseqR','Micro-CTvlab','microTSS','MiGA','mirPub','MR-microT','MR-microT','Mutations-Meta-Analyser','Mutations-Meta-Analyser ','MXM','Network Analyzer','OMPdb','PICKLE','PRED-LIPO','PRED-SIGNAL','PRED-TAT','PRED-TMBB2','Proteosign','recoup','RNEA','SCENERY','SymCurv','TRES','Variant Ranker')"/>
213
                                    <xsl:variable name="authorMails" select="//credit/email"/>
214
                                    <xsl:if test="//elixirNode/text() = 'Greece' or $elixirGRTools=/list/name/text() or count(functx:value-intersect($authorMails, $elixirGRAuthorMails)) &gt; 0">
215
                                        <oaf:concept>
216
                                            <xsl:attribute name="id" select="'elixir-gr'"/>
217
                                        </oaf:concept>
218
                                    </xsl:if><!-- date -->
219
                                    <oaf:dateAccepted>
220
                                        <xsl:value-of
221
                                                select="//*[local-name() = 'additionDate']/substring-before(., 'T')"/>
222
                                    </oaf:dateAccepted>
223
                                </metadata>
224
                                <xsl:copy-of select="//*[local-name() = 'about']"/>
225
                            </record>
226
                        </xsl:template>
227
                        <xsl:template match="node() | @*">
228
                            <xsl:copy>
229
                                <xsl:apply-templates select="node() | @*"/>
230
                            </xsl:copy>
231
                        </xsl:template>
232
                        <xsl:template match="//*[local-name() = 'metadata']//*[local-name() = 'resource']">
233
                            <xsl:copy>
234
                                <xsl:apply-templates select="node() | @*"/>
235
                            </xsl:copy>
236
                        </xsl:template>
237
                        <xsl:template match="//*[local-name() = 'header']">
238
                            <xsl:copy>
239
                                <xsl:apply-templates select="node() | @*"/>
240
                                <xsl:element name="dr:dateOfTransformation">
241
                                    <xsl:value-of select="$transDate"/>
242
                                </xsl:element>
243
                            </xsl:copy>
244
                        </xsl:template>
245
                        <xsl:template name="authors"><!-- Allowed roles :
246
            Developer
247
            Maintainer
248
            Provider
249
            Documentor
250
            Contributor
251
            Support
252
            Primary contact
253
            We'll consider Developer and Primary Contact as authors.
254
        -->
255
                            <xsl:choose>
256
                                <xsl:when
257
                                        test="not(//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and (. = 'Developer' or . = 'Primary contact')]][./*[local-name() = 'name' and not(. = 'null')]])">
258
                                    <xsl:call-template name="terminate"/>
259
                                </xsl:when>
260
                                <xsl:otherwise>
261
                                    <creators>
262
                                        <xsl:for-each
263
                                                select="//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and (. = 'Developer' or . = 'Primary contact')]]/*[local-name() = 'name' and not(. = 'null')]">
264
                                            <xsl:for-each select="tokenize(., ', ')">
265
                                                <xsl:variable name="varDeveloperName"
266
                                                              select="TransformationFunction:convertString($tf, normalize-space(.), 'Person')"/>
267
                                                <creator>
268
                                                    <creatorName>
269
                                                        <xsl:value-of select="$varDeveloperName"/>
270
                                                    </creatorName>
271
                                                    <givenName>
272
                                                        <xsl:value-of
273
                                                                select="substring-after($varDeveloperName, ', ')"/>
274
                                                    </givenName>
275
                                                    <familyName>
276
                                                        <xsl:value-of
277
                                                                select="substring-before($varDeveloperName, ', ')"/>
278
                                                    </familyName>
279
                                                </creator>
280
                                            </xsl:for-each>
281
                                        </xsl:for-each>
282
                                    </creators>
283
                                </xsl:otherwise>
284
                            </xsl:choose>
285
                        </xsl:template><!--
286
						<xsl:template match="//*[local-name() = 'DOI']">
287
						-->
288
                        <xsl:template name="relatedPaper">
289
                            <xsl:for-each
290
                                    select="//*[local-name() = 'publication']/*[local-name() = ('doi', 'pmid', 'pmcid') and not(. = 'null')]">
291
                                <xsl:element name="datacite:relatedIdentifier">
292
                                    <xsl:attribute name="relatedIdentifierType" select="upper-case(local-name())"/>
293
                                    <xsl:attribute name="relationType">
294
                                        <xsl:choose>
295
                                            <xsl:when test="../*[local-name() = 'type'] = 'Primary'">
296
                                                <xsl:value-of select="'isSupplementTo'"/>
297
                                            </xsl:when>
298
                                            <xsl:when
299
                                                    test="../*[local-name() = 'type'] = ('Review', 'Benchmark', 'Comparison')">
300
                                                <xsl:value-of select="'isReviewedBy'"/>
301
                                            </xsl:when>
302
                                            <xsl:when test="../*[local-name() = 'type'] = 'Usage'">
303
                                                <xsl:value-of select="'isReferencedBy'"/>
304
                                            </xsl:when>
305
                                            <xsl:when test="../*[local-name() = 'type'] = 'Method'">
306
                                                <xsl:value-of select="'references'"/>
307
                                            </xsl:when>
308
                                            <xsl:otherwise>
309
                                                <xsl:value-of select="'isReferencedBy'"/>
310
                                            </xsl:otherwise>
311
                                        </xsl:choose>
312
                                    </xsl:attribute>
313
                                    <xsl:value-of select="."/>
314
                                </xsl:element>
315
                            </xsl:for-each>
316
                        </xsl:template>
317
                    </xsl:stylesheet>
318
                </CODE>
319
            </SCRIPT>
320
        </CONFIGURATION>
321
        <STATUS/>
322
        <SECURITY_PARAMETERS/>
323
    </BODY>
324
</RESOURCE_PROFILE>
(52-52/56)