Revision 62558
Added by Alessia Bardi about 1 year ago
xslt_cleaning_oaire2datacite_hadoop-w3id.xml | ||
---|---|---|
320 | 320 |
select="//*[local-name() = 'about']/*[local-name() = 'provenance']//*[local-name() = 'originDescription' and not(./*[local-name() = 'originDescription'])]/*[local-name() = 'identifier']"/> |
321 | 321 |
</oaf:identifier> |
322 | 322 |
</xsl:if> |
323 |
<xsl:variable name="varEmbargoEndDate" |
|
324 |
select="dateCleaner:dateISO(normalize-space(//*[local-name() = 'date'][@dateType = 'Available']))"/><!-- resourceType, superType --> |
|
325 |
<xsl:choose> |
|
326 |
<xsl:when |
|
327 |
test="lower-case(//*[local-name() = 'resourceType']/@resourceTypeGeneral) = ('dataset', 'software', 'literature', 'publication', 'other research product') or not(//*[local-name() = 'resourceType']/@resourceTypeGeneral)"> |
|
328 |
<dr:CobjCategory> |
|
329 |
<xsl:variable name="varCobjCategory" |
|
330 |
select="vocabulary:clean(//*[local-name() = 'resourceType']/text(), 'dnet:publication_resource')"/><!-- <xsl:variable name="varCobjCategory" select="vocabulary:clean(//*[local-name() = 'resourceType']/@resourceTypeGeneral, 'dnet:publication_resource')"/>--> |
|
331 |
<xsl:variable name="varSuperType" |
|
332 |
select="vocabulary:clean($varCobjCategory, 'dnet:result_typologies')"/> |
|
333 |
<xsl:attribute name="type"> |
|
334 |
<xsl:value-of select="$varSuperType"/> |
|
335 |
</xsl:attribute> |
|
336 |
<xsl:value-of select="$varCobjCategory"/> |
|
337 |
</dr:CobjCategory><!-- |
|
338 |
<dr:CobjCategory> |
|
339 |
<xsl:attribute name="type" select="//oaf:datasourceprefix[. = '_______qeios' and contains(//dri:recordIdentifier, '/definition/')]/'other', //oaf:datasourceprefix[not(. = '_______qeios' and contains(//dri:recordIdentifier, '/definition/'))]/$varSuperType"/> |
|
340 |
<xsl:value-of select="$varCobjCategory"/> |
|
341 |
</dr:CobjCategory> |
|
342 |
--> |
|
343 |
</xsl:when><!-- drop journals --><!-- TODO: termination handling must refine --> |
|
344 |
<xsl:when |
|
345 |
test="lower-case(//*[local-name() = 'resourceType']/@uri) = 'http://purl.org/coar/resource_type/c_0640'"> |
|
346 |
<xsl:call-template name="terminate"/> |
|
347 |
</xsl:when> |
|
348 |
<xsl:otherwise> |
|
349 |
<xsl:call-template name="terminate"/> |
|
350 |
</xsl:otherwise> |
|
351 |
</xsl:choose><!-- review status --> |
|
323 |
|
|
324 |
|
|
325 |
<dr:CobjCategory> |
|
326 |
<xsl:variable name="varCobjCategory" select="vocabulary:clean( //*[local-name()='resourceType']/text(), 'dnet:publication_resource')"/> |
|
327 |
<xsl:variable name="varSuperType" select="vocabulary:clean( $varCobjCategory, 'dnet:result_typologies')"/> |
|
328 |
<xsl:if test="not(number($varCobjCategory) > 0)"> |
|
329 |
<xsl:variable name="varCobjCategory" select="'0000'"/> |
|
330 |
<xsl:variable name="varSuperType" select="'other'"/> |
|
331 |
</xsl:if> |
|
332 |
<xsl:attribute name="type"> |
|
333 |
<xsl:value-of select="$varSuperType"/> |
|
334 |
</xsl:attribute> |
|
335 |
<xsl:value-of select="$varCobjCategory"/> |
|
336 |
</dr:CobjCategory> |
|
337 |
|
|
338 |
<!-- review status --> |
|
352 | 339 |
<xsl:variable name="varRefereedConvt" |
353 | 340 |
select=" for $i in (//*[local-name() = 'resourceType']/(., @uri), //oai:setSpec, //*[local-name() = 'description']) return vocabulary:clean(normalize-space($i), 'dnet:review_levels')"/> |
354 | 341 |
<xsl:variable name="varRefereedIdntf" |
... | ... | |
380 | 367 |
<oaf:dateAccepted> |
381 | 368 |
<xsl:value-of |
382 | 369 |
select="dateCleaner:dateISO(normalize-space(//datacite:date[@dateType = 'Issued']))"/> |
383 |
</oaf:dateAccepted><!-- |
|
384 |
<oaf:accessrights> |
|
385 |
<xsl:variable name='varAccessRights' select="TransformationFunction:convertString($tf, (//*[local-name() = 'rights']/(@uri, @rightsURI))[1], 'AccessRights')" /> |
|
386 |
</oaf:accessrights> |
|
387 |
<xsl:choose> |
|
388 |
<xsl:when test="not($varAccessRights = 'EMBARGO' and not((xs:date( max( ($varEmbargoEndDate, '0001-01-01') ) ) gt current-date())))"> |
|
389 |
<xsl:value-of select="TransformationFunction:convertString($tf, (//*[local-name() = 'rights']/(@uri, @rightsURI))[1], 'AccessRights')"/> |
|
390 |
</xsl:when> |
|
391 |
<xsl:when test="$varAccessRights = 'EMBARGO' and not((xs:date( max( ($varEmbargoEndDate, '0001-01-01') ) ) gt current-date()))"> |
|
392 |
<xsl:value-of select="'OPEN'"/> |
|
393 |
</xsl:when> |
|
394 |
</xsl:choose> |
|
395 |
--> |
|
370 |
</oaf:dateAccepted> |
|
371 |
<xsl:variable name="varEmbargoEndDate" |
|
372 |
select="dateCleaner:dateISO(normalize-space(//*[local-name() = 'date'][@dateType = 'Available']))"/> |
|
396 | 373 |
<xsl:variable name="varAccessRights" |
397 | 374 |
select=" string-join((for $i in ((//*[local-name() = 'rights'], //*[lower-case(local-name()) = 'licensecondition'])/(@*, .)) return vocabulary:clean($i, 'dnet:access_modes')), ' ')"/> |
398 | 375 |
<oaf:accessrights> |
... | ... | |
455 | 432 |
<xsl:attribute name="semanticrelation" select="string('compliesWith')"/> |
456 | 433 |
</oaf:eoscifguidelines> |
457 | 434 |
</xsl:if> |
458 |
</xsl:for-each><!-- oaf:container --><!-- TODO: set @typ --><!-- |
|
459 |
<xsl:variable name="varCitation" select="//*[starts-with(local-name(), 'citation')]" /> |
|
460 |
<xsl:variable name="varSource" select="//dc:source[//oaf:datasourceprefix[.=('od______1514', 'od______3158')]]" /> |
|
461 |
--><!-- test |
|
462 |
<xsl:if test="contains($varContainerPid, ':::')"> |
|
463 |
<oaf:container> |
|
464 |
<xsl:for-each select="tokenize(normalize-space($varContainerPid), ' ')"> |
|
465 |
<xsl:attribute name="{lower-case(substring-before(., ':::'))}" select="substring-before(substring-after(., ':::'), ':::')"/> |
|
466 |
<xsl:attribute name="typ" select="substring-after(substring-after(., ':::'), ':::')"/> |
|
467 |
</xsl:for-each> |
|
468 |
<xsl:choose> |
|
469 |
<xsl:when test="lower-case(substring-before(., ':::')) = ('issn', 'pissn', 'eissn', 'lissn')"> |
|
470 |
<xsl:attribute name="vol" select="$varCitation[local-name(.) = 'citationVolume']"/> |
|
471 |
<xsl:attribute name="iss" select="$varCitation[local-name(.) = 'citationIssue']"/> |
|
472 |
<xsl:attribute name="sp" select="$varCitation[local-name(.) = 'citationStartPage']"/> |
|
473 |
<xsl:attribute name="ep" select="$varCitation[local-name(.) = 'citationEndPage']"/> |
|
474 |
</xsl:when> |
|
475 |
<xsl:when test="lower-case(substring-before(., ':::')) = 'isbn'"> |
|
476 |
<xsl:attribute name="edt" select="$varCitation[local-name(.) = 'citationEdition']"/> |
|
477 |
<xsl:attribute name="sp" select="$varCitation[local-name(.) = 'citationStartPage']"/> |
|
478 |
<xsl:attribute name="ep" select="$varCitation[local-name(.) = 'citationEndPage']"/> |
|
479 |
</xsl:when> |
|
480 |
</xsl:choose> |
|
481 |
<xsl:value-of select="$varCitation[local-name(.) = 'citationTitle'], $varSource" /> |
|
482 |
</oaf:container> |
|
483 |
</xsl:if> |
|
484 |
test --><!-- Huelva marks L, E ISSNs as ISSNs, with mark within field in spaces or after blanc --><!-- Qeios declares many records as text, although many seem to be definitions which are also related to 'journal' volumes/issues --><!-- oaf:fulltext--><!-- toDo: clarify if fulltext should be filled when URL given and rights oa --><!-- |
|
485 |
<xsl:if test="//*[local-name() = 'file']"> |
|
486 |
<oaf:fulltext> |
|
487 |
<xsl:value-of select="//*[local-name() = 'file']"/> |
|
488 |
</oaf:fulltext> |
|
489 |
</xsl:if> |
|
490 |
--> |
|
435 |
</xsl:for-each> |
|
491 | 436 |
</metadata> |
492 | 437 |
<xsl:copy-of select="//*[local-name() = 'about']"/> |
493 | 438 |
</record> |
494 |
</xsl:template><!-- Remove EOSC:: subjects, they need to go to eoscifguidelines DA PROVARE QUESTA SOTTO --> |
|
439 |
</xsl:template> |
|
440 |
<!-- Remove EOSC:: subjects, they need to go to eoscifguidelines --> |
|
495 | 441 |
<xsl:template match="//*[local-name()='subject' and starts-with(./text(), 'EOSC::')]"/> |
496 | 442 |
<xsl:template match="node() | @*"> |
497 | 443 |
<xsl:copy copy-namespaces="no"> |
Also available in: Unified diff
Improved mapping of cobjcategory for ROHub