Project

General

Profile

« Previous | Next » 

Revision 58056

it looks like some records have two biotoolsID, hence let's take the first one.

View differences:

xslt_cleaning_ORP-biotools.xml
1 1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="b703be53-e2e9-4de3-ba94-210ea4a96b82_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
6
		<RESOURCE_URI value=""/>
7
		<DATE_OF_CREATION value="2019-03-27T09:42:01+00:00"/>
8
	</HEADER>
9
	<BODY>
10
		<CONFIGURATION>
11
			<IMPORTED/>
12
			<SCRIPT>
13
				<TITLE>xslt_cleaning_ORP-biotools</TITLE>
14
				<CODE>
15
				 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:datacite="http://datacite.org/schema/kernel-4" xmlns:functx="http://www.functx.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy" xmlns:dr="http://www.driver-repository.eu/namespace/dr" exclude-result-prefixes="TransformationFunction" extension-element-prefixes="TransformationFunction" version="2.0">
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">
16 24
                        <xsl:function as="xs:anyAtomicType*" name="functx:value-intersect">
17 25
                            <xsl:param as="xs:anyAtomicType*" name="arg1"/>
18 26
                            <xsl:param as="xs:anyAtomicType*" name="arg2"/>
......
29 37
                            <xsl:call-template name="validRecord"/>
30 38
                        </xsl:template>
31 39
                        <xsl:template name="terminate">
32
                            <xsl:message terminate="yes"> record is not compliant, transformation is interrupted.
33
        </xsl:message>
40
                            <xsl:message terminate="yes">record is not compliant, transformation is interrupted.
41
                            </xsl:message>
34 42
                        </xsl:template>
35 43
                        <xsl:template name="validRecord">
36 44
                            <record>
......
53 61
                                            <xsl:value-of select="$varOfficialName"/>
54 62
                                        </datacite:publisher>
55 63
                                        <datacite:relatedIdentifiers>
56
                                            <xsl:for-each select="//*[local-name() = 'documentation'][not(./*[local-name() = 'type'] = ('Terms of use', 'Citation instructions', 'Contributions policy', 'Governance'))]">
64
                                            <xsl:for-each
65
                                                    select="//*[local-name() = 'documentation'][not(./*[local-name() = 'type'] = ('Terms of use', 'Citation instructions', 'Contributions policy', 'Governance'))]">
57 66
                                                <datacite:relatedIdentifier>
58 67
                                                    <xsl:attribute name="relatedIdentifierType" select="'URL'"/>
59 68
                                                    <xsl:attribute name="relationType" select="'IsDocumentedBy'"/>
......
65 74
                                        <datacite:alternateIdentifiers><!-- landing page, documentation, distribution -->
66 75
                                            <datacite:alternateIdentifier>
67 76
                                                <xsl:attribute name="alternateIdentifierType" select="'LandingPage'"/>
68
                                                <xsl:value-of select="concat('https://bio.tools/', //*[local-name() = 'biotoolsID'])"/>
77
                                                <xsl:value-of
78
                                                        select="concat('https://bio.tools/', //*[local-name() = 'biotoolsID'][0])"/>
69 79
                                            </datacite:alternateIdentifier><!--
70 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')))">
71 81
											-->
72
	                                        <!--
73
                                            <xsl:for-each 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')))">
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')))">
74 84
                                                <datacite:alternateIdentifier>
75
                                                    <xsl:attribute name="alternateIdentifierType" select="'DistributionLocation'"/>
85
                                                    <xsl:attribute name="alternateIdentifierType"
86
                                                                   select="'DistributionLocation'"/>
76 87
                                                    <xsl:value-of select="."/>
77 88
                                                </datacite:alternateIdentifier>
78

  
79
                                            </xsl:for-each>--><!-- identifier -->
80
                                            <datacite:alternateIdentifier>
81
                                                <xsl:attribute name="alternateIdentifierType" select="'biotoolsID'"/>
82
                                                <xsl:value-of select="//*[local-name() = 'biotoolsID']"/>
83
                                            </datacite:alternateIdentifier>
89
                                            </xsl:for-each>
84 90
                                        </datacite:alternateIdentifiers>
85 91
                                        <datacite:identifier>
86 92
                                            <xsl:attribute name="identifierType" select="'URL'"/>
87
                                            <xsl:value-of select="concat('https://bio.tools/', //*[local-name() = 'biotoolsID'])"/>
93
                                            <xsl:value-of
94
                                                    select="concat('https://bio.tools/', //*[local-name() = 'biotoolsID'][0])"/>
88 95
                                        </datacite:identifier><!-- title -->
89 96
                                        <datacite:titles>
90 97
                                            <datacite:title>
91
                                                <xsl:value-of select="//*[local-name() = 'list']/*[local-name() = 'name']"/>
98
                                                <xsl:value-of
99
                                                        select="//*[local-name() = 'list']/*[local-name() = 'name']"/>
92 100
                                            </datacite:title>
93 101
                                        </datacite:titles><!-- version -->
94 102
                                        <xsl:if test="//*[local-name() = 'list']/*[local-name() = 'version'][not(. = 'null')]">
95 103
                                            <datacite:version>
96
                                                <xsl:value-of select="//*[local-name() = 'list']/*[local-name() = 'version'][not(. = 'null')]"/>
104
                                                <xsl:value-of
105
                                                        select="//*[local-name() = 'list']/*[local-name() = 'version'][not(. = 'null')]"/>
97 106
                                            </datacite:version>
98 107
                                        </xsl:if><!-- bio.tools' credit/typeRole Developer/... is not identical with statements on GitHub ??? (Scoary) -->
99 108
                                        <xsl:call-template name="authors"/>
100 109
                                        <datacite:contributors>
101
                                            <xsl:for-each select="//*[local-name() = 'contact']/*[local-name() = 'name' and not(. = 'null')]">
102
                                                <xsl:variable name="varContributorName" select="TransformationFunction:convertString($tf, ., 'Person')"/>
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')"/>
103 114
                                                <datacite:contributor>
104 115
                                                    <xsl:attribute name="contributorType" select="'ContactPerson'"/>
105 116
                                                    <datacite:contributorName>
106 117
                                                        <xsl:value-of select="$varContributorName"/>
107 118
                                                    </datacite:contributorName>
108 119
                                                    <datacite:givenName>
109
                                                        <xsl:value-of select="substring-after($varContributorName, ', ')"/>
120
                                                        <xsl:value-of
121
                                                                select="substring-after($varContributorName, ', ')"/>
110 122
                                                    </datacite:givenName>
111 123
                                                    <datacite:familyName>
112
                                                        <xsl:value-of select="substring-before($varContributorName, ', ')"/>
124
                                                        <xsl:value-of
125
                                                                select="substring-before($varContributorName, ', ')"/>
113 126
                                                    </datacite:familyName>
114 127
                                                </datacite:contributor>
115 128
                                            </xsl:for-each>
......
123 136
                                            </datacite:description><!--
124 137
											<xsl:for-each select="//*[local-name() = 'operatingSystem'], //*[local-name() = 'function']/*[local-name() = 'comment' and not(. = 'null')]">
125 138
											-->
126
                                            <xsl:for-each select="//*[local-name() = 'function']/*[local-name() = 'comment' and not(. = 'null')]">
139
                                            <xsl:for-each
140
                                                    select="//*[local-name() = 'function']/*[local-name() = 'comment' and not(. = 'null')]">
127 141
                                                <datacite:description>
128 142
                                                    <xsl:attribute name="descriptionType" select="'Abstract'"/>
129 143
                                                    <xsl:value-of select="."/>
......
137 151
                                            </xsl:for-each>
138 152
                                        </datacite:descriptions><!-- subject --><!-- dropping duplicate topics - funny that this seemingly works -->
139 153
                                        <datacite:subjects>
140
                                            <xsl:for-each select="//*[local-name() = 'topic'][index-of(distinct-values(//*[local-name() = 'topic']/*[local-name() = 'uri']), ./*[local-name() = 'uri'])]">
154
                                            <xsl:for-each
155
                                                    select="//*[local-name() = 'topic'][index-of(distinct-values(//*[local-name() = 'topic']/*[local-name() = 'uri']), ./*[local-name() = 'uri'])]">
141 156
                                                <xsl:if test=".">
142 157
                                                    <datacite:subject>
143 158
                                                        <xsl:attribute name="subjectScheme" select="'EDAM Ontology'"/>
144
                                                        <xsl:attribute name="schemeURI" select="'http://edamontology.org'"/>
145
                                                        <xsl:attribute name="valueURI" select="./*[local-name() = 'uri']"/>
159
                                                        <xsl:attribute name="schemeURI"
160
                                                                       select="'http://edamontology.org'"/>
161
                                                        <xsl:attribute name="valueURI"
162
                                                                       select="./*[local-name() = 'uri']"/>
146 163
                                                        <xsl:value-of select="./*[local-name() = 'term']"/>
147 164
                                                    </datacite:subject>
148 165
                                                </xsl:if>
......
152 169
									CobjCategory, SuperType
153 170
									-->
154 171
                                    <xsl:variable name="varCobjCategory" select="'0029'"/>
155
                                    <xsl:variable name="varSuperType" select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/>
172
                                    <xsl:variable name="varSuperType"
173
                                                  select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/>
156 174
                                    <dr:CobjCategory>
157 175
                                        <xsl:attribute name="type" select="$varSuperType"/>
158 176
                                        <xsl:value-of select="$varCobjCategory"/>
159 177
                                    </dr:CobjCategory><!--
160 178
									access rights, licenses
161 179
									-->
162
                                    <xsl:for-each select="//*[local-name() = ('license', 'accessibility') and not(. = 'null')]">
180
                                    <xsl:for-each
181
                                            select="//*[local-name() = ('license', 'accessibility') and not(. = 'null')]">
163 182
                                        <oaf:accessrights>
164
                                            <xsl:variable name="varAccessRights" select="TransformationFunction:convertString($tf, ., 'AccessRights')"/>
183
                                            <xsl:variable name="varAccessRights"
184
                                                          select="TransformationFunction:convertString($tf, ., 'AccessRights')"/>
165 185
                                            <xsl:choose>
166
                                                <xsl:when test="$varAccessRights = ('OPEN', 'OPEN SOURCE') and $varSuperType = 'software'">
186
                                                <xsl:when
187
                                                        test="$varAccessRights = ('OPEN', 'OPEN SOURCE') and $varSuperType = 'software'">
167 188
                                                    <xsl:value-of select="'OPEN SOURCE'"/>
168 189
                                                </xsl:when>
169 190
                                                <xsl:otherwise>
......
184 205
                                    <oaf:collectedFrom>
185 206
                                        <xsl:attribute name="name" select="$varOfficialName"/>
186 207
                                        <xsl:attribute name="id" select="$varDataSourceId"/>
187
                                    </oaf:collectedFrom><!--
188
									<oaf:identifier>
189
									<xsl:value-of select="//*[local-name() = 'id']"/>
190
									</oaf:identifier>
191
									-->
192
                                    <xsl:variable name="elixirGRAuthorMails" select="()"/>
193
                                    <xsl:variable name="elixirGRTools" 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')"/>
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')"/>
194 213
                                    <xsl:variable name="authorMails" select="//credit/email"/>
195 214
                                    <xsl:if test="//elixirNode/text() = 'Greece' or $elixirGRTools=/list/name/text() or count(functx:value-intersect($authorMails, $elixirGRAuthorMails)) &gt; 0">
196 215
                                        <oaf:concept>
......
198 217
                                        </oaf:concept>
199 218
                                    </xsl:if><!-- date -->
200 219
                                    <oaf:dateAccepted>
201
                                        <xsl:value-of select="//*[local-name() = 'additionDate']/substring-before(., 'T')"/>
220
                                        <xsl:value-of
221
                                                select="//*[local-name() = 'additionDate']/substring-before(., 'T')"/>
202 222
                                    </oaf:dateAccepted>
203 223
                                </metadata>
204 224
                                <xsl:copy-of select="//*[local-name() = 'about']"/>
......
233 253
            We'll consider Developer and Primary Contact as authors.
234 254
        -->
235 255
                            <xsl:choose>
236
                                <xsl:when test="not(//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and (. = 'Developer' or . = 'Primary contact')]][./*[local-name() = 'name' and not(. = 'null')]])">
256
                                <xsl:when
257
                                        test="not(//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and (. = 'Developer' or . = 'Primary contact')]][./*[local-name() = 'name' and not(. = 'null')]])">
237 258
                                    <xsl:call-template name="terminate"/>
238 259
                                </xsl:when>
239 260
                                <xsl:otherwise>
240 261
                                    <creators>
241
                                        <xsl:for-each select="//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and (. = 'Developer' or . = 'Primary contact')]]/*[local-name() = 'name' and not(. = 'null')]">
262
                                        <xsl:for-each
263
                                                select="//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and (. = 'Developer' or . = 'Primary contact')]]/*[local-name() = 'name' and not(. = 'null')]">
242 264
                                            <xsl:for-each select="tokenize(., ', ')">
243
                                                <xsl:variable name="varDeveloperName" select="TransformationFunction:convertString($tf, normalize-space(.), 'Person')"/>
265
                                                <xsl:variable name="varDeveloperName"
266
                                                              select="TransformationFunction:convertString($tf, normalize-space(.), 'Person')"/>
244 267
                                                <creator>
245 268
                                                    <creatorName>
246 269
                                                        <xsl:value-of select="$varDeveloperName"/>
247 270
                                                    </creatorName>
248 271
                                                    <givenName>
249
                                                        <xsl:value-of select="substring-after($varDeveloperName, ', ')"/>
272
                                                        <xsl:value-of
273
                                                                select="substring-after($varDeveloperName, ', ')"/>
250 274
                                                    </givenName>
251 275
                                                    <familyName>
252
                                                        <xsl:value-of select="substring-before($varDeveloperName, ', ')"/>
276
                                                        <xsl:value-of
277
                                                                select="substring-before($varDeveloperName, ', ')"/>
253 278
                                                    </familyName>
254 279
                                                </creator>
255 280
                                            </xsl:for-each>
......
261 286
						<xsl:template match="//*[local-name() = 'DOI']">
262 287
						-->
263 288
                        <xsl:template name="relatedPaper">
264
                            <xsl:for-each select="//*[local-name() = 'publication']/*[local-name() = ('doi', 'pmid', 'pmcid') and not(. = 'null')]">
289
                            <xsl:for-each
290
                                    select="//*[local-name() = 'publication']/*[local-name() = ('doi', 'pmid', 'pmcid') and not(. = 'null')]">
265 291
                                <xsl:element name="datacite:relatedIdentifier">
266 292
                                    <xsl:attribute name="relatedIdentifierType" select="upper-case(local-name())"/>
267 293
                                    <xsl:attribute name="relationType">
......
269 295
                                            <xsl:when test="../*[local-name() = 'type'] = 'Primary'">
270 296
                                                <xsl:value-of select="'isSupplementTo'"/>
271 297
                                            </xsl:when>
272
                                            <xsl:when test="../*[local-name() = 'type'] = ('Review', 'Benchmark', 'Comparison')">
298
                                            <xsl:when
299
                                                    test="../*[local-name() = 'type'] = ('Review', 'Benchmark', 'Comparison')">
273 300
                                                <xsl:value-of select="'isReviewedBy'"/>
274 301
                                            </xsl:when>
275 302
                                            <xsl:when test="../*[local-name() = 'type'] = 'Usage'">
......
288 315
                            </xsl:for-each>
289 316
                        </xsl:template>
290 317
                    </xsl:stylesheet>
291
				</CODE>
292
			</SCRIPT>
293
		</CONFIGURATION>
294
		<STATUS/>
295
		<SECURITY_PARAMETERS/>
296
	</BODY>
318
                </CODE>
319
            </SCRIPT>
320
        </CONFIGURATION>
321
        <STATUS/>
322
        <SECURITY_PARAMETERS/>
323
    </BODY>
297 324
</RESOURCE_PROFILE>

Also available in: Unified diff