1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="559212dd-cca9-477e-b43c-6222da5b49e7_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2016-03-10T19:09:33+00:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>dc_cleaning_OPENAIREplus_repec</TITLE>
|
14
|
<CODE>declare_script "dc_cleaning_OpenAIREplus_repec";
|
15
|
declare_ns amf = "http://amf.openlib.org";
|
16
|
declare_ns repec="http://repec.openlib.org";
|
17
|
declare_ns oaf = "http://namespace.openaire.eu/oaf";
|
18
|
declare_ns dri = "http://www.driver-repository.eu/namespace/dri";
|
19
|
declare_ns dr = "http://www.driver-repository.eu/namespace/dr";
|
20
|
declare_ns dc = "http://purl.org/dc/elements/1.1/";
|
21
|
declare_ns prov = "http://www.openarchives.org/OAI/2.0/provenance";
|
22
|
$var0 = "''";
|
23
|
$varFP7 = "'corda_______::'";
|
24
|
$varH2020 = "'corda__h2020::'";
|
25
|
$varFCT="'fct_________::'";
|
26
|
$varDummy = "''";
|
27
|
// $varPmc = Convert(xpath:"substring-after(//dc:identifier, '=')", PMC);
|
28
|
static $varDatasourceid = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//EXTRA_FIELDS/FIELD[key='OpenAireDataSourceId']/value"]);
|
29
|
static $varRepoid = xpath:"//dri:repositoryId";
|
30
|
static $varOfficialname = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//OFFICIAL_NAME"]);
|
31
|
dri:objIdentifier = xpath:"//dri:objIdentifier";
|
32
|
dri:repositoryId = $varRepoid;
|
33
|
//dri:repositoryId = xpath:"//dri:repositoryId";
|
34
|
dri:recordIdentifier = RegExpr(xpath:"//dri:recordIdentifier", $var0, "s/^(.*)(::)/$2/");
|
35
|
// skipRecords
|
36
|
if xpath:"//repec:restriction[.='Access to full text is restricted to subscribers.'] or //repec:function[.='link to article abstract page'] or //amf:file/amf:url[starts-with(., 'http://www.sciencedirect.com/')]" dc:coverage = skipRecord(); else $varDummy = "''";
|
37
|
//
|
38
|
apply xpath:"//amf:hasauthor/amf:person/amf:name" if xpath:"string-length(.) > 0" dc:creator = xpath:"normalize-space(.)"; else $varDummy = "''";
|
39
|
apply xpath:"//amf:amf/amf:text/amf:title" if xpath:"string-length(.) > 0" dc:title = xpath:"normalize-space(.)"; else $varDummy = "''";
|
40
|
apply xpath:"//amf:keywords" if xpath:"string-length(.) > 0" dc:subject = xpath:"normalize-space(.)"; else $varDummy = "''";
|
41
|
apply xpath:"//amf:haspublisher/amf:person/amf:name" if xpath:"string-length(.) > 0" dc:publisher = xpath:"normalize-space(.)"; else $varDummy = "''";
|
42
|
apply xpath:"//dc:source" if xpath:"string-length(.) > 0" dc:source = xpath:"normalize-space(.)"; else $varDummy = "''";
|
43
|
dc:contributor = xpath:"//dc:contributor";
|
44
|
dc:description = xpath:"//amf:abstract";
|
45
|
$varHttpTest = "''";
|
46
|
if xpath:"//amf:file/amf:url[starts-with(., 'http')]" $varHttpTest = "true"; else dc:identifier = skipRecord();
|
47
|
apply xpath:"//amf:file/amf:url" if xpath:"starts-with(normalize-space(.), 'http')" dc:identifier = xpath:"normalize-space(.)"; else dr:CobjIdentifier = xpath:"normalize-space(.)";
|
48
|
//$varUrl = xpath:"concat('http://europepmc.org/articles/', $varPmc)";
|
49
|
//if xpath:"string-length($varPmc) &gt; 0" dc:identifier = $varUrl; else dc:identifier = xpath:"//dc:identifier";
|
50
|
//if xpath:"//dc:identifier[starts-with(., 'http')]" $varHttpTest = "true"; else dc:identifier = skipRecord();
|
51
|
//apply xpath:"//dc:identifier" if xpath:"starts-with(normalize-space(.), 'http')" dc:identifier = xpath:"normalize-space(.)"; else dr:CobjIdentifier = xpath:"normalize-space(.)";
|
52
|
dr:dateOfCollection = xpath:"//dri:dateOfCollection";
|
53
|
static dr:dateOfTransformation = xpath:"current-dateTime()";
|
54
|
dc:type = xpath:"//amf:type";
|
55
|
dc:language = Convert(xpath:"//dc:language", Languages);
|
56
|
//dc:language = "eng";
|
57
|
//if xpath:"//dc:rights[text()='info:eu-repo/semantics/openAccess']" dc:publisher = xpath:"//dc:publisher"; else dc:publisher = skipRecord();
|
58
|
dc:date = xpath:"//dc:date";
|
59
|
if xpath:"//amf:issuedate" oaf:dateAccepted = Convert(xpath:"descendant-or-self::amf:issuedate", DateISO8601, "yyyy-MM-dd", "min()"); else $varDummy = "''";
|
60
|
if xpath:"//amf:date" oaf:dateAccepted = Convert(xpath:"descendant-or-self::amf:date", DateISO8601, "yyyy-MM-dd", "min()"); else $varDummy = "''";
|
61
|
apply xpath:"//dc:date" if xpath:"starts-with(normalize-space(.), 'info:eu-repo/date')" oaf:embargoenddate = RegExpr(xpath:"normalize-space(.)", $var0, "s/^(.*info:eu-repo\/date\/embargoEnd\/)//gmi"); else $var0 = "''";
|
62
|
// FP7
|
63
|
oaf:projectid = xpath:"//dc:relation[matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', 'i')]/concat($varFP7, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))";
|
64
|
// H2020
|
65
|
oaf:projectid = xpath:"//dc:relation[matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', 'i')]/concat($varH2020, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))";
|
66
|
// FCT
|
67
|
oaf:projectid = xpath:"//dc:relation[matches(normalize-space(.), '(info:eu-repo/grantagreement/fct)/(.+)/(\d+)(.*)', 'i')]/concat($varFCT, replace(normalize-space(.), '(info:eu-repo/grantagreement/fct)/(.+)/(\d+)(.*)', '$3', 'i'))";
|
68
|
dc:relation = xpath:"//dc:relation";
|
69
|
//comment-js-09-10-2012 apply xpath:"//dc:rights" if xpath:"starts-with(normalize-space(.), 'info:eu-repo/semantics')" dc:rights = empty; else dc:rights = xpath:"normalize-space(.)";
|
70
|
// static oaf:datasourceid = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//EXTRA_FIELDS/FIELD[key='OpenAireDataSourceId']/value"]);
|
71
|
//
|
72
|
//
|
73
|
//
|
74
|
static $varDsType = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//CONFIGURATION/DATASOURCE_TYPE"]);
|
75
|
//if xpath:"$varDsType='aggregator'" oaf:hostingDatasourceid = xpath:"//prov:baseURL"; else oaf:hostingDatasourceid = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//EXTRA_FIELDS/FIELD[key='OpenAireDataSourceId']/value"]);
|
76
|
oaf:collectedDatasourceid = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//EXTRA_FIELDS/FIELD[key='OpenAireDataSourceId']/value"]);
|
77
|
//
|
78
|
dr:CobjCategory = Convert(xpath:"//amf:type", TextTypologies);
|
79
|
//apply xpath:"//dc:rights" if xpath:"starts-with(normalize-space(.), 'info:eu-repo/semantics')" oaf:accessrights = Convert(xpath:"normalize-space(.)", AccessRights); else dc:rights = xpath:".";
|
80
|
//if xpath:"//dc:rights[starts-with(normalize-space(.), 'info:eu-repo/semantics')]" $var0 = "''"; else oaf:accessrights = "OPEN";
|
81
|
oaf:accessrights = "OPEN";
|
82
|
//if xpath:"count(//dc:rights) = 0" oaf:accessrights = "OPEN"; else $var0 = "''";
|
83
|
// oaf:accessrights = Convert(xpath:"normalize-space(//dc:rights)", AccessRights);
|
84
|
//
|
85
|
static oaf:collectedFrom = set("''", @name = $varOfficialname; , @id = $varDatasourceid;);
|
86
|
static oaf:hostedBy = set("''", @name = $varOfficialname; , @id = $varDatasourceid;);
|
87
|
//
|
88
|
$varId = identifierExtract('["//*"]' , xpath:"./*[local-name()='record']//*[local-name()='metadata']" , '(10[.][0-9]{4,}[^\s"/<>]*/[^\s"<>]+)');
|
89
|
oaf:identifier = set(xpath:"$varId//value", @identifierType = "doi";);
|
90
|
$varJournal = xpath:"//amf:journaltitle";
|
91
|
$varVolume = xpath:"//amf:serial/amf:volume";
|
92
|
$varStartPage = xpath:"//amf:serial/amf:startpage";
|
93
|
$varEndPage = xpath:"//amf:serial/amf:endpage";
|
94
|
$varIssue = xpath:"//amf:serial/amf:issue";
|
95
|
//if xpath:"string-length($varJournal) > 0" oaf:journal = set(xpath:"//amf:journaltitle", @issn = xpath:"//amf:journaltitle";, @issn = xpath:"./@issn";, @eissn = xpath:"./@eissn";); else $varDummy = "''";
|
96
|
oaf:journal = set(xpath:"//amf:journaltitle", @vol = $varVolume;, @iss =$varIssue;, @sp= $varStartPage;, @ep= $varEndPage;, @issn = xpath:"./@issn";, @eissn = xpath:"./@eissn";);
|
97
|
oaf:datasourceprefix = xpath:"//oaf:datasourceprefix";
|
98
|
end</CODE>
|
99
|
</SCRIPT>
|
100
|
</CONFIGURATION>
|
101
|
<STATUS/>
|
102
|
<SECURITY_PARAMETERS/>
|
103
|
</BODY>
|
104
|
</RESOURCE_PROFILE>
|