1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="22fd8e65-a92e-43da-b310-00ecd6b704b7_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2016-04-02T15:39:14+00:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>ict_fp7_to_oaf</TITLE>
|
14
|
<CODE>declare_script "ict_fp7_to_oaf";
|
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 cr = "http://www.crossref.org/qrschema/2.0";
|
21
|
|
22
|
$var0 = "''";
|
23
|
$var1 = "'corda_______::'";
|
24
|
$varDummy = "''";
|
25
|
$varUnknownRepoId = "'openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18'";
|
26
|
$varUnknownRepoName = "'Unknown Repository'";
|
27
|
static $varDatasourceid = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//EXTRA_FIELDS/FIELD[key='OpenAireDataSourceId']/value"]);
|
28
|
static $varRepoid = xpath:"//dri:repositoryId";
|
29
|
static $varOfficialname = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//OFFICIAL_NAME"]);
|
30
|
dri:objIdentifier = xpath:"//dri:objIdentifier";
|
31
|
dri:repositoryId = $varRepoid;
|
32
|
//dri:repositoryId = xpath:"//dri:repositoryId";
|
33
|
dri:recordIdentifier = RegExpr(xpath:"//dri:recordIdentifier", $var0, "s/^(.*)(::)/$2/");
|
34
|
|
35
|
apply xpath:"//author" if xpath:"string-length(.) > 0" dc:creator = xpath:"normalize-space(.)"; else $varDummy = "''";
|
36
|
apply xpath:"//title" if xpath:"string-length(.) > 0" dc:title = xpath:"normalize-space(.)"; else $varDummy = "''";
|
37
|
apply xpath:"//cr:journal_title" if xpath:"string-length(.) > 0" dc:source = xpath:"normalize-space(.)"; else $varDummy = "''";
|
38
|
$varHttpTest = "''";
|
39
|
apply xpath:"//url" if xpath:"string-length(.) > 0" dc:identifier = xpath:"normalize-space(.)"; else $varDummy = "''";
|
40
|
dr:dateOfCollection = xpath:"//dri:dateOfCollection";
|
41
|
static dr:dateOfTransformation = xpath:"current-dateTime()";
|
42
|
dc:date = xpath:"//year";
|
43
|
oaf:dateAccepted = Convert(xpath:"descendant-or-self::year", DateISO8601, "yyyy-MM-dd", "min()");
|
44
|
apply xpath:"//projectId" if xpath:"string-length(.) > 0" oaf:projectid = xpath:"concat($var1,normalize-space(.))"; else $varDummy = "''";
|
45
|
|
46
|
static $varDsType = getValue(PROFILEFIELD, [xpath:"//dri:repositoryId", xpath:"//CONFIGURATION/DATASOURCE_TYPE"]);
|
47
|
oaf:collectedDatasourceid = $varDatasourceid;
|
48
|
apply xpath:"//dc:type" if xpath:"." dr:CobjCategory = Convert(xpath:"normalize-space(.)", TextTypologies); else dc:type = xpath:".";
|
49
|
dr:CobjCategory = "0001";
|
50
|
oaf:accessrights = "CLOSED";
|
51
|
|
52
|
static oaf:collectedFrom = set("''", @name = $varOfficialname; , @id = $varDatasourceid;);
|
53
|
static oaf:hostedBy = set("''", @name = $varUnknownRepoName; , @id = $varUnknownRepoId;);
|
54
|
//
|
55
|
$varId = identifierExtract('["//document/@id"]' , xpath:"./*[local-name()='record']" , '(10[.][0-9]{4,}[^\s"/<>]*/[^\s"<>]+)');
|
56
|
oaf:identifier = set(xpath:"$varId//value", @identifierType = "doi";);
|
57
|
oaf:datasourceprefix = xpath:"//oaf:datasourceprefix";
|
58
|
static oaf:journal = set(xpath:"//cr:journal_title", @issn = xpath:"//cr:issn[@type = 'print']"; , @eissn = xpath:"//cr:issn[@type = 'electronic']";);
|
59
|
end</CODE>
|
60
|
</SCRIPT>
|
61
|
</CONFIGURATION>
|
62
|
<STATUS/>
|
63
|
<SECURITY_PARAMETERS/>
|
64
|
</BODY>
|
65
|
</RESOURCE_PROFILE>
|