Project

General

Profile

1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="aff1c6d1-5d07-4082-8249-07810a36510a_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2020-07-10T08:55:40+00:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <IMPORTED/>
12
            <SCRIPT>
13
                <TITLE>mods2oaf_cleaning_OPENAIREplus_compliant_erasmus_amsterdam_oxford</TITLE>
14
                <CODE>declare_script "mods2oaf_cleaning_OPENAIREplus_compliant_erasmus_amsterdam_oxford";
15
                    declare_ns oaf = "http://namespace.openaire.eu/oaf";
16
                    declare_ns dri = "http://www.driver-repository.eu/namespace/dri";
17
                    declare_ns dr = "http://www.driver-repository.eu/namespace/dr";
18
                    declare_ns dc = "http://purl.org/dc/elements/1.1/";
19
                    declare_ns prov = "http://www.openarchives.org/OAI/2.0/provenance";
20
                    declare_ns mods = "http://www.loc.gov/mods/v3";
21
                    declare_ns dcterms = "http://purl.org/dc/terms/";
22
                    declare_ns gal="info:eu-repo/grantAgreement";
23
                    declare_ns rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
24
                    declare_ns oai="http://www.openarchives.org/OAI/2.0/";
25
                    declare_ns xs = "http://www.w3.org/2001/XMLSchema";
26
                    $var0 = "''";
27
                    //$var1 = "'corda_______::'";
28
                    $varFP7 = "'corda_______::'";
29
                    $varH2020 = "'corda__h2020::'";
30
                    $varAKA = "'aka_________::'";
31
                    $varARC = "'arc_________::'";
32
                    $varCONICYT = "'conicytf____::'";
33
                    $varDFG = "'dfgf________::'";
34
                    $varFCT="'fct_________::'";
35
                    $varFWF = "'fwf_________::'";
36
                    $varGSRT = "'gsrt________::'";
37
                    $varINNOVIRIS = "'innoviris___::'";
38
                    $varHRZZ = "'irb_hr______::'";
39
                    $varMESTD = "'mestd_______::'";
40
                    $varMIUR = "'miur________::'";
41
                    $varMZOS = "'irb_hr______::'";
42
                    $varNHMRC = "'nhmrc_______::'";
43
                    $varNIH = "'nih_________::'";
44
                    $varNSF = "'nsf_________::'";
45
                    $varNWO = "'nwo_________::'";
46
                    $varRCUK = "'rcuk________::'";
47
                    $varRPF = "'rpf_________::'";
48
                    $varSFI ="'sfi_________::'";
49
                    $varSGOV = "'sgov________::'"; // to be added, awaiting DOI from Pilar, found project ids not in CSV list?
50
                    $varSNSF = "'snsf________::'";
51
                    $varTARA = "'taraexp_____::'"; // to be added, awaiting DOI from André
52
                    $varTUBITAK = "'tubitakf____::'";
53
                    $varWT = "'wt__________::'";
54
                    //
55
                    static $varDatasourceid = getValue(PROFILEFIELD, [xpath:"concat('collection(&amp;apos;/db/DRIVER/RepositoryServiceResources&amp;apos;)//RESOURCE_PROFILE[.//EXTRA_FIELDS/FIELD[key=&amp;quot;NamespacePrefix&amp;quot;][value=&amp;quot;', //oaf:datasourceprefix, '&amp;quot;]]')", xpath:"//EXTRA_FIELDS/FIELD[key='OpenAireDataSourceId']/value"]);
56
                    static $varRepoid = xpath:"//dri:repositoryId";
57
                    static $varOfficialname = getValue(PROFILEFIELD, [xpath:"concat('collection(&amp;apos;/db/DRIVER/RepositoryServiceResources&amp;apos;)//RESOURCE_PROFILE[.//EXTRA_FIELDS/FIELD[key=&amp;quot;NamespacePrefix&amp;quot;][value=&amp;quot;', //oaf:datasourceprefix, '&amp;quot;]]')", xpath:"//CONFIGURATION/OFFICIAL_NAME"]);
58
                    if xpath:"//*[local-name()='header'][@status='deleted']" dc:creator = skipRecord(); else $varDummy = "''";
59
                    dri:objIdentifier = xpath:"//dri:objIdentifier";
60
                    dri:recordIdentifier = xpath:"//dri:recordIdentifier";
61
                    dri:repositoryId = xpath:"//dri:repositoryId";
62
                    oaf:datasourceprefix = xpath:"//oaf:datasourceprefix";
63
                    dr:dateOfCollection = xpath:"//dri:dateOfCollection";
64
                    static dr:dateOfTransformation = xpath:"current-dateTime()";
65
                    dc:title = xpath:"//mods:mods/mods:titleInfo/mods:title[string-length(normalize-space(.)) &gt; 0]/normalize-space(.)";
66
                    dc:description = xpath:"//mods:abstract[string-length(normalize-space(.)) &gt; 0]/normalize-space(.)";
67
                    //
68
                    // test apply xpath:"//mods:name[@type='personal']" if xpath:"true()" dc:creator = xpath:"concat(./mods:namePart[@type='family'], ', ', ./mods:namePart[@type='given'])"; else $varDummy = "''";
69
                    //dc:creator =  xpath:"//mods:name[@type='personal']/mods:displayForm";
70
                    $varOrcidName = xpath:"//mods:name[@type='personal'][./mods:role/mods:roleTerm = 'author'][string-length(normalize-space(./mods:displayForm[1])) &gt; 0]/mods:displayForm/normalize-space(.)";
71
                    $varOrcidOrcid = xpath:"//mods:name[@type='personal'][./mods:role/mods:roleTerm = 'author'][string-length(normalize-space(./mods:displayForm[1])) &gt; 0]/(mods:extension/mods:identifier[@type=('orcid', 'scopus-author-id', 'researcherid', 'ssrn-author-id')]/string(.), '')[1]";
72
                    $varCreatorIdType = xpath:"//mods:name[@type='personal'][./mods:role/mods:roleTerm = 'author'][string-length(normalize-space(./mods:displayForm[1])) &gt; 0]/(mods:extension/mods:identifier[@type=('orcid', 'scopus-author-id', 'researcherid', 'ssrn-author-id')]/string(@type), '')[1]";
73
                    dc:creator = set(xpath:"$varOrcidName",
74
                    @nameIdentifier = xpath:"subsequence($varOrcidOrcid,position(),1)";,
75
                    //@nameIdentifierScheme=xpath:"replace(subsequence($varOrcidOrcid,position(),1),'^.+$','ORCID')";,
76
                    @nameIdentifierScheme=xpath:"subsequence($varCreatorIdType,position(),1)";,
77
                    //@schemeUri=xpath:"replace(subsequence($varOrcidOrcid,position(),1),'^.+$','http://orcid.org/')";
78
                    @schemeUri=xpath:"replace(replace(replace(subsequence($varCreatorIdType,position(),1),'^orcid$','http://orcid.org/'), '(researcherid|scopus-author-id)', ''), 'ssrn-author-id', 'https://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id')";);
79
                    //
80
                    if xpath:"not(//mods:title) or not(//mods:identifier[@type='urn'])" dc:coverage = skipRecord(); else $varDummy = "''";
81
                    $varhostprefix = "'http://ora.ox.ac.uk/objects/uuid:'";
82
                    dc:identifier = xpath:"concat($varhostprefix, (//mods:identifier[@type='urn'])[1]/substring-after(., 'uuid:'))";
83
                    dr:CobjIdentifier = xpath:"//mods:identifier[not(@type='urn')]";
84
                    // oaf:fulltext = xpath:"//mods:location/mods:url[@access='raw object']";
85
                    $varLang = Convert(xpath:"//mods:language/mods:languageTerm[@type='text'] | //mods:language/mods:languageTerm[@authority='rfc3066']", Languages);
86
                    if xpath:"$varLang = 'aar'" dc:language = "eng"; else dc:language = $varLang;
87
                    dc:date = xpath:"//mods:dateIssued/normalize-space(.)";
88
                    dc:subject = xpath:"//mods:subject/(mods:topic, mods:genre)[string-length(normalize-space(.)) &gt; 0]/normalize-space(.)";
89
                    dc:publisher = xpath:"//mods:publisher[string-length(normalize-space(.)) &gt; 0]/normalize-space(.)";
90
                    dc:type = xpath:"//mods:mods/mods:genre/normalize-space(.)";
91
                    dc:relation = xpath:"//gal:grantAgreement/@code | //gal:title";
92
                    //apply xpath:"//gal:grantAgreement" if xpath:"matches(normalize-space(./@code), '(info:eu-repo/grantagreement/eu/)(\d\d\d\d\d\d)(.*)', 'i')" oaf:projectid = xpath:"concat($varFP7, replace(normalize-space(./@code), '(info:eu-repo/grantagreement/eu/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"; else $varDummy = "''";
93
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm = 'Seventh Framework Programme']/mods:affiliation[@type = 'grantNumber']/concat($varFP7, replace(., '.*(\d{6}).*', '$1'))";
94
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm = 'Horizon 2020']/mods:affiliation[@type = 'grantNumber']/concat($varH2020, replace(., '.*(\d{6}).*', '$1'))";
95
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][matches(./mods:displayForm[1], '.*(Suomen Akatemia|Academy of Finland).*')]/mods:affiliation[@type = 'grantNumber']/concat($varAKA, .)";
96
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Australian Research Council')]]/mods:affiliation[@type = 'grantNumber']/concat($varARC, .)";
97
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Comisión Nacional de Investigación Científica y Tecnológica') or contains(., 'CONICYT')]]/mods:affiliation[@type = 'grantNumber']/concat($varCONICYT, .)";
98
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Deutsche Forschungsgemeinschaft') or contains(., 'DFG')]]/mods:affiliation[@type = 'grantNumber']/concat($varDFG, .)";
99
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Fundação para a Ciência e a Tecnologia')]]/mods:affiliation[@type = 'grantNumber']/concat($varFCT, .)";
100
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Fonds zur Förderung der Wissenschaftlichen Forschung') or contains(., 'Austrian Science Fund')]]/mods:affiliation[@type = 'grantNumber']/concat($varFWF, .)";
101

    
102
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'General Secretariat for Research and Technology') or contains(., 'GSRT') or contains(., 'Γενική Γραμματεία Έρευνας και Τεχνολογίας')]]/mods:affiliation[@type = 'grantNumber']/concat($varGSRT, .)";
103

    
104
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Croatian Science Foundation') or contains(., 'National Foundation for Science, Higher Education and Technological Development of the Republic of Croatia') or contains(., 'Hrvatska zaklada za znanost')]]/mods:affiliation[@type = 'grantNumber']/concat($varHRZZ, .)";
105

    
106
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'INNOVIRIS')]]/mods:affiliation[@type = 'grantNumber']/concat($varINNOVIRIS, .)";
107

    
108
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[(contains(., 'Ministarstvo Prosvete, Nauke i Tehnolo')  and contains(., 'kog Razvoja')) or contains(., 'MESTD')]]/mods:affiliation[@type = 'grantNumber']/concat($varMESTD, .)";
109

    
110
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[(contains(., 'Ministero dell') and contains(., 'Istruzione dell') and contains(., 'Università e della Ricerca')) or contains(., 'MIUR')]]/mods:affiliation[@type = 'grantNumber']/concat($varMIUR, .)";
111

    
112
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Ministarstvo Znanosti, Obrazovanja i Sporta') or contains(., 'Ministry of Science, Education and Sports')]]/mods:affiliation[@type = 'grantNumber']/concat($varMZOS, .)";
113
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'National Health and Medical Research Council') or contains(., 'NHMRC')]]/mods:affiliation[@type = 'grantNumber']/concat($varNHMRC, .)";
114
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'National Science Foundation')]]/mods:affiliation[@type = 'grantNumber']/concat($varNSF, .)";
115
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Netherlands Organisation for Scientific Research') or contains(., 'Nederlandse Organisatie voor Wetenschappelijk Onderzoek')]]/mods:affiliation[@type = 'grantNumber']/concat($varNWO, .)";
116
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Research Councils UK') or contains(., 'RCUK')]]/mods:affiliation[@type = 'grantNumber']/concat($varRCUK, .)";
117

    
118
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Research Promotion Foundation')]]/mods:affiliation[@type = 'grantNumber']/concat($varRPF, .)";
119

    
120
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Science Foundation Ireland')]]/mods:affiliation[@type = 'grantNumber']/concat($varSFI, .)";
121
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Swiss National Science Foundation') or contains(., 'Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung')]]/mods:affiliation[@type = 'grantNumber']/concat($varSFI, .)";
122

    
123
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Gobierno de España')]]/mods:affiliation[@type = 'grantNumber']/concat($varSGOV, .)";
124
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Fondation Tara Expéditions')]]/mods:affiliation[@type = 'grantNumber']/concat($varTARA, .)";
125

    
126
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Turkish National Science and Research Council') or (contains(., 'Türkiye Bilimsel ve Teknolojik Ara') and contains(., 'rma Kurumu'))]]/mods:affiliation[@type = 'grantNumber']/concat($varTUBITAK, .)";
127
                    oaf:projectid = xpath:"//mods:name[.//mods:roleTerm = 'Funder'][./mods:displayForm[contains(., 'Wellcome Trust')]]/mods:affiliation[@type = 'grantNumber']/concat($varWT, .)";
128
                    //
129
                    // rights
130
                    // dc:rights = xpath:"//dcterms:accessRights";
131
                    dc:rights = xpath:"//mods:url/@displayLabel";
132
                    //if xpath:"//mods:accessCondition[@type='restrictionOnAccess']" oaf:accessrights = "OPEN"; else dc:coverage = skipRecord();
133
                    //oaf:accessrights = Convert(xpath:"//mods:accessCondition[@type='restrictionOnAccess']", AccessRights);
134
                    apply xpath:"//mods:accessCondition[@type='restrictionOnAccess' and starts-with(., 'http')]" if xpath:"." oaf:license = xpath:"."; else $varDummy = "''";
135
                    $varEmbargoEnd = xpath:"//mods:accessCondition[@type='restrictionOnAccess' and matches(., 'Restricted: Full content available from \d{4}-\d{2}-\d{2}.*')]/replace(., 'Restricted: Full content available from (\d{4}-\d{2}-\d{2}).*', '$1')";
136
                    if xpath:"$varEmbargoEnd" oaf:embargoenddate = $varEmbargoEnd; else $var0 = "''";
137
                    if xpath:"(xs:date( max( ($varEmbargoEnd, '0001-01-01') ) ) gt current-date())" oaf:accessrights = "EMBARGO"; else $var0 = "''";
138
                    if xpath:"not(xs:date( max( ($varEmbargoEnd, '0001-01-01') ) ) gt current-date())" oaf:accessrights = Convert(xpath:"//mods:accessCondition[@type='restrictionOnAccess']", AccessRights); else $var0 = "''";
139
                    //
140
                    // resource type, super resource type
141
                    //dr:CobjCategory = Convert(xpath:"//mods:genre[@type='typeofwork']", TextTypologies);
142
                    // datasource Oxford University Research Archive is heterogeneously coding resource type: with or without @type='typeofwork', using or not using info:eu-repo vocabulary
143
                    //$varCobjCategory = Convert(xpath:"//mods:mods/mods:genre[@type='typeofwork' or starts-with(., 'info:eu-repo/semantics/')]", TextTypologies);
144
                    $varCobjCategory = Convert(xpath:"normalize-space(subsequence(//mods:mods/mods:genre/replace(., '(.*)[,:] .*', '$1'), 1, 1))", TextTypologies);
145
                    $varSuperType = Convert(xpath:"normalize-space($varCobjCategory)", SuperTypes);
146
                    dr:CobjCategory = set($varCobjCategory, @type = $varSuperType;);
147
                    //
148
                    // review status
149
                    // the ugly rules directly below were used before the vocabulary was again updated
150
                    //$varRefereedPeerreviewed1a = xpath:"//mods:form[./@type = 'peerReviewed' and normalize-space(lower-case(.)) = ('peer reviewed', 'peer reveiwed', 'peer reviewd', 'peer reviwed', 'peer-reviewed', 'peer revivewd', 'peer reviewe', 'peer revieved', 'peer rviewed', 'peer revivewed', 'peer reivewed', 'peerreviewed', 'peern reviewed', 'peer review', 'reviewed', 'reviewed (other)', 'reviewed(other)', 'rviewed (other)', 'reviewd (other)', 'reivewed (other)', 'refereed')]/'0001'";
151
                    //$varRefereedVersion1b = xpath:"//mods:form[./@type = 'version' and normalize-space(lower-case(.)) = ('reviewed (other)')]/'0001'";
152
                    //$varRefereedEdition1a = xpath:"//mods:edition[normalize-space(lower-case(.)) = ('corrected manuscript after review', 'post-review, submitted to proceedings', 'manuscript accepted, after first revision')]/'0001'";
153
                    //$varRefereedEdition1b = xpath:"//mods:edition[(starts-with(normalize-space(lower-case(.)), 'post editor') and contains(normalize-space(lower-case(.)), 's corrections but pre journal') and ends-with(normalize-space(lower-case(.)), 's formatting')) or (starts-with(normalize-space(lower-case(.)), 'author') and ends-with(normalize-space(lower-case(.)), 's copy, final text, after peer-review'))]/'0001'";
154
                    //$varRefereedPeerreviewed2 = xpath:"//mods:form[./@type = 'peerReviewed' and normalize-space(lower-case(.)) = ('not peer reviewed', 'not peer-reviewed', 'not reviewed', 'under review', 'awaiting peer review')]/'0002'";
155
                    //$varRefereedTypeofwork2 = xpath:"//mods:genre[./@type = 'typeofwork' and normalize-space(lower-case(.)) = ('preprint', 'Article, pre-print', 'discussion-paper', 'working/dicussion paper', 'working paper', 'working-paper', 'working/discussion paper')]/'0002'";
156
                    //$varRefereedStatus2 = xpath:"//mods:form[./@type = 'status' and normalize-space(lower-case(.)) = ('submitted', 'under review')]/'0002'";
157
                    //$varRefereedVersion2a = xpath:"//mods:form[./@type = 'version' and normalize-space(lower-case(.)) = ('pre-print', 'Preprint', 'submitted manuscript', 'submitted version')]/'0002'";
158
                    //$varRefereedVersion2b = xpath:"//mods:form[./@type = 'version' and starts-with(normalize-space(lower-case(.)), 'author') and (ends-with(normalize-space(lower-case(.)), 's version') or ends-with(normalize-space(lower-case(.)), 's original'))]/'0002'";
159
                    //$varRefereedEdition2a = xpath:"//mods:edition[normalize-space(lower-case(.)) = ('young lives working paper 63', 'ophi working paper', 'invited paper, this version submitted by authors to editors', 'draft', 'version submitted to publisher', 'wed working paper', 'this is the version prior to the final minor revisions', 'preliminary', 'as submitted', 'submitted version', 'working paper', 'working paper, later draft published', 'version for publication currently under peer review', 'preprint', 'pre-print')]/'0002'";
160
                    //$varRefereedEdition2b = xpath:"//mods:edition[(starts-with(normalize-space(lower-case(.)), 'author') and ends-with(normalize-space(lower-case(.)), 's original')) or (starts-with(normalize-space(lower-case(.)), 'updated author') and ends-with(normalize-space(lower-case(.)), 's original')) or (starts-with(normalize-space(lower-case(.)), 'author') and ends-with(normalize-space(lower-case(.)), 's submitted version; pre-proof etc'))]/'0002'";
161
                    //if xpath:"'0001' = ($varRefereedPeerreviewed1a, $varRefereedVersion1b, $varRefereedEdition1a, $varRefereedEdition1b)" oaf:refereed = xpath:"'0001'"; else $varDummy= "''";
162
                    //if xpath:"'0002' = ($varRefereedPeerreviewed2, $varRefereedTypeofwork2, $varRefereedStatus2, $varRefereedVersion2a, $varRefereedVersion2b, $varRefereedEdition2a, $varRefereedEdition2b)" oaf:refereed = xpath:"'0002'"; else $varDummy= "''";
163
                    //
164
                    // mostly review status is converted from statements on resources type, version, status etc, but also deduced from e.g. PIDs and other information
165
                    $varRefereedConvt = Convert(xpath:"(//mods:form[./@type = 'peerReviewed'], //mods:form[./@type = ('version', 'status')], //mods:edition, //mods:genre[./@type = 'typeofwork'], //mods:note[./@displayLabel='status'], //mods:note[./@displayLabel = 'symplectic-object-format'])", ReviewLevels);
166
                    $varRefereedIdntf = xpath:"//*[string(node-name(.)) = 'mods:identifier' and ./@ type='doi' and contains(lower-case(normalize-space(.)), '/preprints.')]/'0002'";
167
                    //$varRefereedOther = xpath:"//mods:note[starts-with(., 'referee-status:')]/replace(replace(replace(., 'referee-status: ([A-Za-z ,]*)\s(.+\s)*.*', '$1'), 'Awaiting Peer Review', '0002'), '(Indexed|(Approved( with reservations)?)(, Approved( with reservations)?)*)', '0001')";
168
                    // 2 additional refereed statements for the following mods:note rule, probably for crosscheck or similarity_check; no additional refereed statements for the other mods:note rules
169
                    $varRefereedOther = xpath:"(//mods:note[starts-with(., 'referee-status: Approved')]/'0001', //mods:note[starts-with(., 'referee-status: Indexed')]/'0001', //mods:note[starts-with(., 'crosscheck: This document is CrossCheck deposited')]/'0001', //mods:note[starts-with(., 'similarity_check: This document is Similarity Check deposited')]/'0001', //mods:note[starts-with(., 'referee-status: Awaiting Peer Review')]/'0002')";
170
                    //
171
                    $varRefereed = xpath:"($varRefereedConvt, $varRefereedIdntf, $varRefereedOther)";
172
                    if xpath:"count(index-of($varRefereed, '0001')) &gt;0" oaf:refereed = xpath:"'0001'"; else $varDummy= "''";
173
                    if xpath:"count(index-of($varRefereed, '0002')) &gt;0 and count(index-of($varRefereed, '0001')) = 0" oaf:refereed = xpath:"'0002'"; else $varDummy= "''";
174

    
175
                    //
176
                    oaf:dateAccepted = Convert(xpath:"descendant-or-self::mods:dateIssued", DateISO8601, "yyyy-MM-dd", "min()");
177
                    oaf:collectedDatasourceid = xpath:"$varDatasourceid";
178
                    static oaf:collectedFrom = set("''", @name = $varOfficialname; , @id = $varDatasourceid;);
179
                    static oaf:hostedBy = set("''", @name = $varOfficialname; , @id = $varDatasourceid;);
180
                    //
181
                    //$varId = identifierExtract('["//*"]' , xpath:"./*[local-name()='record']" , '(10[.][0-9]{4,}[^\s"/&lt;&gt;]*/[^\s"&lt;&gt;]+)');
182
                    //oaf:identifier = set(xpath:"$varId//value", @identifierType = "doi";);
183
                    $varIdDoi = xpath:"//mods:mods/mods:identifier[@type='doi']";
184
                    oaf:identifier = set(xpath:"$varIdDoi", @identifierType = "doi";);
185

    
186
                    $varIdIsi = xpath:"//mods:mods/mods:identifier[@type='isidoc']";
187
                    oaf:identifier = set(xpath:"$varIdIsi", @identifierType = "isiNumber";);
188

    
189
                    $varIdPatentno = xpath:"//mods:mods/mods:identifier[@type='patent_number']";
190
                    oaf:identifier = set(xpath:"$varIdPatentno", @identifierType = "patentNumber";);
191

    
192
                    $varIdPmc = xpath:"//mods:mods/mods:identifier[@type=('pmc', 'nihms')]";
193
                    oaf:identifier = set(xpath:"$varIdPmc", @identifierType = "pmid";);
194
                    $varIdPubmed = xpath:"//mods:mods/mods:identifier[@type='pubmed']";
195
                    oaf:identifier = set(xpath:"$varIdPubmed", @identifierType = "pubmed";);
196

    
197
                    $varIdUrn = xpath:"//mods:mods/mods:identifier[@type='urn']";
198
                    oaf:identifier = set(xpath:"$varIdUrn", @identifierType = "urn";);
199
                    //
200
                    $varJournalname = xpath:"//mods:relatedItem[@type='host']//mods:title";
201
                    $varJournaleissn = xpath:"//mods:identifier[@type='eissn']";
202
                    $varJournalissn = xpath:"//mods:identifier[@type='issn']";
203
                    $varJournalvol = xpath:"//mods:relatedItem[@type='host']/mods:part/mods:detail[@type='volume']/mods:number";
204
                    $varJournalissue = xpath:"//mods:relatedItem[@type='host']/mods:part/mods:detail[@type='issue']/mods:number";
205
                    $varJournalstartpage = xpath:"//mods:relatedItem[@type='host']/mods:part/mods:extent[@unit='page']/mods:start";
206
                    $varJournalendpage = xpath:"//mods:relatedItem[@type='host']/mods:part/mods:extent[@unit='page']/mods:end";
207
                    oaf:journal = set($varJournalname, @issn = $varJournalissn;, @eissn = $varJournaleissn;, @vol = $varJournalvol;, @iss=$varJournalissue;, @sp=$varJournalstartpage;, @ep=$varJournalendpage;);
208

    
209
                    // ToDo put ISBN, eisbn to container, take care of e.g. URN:ISSN:0305-9049, pubmed, pmc id, hdl
210

    
211
                    end</CODE>
212
            </SCRIPT>
213
        </CONFIGURATION>
214
        <STATUS/>
215
        <SECURITY_PARAMETERS/>
216
    </BODY>
217
</RESOURCE_PROFILE>
(51-51/59)