Project

General

Profile

« Previous | Next » 

Revision 29214

preliminary transformationrule profile for crossref claims

View differences:

modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/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
static $varCollectedFromName = "'Crossref'";
26
static $varHostedByName = "'Unknown Repository'";
27
static $varHostedById = "'openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18'";
28
static $varCollectedFromId = "'openaire____::crossref'";
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
dr:dateOfCollection = xpath:"//dr:dateOfCollection";
42
// dc:type = xpath:"//dc:type";
43
dc:language = Convert(xpath:"//dc:language", Languages);
44
oaf:dateAccepted = Convert(xpath:"descendant-or-self::dc:dateAccepted", DateISO8601, "yyyy-MM-dd", "min()");
45
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\/)//gm"); else $var0 = "''";
46
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\/)//gm"); else dc:relation = xpath:"normalize-space(.)";
47
//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\/)//gm"); else dc:relation = xpath:"normalize-space(.)";
48
//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\/)//gm"); else dc:relation = xpath:"normalize-space(.)";
49
//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(.)";
50
//
51
dr:CobjCategory = "0001";
52
oaf:accessrights = xpath:"//oaf:accessrights";
53
//
54
static oaf:collectedFrom = set("''", @name = $varCollectedFromName; , @id = $varCollectedFromId;);
55
static oaf:hostedBy = set("''", @name = $varHostedByName; , @id = $varHostedById;);
56
//
57
oaf:identifier = set(xpath:"//dc:identifier[@identifierType='doi']", @identifierType = "doi";);
58
oaf:datasourceprefix = xpath:"//oaf:datasourceprefix";
59
end
60
]]></CODE>
61
            </SCRIPT>
62
        </CONFIGURATION>
63
        <STATUS/>
64
        <SECURITY_PARAMETERS/>
65
    </BODY>
66
</RESOURCE_PROFILE>

Also available in: Unified diff