Project

General

Profile

« Previous | Next » 

Revision 55105

Deleted unused rule

View differences:

modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/claims/dc2oaf_cleaning_crossrefclaims.xml
1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="01782ea8-34fb-4ea1-82ef-326081e8a0c6_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2014-07-17T13:01:32+02:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <IMPORTED/>
12
            <SCRIPT>
13
                <TITLE>dc2oaf_cleaning_OPENAIREplus_compliant_crossrefclaims</TITLE>
14
                <CODE><![CDATA[
15
declare_script "dc2oaf_cleaning_OpenAIREplus_compliant_crossrefclaims";
16
declare_ns oaf = "http://namespace.openaire.eu/oaf";
17
declare_ns dri = "http://www.driver-repository.eu/namespace/dri";
18
declare_ns dr = "http://www.driver-repository.eu/namespace/dr";
19
declare_ns dc = "http://purl.org/dc/elements/1.1/";
20
declare_ns prov = "http://www.openarchives.org/OAI/2.0/provenance";
21
$var0 = "''";
22
$var1 = "'corda_______::'";
23
$varDummy = "''";
24
static $varRepoid = xpath:"//dri:repositoryId";
25
$varCollectedFromName = xpath:"//oaf:collectedFrom/@name";
26
$varHostedByName = xpath:"//oaf:hostedBy/@name";
27
$varHostedById = xpath:"//oaf:hostedBy/@id";
28
$varCollectedFromId = xpath:"//oaf:collectedFrom/@id";
29
dri:objIdentifier = xpath:"//dri:objIdentifier";
30
dri:repositoryId = $varRepoid;
31
dri:recordIdentifier = xpath:"//dri:recordIdentifier";
32
apply xpath:"//dc:creator" if xpath:"string-length(.) > 0" dc:creator = xpath:"normalize-space(.)"; else $varDummy = "''";
33
apply xpath:"//dc:title" if xpath:"string-length(.) > 0" dc:title = xpath:"normalize-space(.)"; else $varDummy = "''";
34
apply xpath:"//dc:subject" if xpath:"string-length(.) > 0" dc:subject = xpath:"normalize-space(.)"; else $varDummy = "''";
35
apply xpath:"//dc:publisher" if xpath:"string-length(.) > 0" dc:publisher = xpath:"normalize-space(.)"; else $varDummy = "''";
36
apply xpath:"//dc:source" if xpath:"string-length(.) > 0" dc:source = xpath:"normalize-space(.)"; else $varDummy = "''";
37
dc:contributor = xpath:"//dc:contributor";
38
dc:description = xpath:"//dc:description";
39
$varHttpTest = "''";
40
apply xpath:"//dc:identifier" if xpath:"starts-with(normalize-space(.), 'http')" dc:identifier = xpath:"normalize-space(.)"; else dr:CobjIdentifier = xpath:"normalize-space(.)";
41
if xpath:"count(//dc:identifier) = 1 and count(//dc:identifier[@identifierType='doi']) = 1" dc:identifier = xpath:"concat('http://dx.doi.org/', //dc:identifier[@identifierType='doi'])"; else $varDummy = "''";
42
dr:dateOfCollection = xpath:"//dr:dateOfCollection";
43
// dc:type = xpath:"//dc:type";
44
dc:language = Convert(xpath:"//dc:language", Languages);
45
oaf:dateAccepted = Convert(xpath:"descendant-or-self::dc:dateAccepted", DateISO8601, "yyyy-MM-dd", "min()");
46
oaf:embargoenddate = Convert(xpath:"descendant-or-self::oaf:embargoenddate", DateISO8601, "yyyy-MM-dd", "min()");
47
// 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 = "''";
48
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(.)";
49
//apply xpath:"//dc:relation" if xpath:"string-length(translate(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(.)";
50
//apply xpath:"//dc:relation" if xpath:"starts-with(normalize-space(.), 'info:eu-repo/grantAgreement/EC/FP7')" oaf:projectid = RegExpr(xpath:"normalize-space(.)", $var1, "s/^(.*info:eu-repo\/grantAgreement\/EC\/FP7\/)//gmi"); else dc:relation = xpath:"normalize-space(.)";
51
//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(.)";
52
//
53
dr:CobjCategory = "0001";
54
oaf:accessrights = xpath:"//oaf:accessrights";
55
//
56
oaf:collectedFrom = set("''", @name = $varCollectedFromName; , @id = $varCollectedFromId;);
57
oaf:hostedBy = set("''", @name = $varHostedByName; , @id = $varHostedById;);
58
//
59
oaf:identifier = set(xpath:"//dc:identifier[@identifierType='doi']", @identifierType = "doi";);
60
oaf:datasourceprefix = xpath:"//oaf:datasourceprefix";
61
about = xpath:"//about";
62
end
63
]]></CODE>
64
            </SCRIPT>
65
        </CONFIGURATION>
66
        <STATUS/>
67
        <SECURITY_PARAMETERS/>
68
    </BODY>
69
</RESOURCE_PROFILE>

Also available in: Unified diff