Revision 59098
Added by Alessia Bardi almost 4 years ago
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/noncompliant/crossref2oaf_covid19.xml | ||
---|---|---|
12 | 12 |
<SCRIPT> |
13 | 13 |
<TITLE>crossref2oaf_OPEN_COVID19</TITLE> |
14 | 14 |
<CODE> |
15 |
declare_script "crossref2dc_scientificdata-peerjpreprints";
|
|
15 |
declare_script "crossref2oaf_OPEN_COVID19";
|
|
16 | 16 |
declare_ns oaf = "http://namespace.openaire.eu/oaf"; |
17 | 17 |
declare_ns dri = "http://www.driver-repository.eu/namespace/dri"; |
18 | 18 |
declare_ns dr = "http://www.driver-repository.eu/namespace/dr"; |
... | ... | |
50 | 50 |
dri:recordIdentifier = xpath:"//dri:recordIdentifier"; |
51 | 51 |
|
52 | 52 |
// skipping records |
53 |
// type AMA (Ask Me Anything), type journal, type dataset (which are not datasets) |
|
54 |
if xpath:"//*[local-name()='family'][. = 'r/Science']" dc:type = skipRecord(); else $varDummy = "''"; |
|
55 |
if xpath:"//*[local-name()='items']/*[local-name()='type'][. = 'journal' or . = 'dataset']" dc:type = skipRecord(); else $varDummy = "''"; |
|
53 |
if xpath:"//*[local-name()='message-type'][. = 'work-list']" dc:type = skipRecord(); else $varDummy = "''"; |
|
56 | 54 |
// empty or missing title |
57 | 55 |
if xpath:"not(//*[local-name()='title']) or not(//*[local-name()='title'][string-length(.) > 0])" dc:title = skipRecord(); else $varDummy = "''"; |
58 | 56 |
// empty or missing creator |
59 | 57 |
if xpath:"not(//*[local-name()='author'][string-length(./*[local-name()='family']) + string-length(./*[local-name()='given']) > 0])" dc:creator = skipRecord(); else $varDummy = "''"; |
60 | 58 |
|
61 |
dc:description = xpath:"replace(//*[local-name()='abstract'] , '(&lt;.*?&gt;)', ' ')"; |
|
59 |
dc:description = xpath:"replace(//*[local-name()='abstract'][0] , '(&lt;.*?&gt;)', ' ')";
|
|
62 | 60 |
|
63 | 61 |
// creator |
64 | 62 |
//apply xpath:"//*[local-name()='author']" if xpath:"string-length(./*[local-name()='family']) + string-length(./*[local-name()='given']) > 0 and not(./*[local-name()='ORCID'])" dc:creator = xpath:"concat(normalize-space(./*[local-name()='family']), ./*[local-name()='suffix'][not(starts-with(lower-case(.), 'prof') or starts-with(lower-case(.), 'dr') or starts-with(lower-case(.), 'phd') or starts-with(lower-case(.), 'md'))]/concat(' ', normalize-space(.)), ', ', normalize-space(./*[local-name()='given']))"; else $varDummy = "''"; |
... | ... | |
79 | 77 |
$varHttpTest = "''"; |
80 | 78 |
// identifier |
81 | 79 |
apply xpath:"//*[local-name()='URL'][starts-with(normalize-space(.), 'http://dx.doi.org')]" if xpath:"." dc:identifier = xpath:"normalize-space(.)"; else $var0 = "''"; |
82 |
|
|
80 |
dc:source = xpath:"//*[local-name()='message']/*[local-name()='container-title']"; |
|
83 | 81 |
dr:dateOfCollection = xpath:"//dri:dateOfCollection"; |
84 | 82 |
static dr:dateOfTransformation = xpath:"current-dateTime()"; |
85 | 83 |
//###BASE type |
86 |
dc:type = xpath:"//*[local-name()='message']//*[local-name()='type']";
|
|
84 |
dc:type = xpath:"//*[local-name()='message']/*[local-name()='type']"; |
|
87 | 85 |
dc:language = xpath:"//*[local-name()='message']//*[local-name()='language']"; |
88 | 86 |
// date |
89 | 87 |
dc:date = xpath:"//*[local-name()='published-print' or local-name()='published-online']/*[local-name()='date-parts']/string-join(*[local-name()='array'], '-')"; |
... | ... | |
139 | 137 |
oaf:accessrights = "OPEN"; |
140 | 138 |
oaf:concept = set("''", @id = "covid-19";); |
141 | 139 |
dc:rights = xpath:"//*[local-name()='license']/*[local-name()='URL']"; |
140 |
oaf:license = xpath:"//message/license[./content-version='tdm']/URL"; |
|
142 | 141 |
|
143 | 142 |
// |
144 | 143 |
static oaf:collectedFrom = set("''", @name = $varOfficialname; , @id = $varDatasourceid;); |
... | ... | |
152 | 151 |
|
153 | 152 |
oaf:datasourceprefix = xpath:"//oaf:datasourceprefix"; |
154 | 153 |
// |
155 |
$varISSN = xpath:"//*[local-name()='ISSN']"; |
|
154 |
$varISSNp = xpath:"//*[local-name()='message']/*[local-name()='issn-type'][./type='print']/value"; |
|
155 |
$varISSNe = xpath:"//*[local-name()='message']/*[local-name()='issn-type'][./type='electronic']/value"; |
|
156 | 156 |
$varJournalTitle = xpath:"//*[local-name()='container-title']"; |
157 | 157 |
$varJournalVol = xpath:"//*[local-name()='metadata']/*[local-name()='items']/*[local-name()='volume']"; |
158 | 158 |
$varJournalIss = "''"; |
... | ... | |
161 | 161 |
// xpath:"//*[local-name()='page']/substring-before(., '-')"; |
162 | 162 |
$varJournalEp = "''"; |
163 | 163 |
// xpath:"//*[local-name()='page']/substring-after(., '-')"; |
164 |
oaf:journal = set($varJournalTitle, @issn = xpath:"$varISSN";, @vol = xpath:"$varJournalVol";, @iss = xpath:"$varJournalIss";, @sp = xpath:"$varJournalSp";, @ep = xpath:"$varJournalEp";);
|
|
164 |
oaf:journal = set($varJournalTitle, @eissn= xpath:"$varISSNe";, @issn = xpath:"$varISSNp";, @vol = xpath:"$varJournalVol";, @iss = xpath:"$varJournalIss";, @sp = xpath:"$varJournalSp";, @ep = xpath:"$varJournalEp";);
|
|
165 | 165 |
|
166 |
oaf:fulltext = xpath:"//*[local-name()='link']/*[local-name='intended-application'][.='text-mining']/*[local-name()='URL']";
|
|
166 |
oaf:fulltext = xpath:"//message/link[./intended-application ='text-mining' and ./content-type='application/pdf']/URL";
|
|
167 | 167 |
|
168 | 168 |
end |
169 | 169 |
|
Also available in: Unified diff
Fine tuned TDS for crossref covid19, to be used with WHO COVID-19 database data source