Project

General

Profile

1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="1fa784c6-0fc3-489f-80b7-3c404b5d9d2c_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2014-10-29T13:15:18+00:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <IMPORTED/>
12
            <SCRIPT>
13
                <TITLE>dc_cleaning_OPENAIREplus_compliant_doaj</TITLE>
14
                <CODE>declare_script "dc_cleaning_OpenAIREplus_compliant_doaj";
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
$var0 = "''";
21
$var1 = "'corda_______::'";
22
$varDummy = "''";
23
// $varUnknownRepoId = "'openaire____::55045bd2a65019fd8e6741a755395c8c'";
24
$varUnknownRepoId = "'openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18'";
25
$varUnknownRepoName = "'Unknown Repository'";
26
static $varDatasourceid = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//EXTRA_FIELDS/FIELD[key='OpenAireDataSourceId']/value"]);
27
static $varRepoid = xpath:"//dri:repositoryId";
28
static $varOfficialname = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//OFFICIAL_NAME"]);
29
dri:objIdentifier = xpath:"//dri:objIdentifier";
30
dri:repositoryId = $varRepoid;
31
//dri:repositoryId = xpath:"//dri:repositoryId";
32
dri:recordIdentifier = RegExpr(xpath:"//dri:recordIdentifier", $var0, "s/^(.*)(::)/$2/");
33
if xpath:"//dc:creator[string-length(normalize-space(.)) &gt; 0][contains(., 'CDATA')][starts-with(normalize-space(.), '(')][starts-with(normalize-space(.), '.')]" dc:creator = skipRecord(); else $varDummy = "''";
34
//apply xpath:"//dc:creator" if xpath:"string-length(normalize-space(.)) &amp;gt; 0 and not(contains(., 'CDATA')) and not(starts-with(normalize-space(.), '.')) and not(starts-with(normalize-space(.), '('))" dc:creator = Convert(xpath:".", Person); else $varDummy = "''";
35
if xpath:"count(//dc:creator) = 0" dc:creator = skipRecord(); else $varDummy = "''";
36
apply xpath:"//dc:creator" if xpath:"string-length(.) &gt; 0" dc:creator = xpath:"normalize-space(.)"; else $varDummy = "''";
37
apply xpath:"//dc:title" if xpath:"string-length(.) &gt; 0" dc:title = xpath:"normalize-space(.)"; else $varDummy = "''";
38
apply xpath:"//dc:subject" if xpath:"string-length(.) &gt; 0" dc:subject = xpath:"normalize-space(.)"; else $varDummy = "''";
39
apply xpath:"//dc:publisher" if xpath:"string-length(.) &gt; 0" dc:publisher = xpath:"normalize-space(.)"; else $varDummy = "''";
40
apply xpath:"//dc:source" if xpath:"string-length(.) &gt; 0" dc:source = xpath:"normalize-space(.)"; else $varDummy = "''";
41
dc:contributor = xpath:"//dc:contributor";
42
dc:description = xpath:"//dc:description";
43
$varHttpTest = "''";
44
if xpath:"//dc:relation[starts-with(., 'http')]" $varHttpTest = "true"; else dc:identifier = skipRecord();
45
apply xpath:"//dc:relation" if xpath:"starts-with(normalize-space(.), 'http')" dc:identifier = xpath:"normalize-space(.)"; else dr:CobjIdentifier = xpath:"normalize-space(.)";
46
static dr:dateOfCollection = getValue(CURRENTDATE, []);
47
// dc:type = xpath:"//dc:type";
48
dc:language = Convert(xpath:"//dc:language", Languages);
49
//if xpath:"//dc:rights[text()='info:eu-repo/semantics/openAccess']" dc:publisher = xpath:"//dc:publisher"; else dc:publisher = skipRecord();
50
dc:date = xpath:"//dc:date";
51
oaf:dateAccepted = Convert(xpath:"descendant-or-self::dc:date", DateISO8601, "yyyy-MM-dd", "min()");
52
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 = "''";
53
//apply xpath:"//dc:relation" if xpath:"string-length(substring-after(normalize-space(.), 'info:eu-repo/grantAgreement/EC/FP7/')) = 6" oaf:projectid = RegExpr(xpath:"normalize-space(.)", $var1, "s/^(.*info:eu-repo\/grantAgreement\/EC\/FP7\/)//gmi"); else dc:relation = xpath:"normalize-space(.)";
54
//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(.)";
55
//
56
static $varDsType = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//CONFIGURATION/DATASOURCE_TYPE"]);
57
//if xpath:"$varDsType='aggregator'" oaf:hostingDatasourceid = xpath:"//prov:baseURL"; else oaf:hostingDatasourceid = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//EXTRA_FIELDS/FIELD[key='OpenAireDataSourceId']/value"]);
58
oaf:collectedDatasourceid = $varDatasourceid;
59
//
60
// apply xpath:"//dc:type" if xpath:"." dr:CobjCategory = Convert(xpath:"normalize-space(.)", TextTypologies); else dc:type = xpath:".";
61
dr:CobjCategory = "0001";
62
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:".";
63
if xpath:"//dc:rights[starts-with(normalize-space(.), 'info:eu-repo/semantics')]" $var0 = "''"; else oaf:accessrights = "OPEN";
64
//if xpath:"count(//dc:rights) = 0" oaf:accessrights = "OPEN"; else $var0 = "''";
65
// oaf:accessrights = Convert(xpath:"normalize-space(//dc:rights)", AccessRights);
66
//
67
static oaf:collectedFrom = set("''", @name = $varOfficialname; , @id = $varDatasourceid;);
68
static oaf:hostedBy = set("''", @name = $varOfficialname; , @id = $varDatasourceid;);
69
//
70
$varId = identifierExtract('["//dc:identifier", "//dc:relation"]' , xpath:"./*[local-name()='record']" , '(10[.][0-9]{4,}[^\s"/&lt;&gt;]*/[^\s"&lt;&gt;]+)');
71
oaf:identifier = set(xpath:"$varId//value", @identifierType = "doi";);
72
oaf:datasourceprefix = xpath:"//oaf:datasourceprefix";
73
$varJournalName = xpath:"substring-before(//dc:source, ',')";
74
oaf:journal = set($varJournalName, @issn = xpath:"//dc:identifier[string-length() = 9 and matches(., '(\d{4})-(\d{4})')][1]"; , @eissn = xpath:"//dc:identifier[string-length() = 9 and matches(., '(\d{4})-(\d{4})')][2]";);
75
end</CODE>
76
            </SCRIPT>
77
        </CONFIGURATION>
78
        <STATUS/>
79
        <SECURITY_PARAMETERS/>
80
    </BODY>
81
</RESOURCE_PROFILE>
(12-12/56)