Revision 55960
Added by Alessia Bardi about 4 years ago
odf2hbase.xml | ||
---|---|---|
1 | 1 |
<RESOURCE_PROFILE> |
2 | 2 |
<HEADER> |
3 |
<RESOURCE_IDENTIFIER value="a8258f53-3cc0-4353-879f-699883fd1d0c_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU=" />
|
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType" />
|
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources" />
|
|
6 |
<RESOURCE_URI value="" />
|
|
3 |
<RESOURCE_IDENTIFIER value="a8258f53-3cc0-4353-879f-699883fd1d0c_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 | 7 |
<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/> |
8 | 8 |
</HEADER> |
9 | 9 |
<BODY> |
10 |
<CONFIGURATION>
|
|
11 |
<SOURCE_METADATA_FORMAT name="odf" layout="store" interpretation="cleaned" />
|
|
12 |
<SINK_METADATA_FORMAT name="odf_hbase" />
|
|
13 |
<IMPORTED/>
|
|
14 |
<SCRIPT>
|
|
15 |
<TITLE>xslt_mapping_odf2hbase</TITLE>
|
|
16 |
<CODE>
|
|
17 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
18 |
xmlns:oaf="http://namespace.openaire.eu/oaf" |
|
19 |
xmlns:dnet="eu.dnetlib.data.transform.xml.OdfToHbaseXsltFunctions" |
|
20 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" |
|
21 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" xmlns:exslt="http://exslt.org/common" |
|
22 |
version="1.0" extension-element-prefixes="exslt" |
|
23 |
exclude-result-prefixes="xsl oaf dr dri dnet exslt"> |
|
10 |
<CONFIGURATION>
|
|
11 |
<SOURCE_METADATA_FORMAT name="odf" layout="store" interpretation="cleaned"/> |
|
12 |
<SINK_METADATA_FORMAT name="odf_hbase"/> |
|
13 |
<IMPORTED/>
|
|
14 |
<SCRIPT>
|
|
15 |
<TITLE>xslt_mapping_odf2hbase</TITLE>
|
|
16 |
<CODE>
|
|
17 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
18 |
xmlns:oaf="http://namespace.openaire.eu/oaf"
|
|
19 |
xmlns:dnet="eu.dnetlib.data.transform.xml.OdfToHbaseXsltFunctions"
|
|
20 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
|
21 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" xmlns:exslt="http://exslt.org/common"
|
|
22 |
version="1.0" extension-element-prefixes="exslt"
|
|
23 |
exclude-result-prefixes="xsl oaf dr dri dnet exslt">
|
|
24 | 24 |
|
25 |
<xsl:output omit-xml-declaration="yes" indent="yes"/> |
|
25 |
<xsl:output omit-xml-declaration="yes" indent="yes"/>
|
|
26 | 26 |
|
27 |
<xsl:param name="invisible" select="false()"/> |
|
28 |
<xsl:param name="trust" select="string('0.9')"/> |
|
29 |
<xsl:param name="provenance" select="string('sysimport:crosswalk:datasetarchive')"/> |
|
30 |
<xsl:template match="/*"> |
|
31 |
<xsl:variable name="about" select="/*[local-name() = 'record']/*[local-name() = 'about']"/>
|
|
32 |
<xsl:variable name="dateOfCollection" select="concat('', //dri:dateOfCollection)"/>
|
|
33 |
<xsl:variable name="dateoftransformation" select="concat('', //dr:dateOfTransformation)"/>
|
|
34 |
<xsl:variable name="metadata" select="exslt:node-set(//*[local-name()='metadata']/*)"/>
|
|
35 |
<xsl:variable name="namespaceprefix">
|
|
36 |
<xsl:choose>
|
|
37 |
<!-- TODO check namespaceprefix length is 12 -->
|
|
38 |
<xsl:when test="string-length(//oaf:datasourceprefix) > 0">
|
|
39 |
<xsl:value-of select="//oaf:datasourceprefix"/>
|
|
40 |
</xsl:when>
|
|
41 |
<xsl:otherwise>
|
|
42 |
<xsl:value-of select="unknown_____"/>
|
|
43 |
</xsl:otherwise>
|
|
44 |
</xsl:choose>
|
|
45 |
</xsl:variable>
|
|
27 |
<xsl:param name="invisible" select="false()"/>
|
|
28 |
<xsl:param name="trust" select="string('0.9')"/>
|
|
29 |
<xsl:param name="provenance" select="string('sysimport:crosswalk:datasetarchive')"/>
|
|
30 |
<xsl:template match="/*">
|
|
31 |
<xsl:variable name="about" select="/*[local-name() = 'record']/*[local-name() = 'about']"/>
|
|
32 |
<xsl:variable name="dateOfCollection" select="concat('', //dri:dateOfCollection)"/>
|
|
33 |
<xsl:variable name="dateoftransformation" select="concat('', //dr:dateOfTransformation)"/>
|
|
34 |
<xsl:variable name="metadata" select="exslt:node-set(//*[local-name()='metadata']/*)"/>
|
|
35 |
<xsl:variable name="namespaceprefix">
|
|
36 |
<xsl:choose>
|
|
37 |
<!-- TODO check namespaceprefix length is 12 -->
|
|
38 |
<xsl:when test="string-length(//oaf:datasourceprefix) > 0">
|
|
39 |
<xsl:value-of select="//oaf:datasourceprefix"/>
|
|
40 |
</xsl:when>
|
|
41 |
<xsl:otherwise>
|
|
42 |
<xsl:value-of select="unknown_____"/>
|
|
43 |
</xsl:otherwise>
|
|
44 |
</xsl:choose>
|
|
45 |
</xsl:variable>
|
|
46 | 46 |
|
47 |
<xsl:choose>
|
|
48 |
<xsl:when
|
|
49 |
test="count($metadata) = 0 or normalize-space(//oaf:skipRecord)= 'true'">
|
|
50 |
<ROWS/>
|
|
51 |
</xsl:when>
|
|
52 |
<xsl:otherwise>
|
|
47 |
<xsl:choose>
|
|
48 |
<xsl:when
|
|
49 |
test="count($metadata) = 0 or normalize-space(//oaf:skipRecord)= 'true'">
|
|
50 |
<ROWS/>
|
|
51 |
</xsl:when>
|
|
52 |
<xsl:otherwise>
|
|
53 | 53 |
|
54 |
<xsl:variable name="resultId"
|
|
55 |
select="dnet:oafSimpleId('result', //dri:objIdentifier)"/>
|
|
54 |
<xsl:variable name="resultId"
|
|
55 |
select="dnet:oafSimpleId('result', //dri:objIdentifier)"/>
|
|
56 | 56 |
|
57 |
<xsl:if test="string-length($resultId) > 0">
|
|
58 |
<xsl:variable name="originalids"
|
|
59 |
select="//*[local-name() = 'resource']/*[local-name()='identifier'] | //*[local-name() = 'resource']//*[local-name()='alternateIdentifier']"/>
|
|
60 |
<xsl:variable name="creators" select="//*[local-name() = 'resource']//*[local-name() = 'creators']/*[local-name() = 'creator']"/>
|
|
61 |
<xsl:variable name="titles" select="//*[local-name() = 'resource']//*[local-name() = 'title']"/>
|
|
62 |
<xsl:variable name="subjects" select="//*[local-name() = 'resource']//*[local-name() = 'subject']"/>
|
|
63 |
<xsl:variable name="publisher" select="//*[local-name() = 'resource']//*[local-name() = 'publisher']"/>
|
|
64 |
<xsl:variable name="descriptions" select="//*[local-name() = 'resource']//*[local-name() = 'description']"/>
|
|
65 |
<xsl:variable name="dates" select="//*[local-name() = 'resource']//*[local-name() = 'date']"/>
|
|
66 |
<xsl:variable name="dateaccepted" select="//*[local-name() = 'dateAccepted']"/>
|
|
67 |
<xsl:variable name="resourceType" select="//*[local-name() = 'resource']//*[local-name() = 'resourceType']"/>
|
|
68 |
<xsl:variable name="formats" select="//*[local-name() = 'resource']//*[local-name() = 'format']"/>
|
|
69 |
<xsl:variable name="sizes" select="//*[local-name() = 'resource']//*[local-name() = 'size']"/>
|
|
70 |
<xsl:variable name="rights" select="//*[local-name() = 'accessrights']"/>
|
|
71 |
<xsl:variable name="license" select="//*[local-name() = 'license']"/>
|
|
72 |
<xsl:variable name="version" select="//*[local-name() = 'resource']//*[local-name() = 'version']"/>
|
|
73 |
<xsl:variable name="language" select="//*[local-name() = 'language']"/>
|
|
74 |
<xsl:variable name="cobjcategory" select="//*[local-name() = 'CobjCategory']"/>
|
|
75 |
<xsl:variable name="contributor" select="//*[local-name() = 'resource']//*[local-name() = 'contributor']"/>
|
|
76 |
<xsl:variable name="distributionlocation" select="//*[local-name() = 'resource']//*[local-name() = 'alternateIdentifier' and @alternateIdentifierType='DistributionLocation']"/>
|
|
77 |
<xsl:variable name="documentationUrl" select="//*[local-name() = 'resource']//*[local-name() = 'relatedIdentifier' and @relatedIdentifierType='URL' and @relationType='IsDocumentedBy']"/>
|
|
78 |
<xsl:variable name="landingPage" select="//*[local-name() = 'resource']//*[local-name() = 'alternateIdentifier' and @alternateIdentifierType='LandingPage']/text()"/>
|
|
57 |
<xsl:if test="string-length($resultId) > 0">
|
|
58 |
<xsl:variable name="originalids"
|
|
59 |
select="//*[local-name() = 'resource']/*[local-name()='identifier'] | //*[local-name() = 'resource']//*[local-name()='alternateIdentifier']"/>
|
|
60 |
<xsl:variable name="creators" select="//*[local-name() = 'resource']//*[local-name() = 'creators']/*[local-name() = 'creator']"/>
|
|
61 |
<xsl:variable name="titles" select="//*[local-name() = 'resource']//*[local-name() = 'title']"/>
|
|
62 |
<xsl:variable name="subjects" select="//*[local-name() = 'resource']//*[local-name() = 'subject']"/>
|
|
63 |
<xsl:variable name="publisher" select="//*[local-name() = 'resource']//*[local-name() = 'publisher']"/>
|
|
64 |
<xsl:variable name="descriptions" select="//*[local-name() = 'resource']//*[local-name() = 'description']"/>
|
|
65 |
<xsl:variable name="dates" select="//*[local-name() = 'resource']//*[local-name() = 'date']"/>
|
|
66 |
<xsl:variable name="dateaccepted" select="//*[local-name() = 'dateAccepted']"/>
|
|
67 |
<xsl:variable name="resourceType" select="//*[local-name() = 'resource']//*[local-name() = 'resourceType']"/>
|
|
68 |
<xsl:variable name="formats" select="//*[local-name() = 'resource']//*[local-name() = 'format']"/>
|
|
69 |
<xsl:variable name="sizes" select="//*[local-name() = 'resource']//*[local-name() = 'size']"/>
|
|
70 |
<xsl:variable name="rights" select="//*[local-name() = 'accessrights']"/>
|
|
71 |
<xsl:variable name="license" select="//*[local-name() = 'license']"/>
|
|
72 |
<xsl:variable name="version" select="//*[local-name() = 'resource']//*[local-name() = 'version']"/>
|
|
73 |
<xsl:variable name="language" select="//*[local-name() = 'language']"/>
|
|
74 |
<xsl:variable name="cobjcategory" select="//*[local-name() = 'CobjCategory']"/>
|
|
75 |
<xsl:variable name="contributor" select="//*[local-name() = 'resource']//*[local-name() = 'contributor']"/>
|
|
76 |
<xsl:variable name="distributionlocation" select="//*[local-name() = 'resource']//*[local-name() = 'alternateIdentifier' and @alternateIdentifierType='DistributionLocation']"/>
|
|
77 |
<xsl:variable name="documentationUrl" select="//*[local-name() = 'resource']//*[local-name() = 'relatedIdentifier' and @relatedIdentifierType='URL' and @relationType='IsDocumentedBy']"/>
|
|
78 |
<xsl:variable name="landingPage" select="//*[local-name() = 'resource']//*[local-name() = 'alternateIdentifier' and @alternateIdentifierType='LandingPage']/text()"/>
|
|
79 | 79 |
|
80 |
<xsl:variable name="instanceURI">
|
|
81 |
<xsl:choose>
|
|
82 |
<xsl:when
|
|
83 |
test="string-length( //*[local-name() = 'resource']/*[local-name()='identifier' and ./@identifierType='DOI']) > 0">
|
|
84 |
<xsl:value-of
|
|
85 |
select="concat('http://dx.doi.org','/', //*[local-name() = 'resource']/*[local-name()='identifier' and ./@identifierType='DOI']/text())"/>
|
|
86 |
</xsl:when>
|
|
87 |
<xsl:when test="string-length( //*[local-name() = 'resource']/*[local-name()='identifier' and ./@identifierType='URL']) > 0">
|
|
88 |
<xsl:value-of select="concat('', //*[local-name() = 'resource']/*[local-name()='identifier' and ./@identifierType='URL'])"/>
|
|
89 |
</xsl:when>
|
|
90 |
<xsl:otherwise>
|
|
91 |
<xsl:value-of select="concat('', //*[local-name() = 'resource']//*[local-name()='alternateIdentifier' and ./@alternateIdentifierType='URL'])"/>
|
|
92 |
</xsl:otherwise>
|
|
93 |
</xsl:choose>
|
|
94 |
</xsl:variable>
|
|
80 |
<xsl:variable name="instanceURI">
|
|
81 |
<xsl:choose>
|
|
82 |
<xsl:when
|
|
83 |
test="string-length( //*[local-name() = 'resource']/*[local-name()='identifier' and ./@identifierType='DOI']) > 0">
|
|
84 |
<xsl:value-of
|
|
85 |
select="concat('http://dx.doi.org','/', //*[local-name() = 'resource']/*[local-name()='identifier' and ./@identifierType='DOI']/text())"/>
|
|
86 |
</xsl:when>
|
|
87 |
<xsl:when test="string-length( //*[local-name() = 'resource']/*[local-name()='identifier' and ./@identifierType='URL']) > 0">
|
|
88 |
<xsl:value-of select="concat('', //*[local-name() = 'resource']/*[local-name()='identifier' and ./@identifierType='URL'])"/>
|
|
89 |
</xsl:when>
|
|
90 |
<xsl:otherwise>
|
|
91 |
<xsl:value-of select="concat('', //*[local-name() = 'resource']//*[local-name()='alternateIdentifier' and ./@alternateIdentifierType='URL'])"/>
|
|
92 |
</xsl:otherwise>
|
|
93 |
</xsl:choose>
|
|
94 |
</xsl:variable>
|
|
95 | 95 |
|
96 |
<xsl:variable name="hostedby" select="//oaf:hostedBy"/>
|
|
97 |
<xsl:variable name="collectedfrom" select="//oaf:collectedFrom"/>
|
|
96 |
<xsl:variable name="hostedby" select="//oaf:hostedBy"/>
|
|
97 |
<xsl:variable name="collectedfrom" select="//oaf:collectedFrom"/>
|
|
98 | 98 |
|
99 |
<xsl:variable name="pids"
|
|
100 |
select="//*[local-name() = 'resource']//*[local-name()='identifier'or local-name()='alternateIdentifier']"/>
|
|
99 |
<xsl:variable name="pids"
|
|
100 |
select="//*[local-name() = 'resource']//*[local-name()='identifier'or local-name()='alternateIdentifier']"/>
|
|
101 | 101 |
|
102 |
<xsl:variable name="result"
|
|
103 |
select="dnet:odfResult($resultId, $invisible, $about, $metadata, $titles, $creators, $subjects, $publisher, $descriptions,
|
|
102 |
<xsl:variable name="result"
|
|
103 |
select="dnet:odfResult($resultId, $invisible, $about, $metadata, $titles, $creators, $subjects, $publisher, $descriptions,
|
|
104 | 104 |
$dates, $dateaccepted, $resourceType, $formats, $sizes, $language, $cobjcategory, $contributor, $rights, $license, |
105 | 105 |
$version, $pids, $provenance, $trust, $hostedby, $collectedfrom, $originalids, $instanceURI, $landingPage, $distributionlocation, |
106 | 106 |
$documentationUrl, $dateOfCollection, $dateoftransformation)"/> |
107 | 107 |
|
108 |
<ROWS>
|
|
109 |
<ROW key="{$resultId}" columnFamily="result">
|
|
110 |
<QUALIFIER name="body" type="base64">
|
|
111 |
<xsl:value-of select="$result"/>
|
|
112 |
</QUALIFIER>
|
|
113 |
</ROW>
|
|
108 |
<ROWS>
|
|
109 |
<ROW key="{$resultId}" columnFamily="result">
|
|
110 |
<QUALIFIER name="body" type="base64">
|
|
111 |
<xsl:value-of select="$result"/>
|
|
112 |
</QUALIFIER>
|
|
113 |
</ROW>
|
|
114 | 114 |
|
115 |
<xsl:for-each select="//*[local-name()='projectid']">
|
|
115 |
<xsl:for-each select="//*[local-name()='projectid']">
|
|
116 | 116 |
|
117 |
<xsl:variable name="projectId"
|
|
118 |
select="dnet:oafSplitId('project', normalize-space(.))"/>
|
|
117 |
<xsl:variable name="projectId"
|
|
118 |
select="dnet:oafSplitId('project', normalize-space(.))"/>
|
|
119 | 119 |
|
120 |
<xsl:variable name="resultproject"
|
|
121 |
select="dnet:rel($resultId, $projectId, 'resultProject', 'outcome', 'isProducedBy',
|
|
120 |
<xsl:variable name="resultproject"
|
|
121 |
select="dnet:rel($resultId, $projectId, 'resultProject', 'outcome', 'isProducedBy',
|
|
122 | 122 |
$collectedfrom, $provenance, $trust, $about)"/> |
123 |
<xsl:variable name="projectresult"
|
|
124 |
select="dnet:rel($projectId, $resultId, 'resultProject', 'outcome', 'produces',
|
|
123 |
<xsl:variable name="projectresult"
|
|
124 |
select="dnet:rel($projectId, $resultId, 'resultProject', 'outcome', 'produces',
|
|
125 | 125 |
$collectedfrom, $provenance, $trust, $about)"/> |
126 | 126 |
|
127 |
<xsl:if test="string-length($projectId) > 0">
|
|
128 |
<ROW key="{$resultId}" columnFamily="resultProject_outcome_isProducedBy">
|
|
129 |
<QUALIFIER name="{$projectId}" type="base64">
|
|
130 |
<xsl:value-of select="$resultproject"/>
|
|
131 |
</QUALIFIER>
|
|
132 |
</ROW>
|
|
133 |
<ROW key="{$projectId}" columnFamily="resultProject_outcome_produces">
|
|
134 |
<QUALIFIER name="{$resultId}" type="base64">
|
|
135 |
<xsl:value-of select="$projectresult"/>
|
|
136 |
</QUALIFIER>
|
|
137 |
</ROW>
|
|
138 |
</xsl:if>
|
|
139 |
</xsl:for-each>
|
|
127 |
<xsl:if test="string-length($projectId) > 0">
|
|
128 |
<ROW key="{$resultId}" columnFamily="resultProject_outcome_isProducedBy">
|
|
129 |
<QUALIFIER name="{$projectId}" type="base64">
|
|
130 |
<xsl:value-of select="$resultproject"/>
|
|
131 |
</QUALIFIER>
|
|
132 |
</ROW>
|
|
133 |
<ROW key="{$projectId}" columnFamily="resultProject_outcome_produces">
|
|
134 |
<QUALIFIER name="{$resultId}" type="base64">
|
|
135 |
<xsl:value-of select="$projectresult"/>
|
|
136 |
</QUALIFIER>
|
|
137 |
</ROW>
|
|
138 |
</xsl:if>
|
|
139 |
</xsl:for-each>
|
|
140 | 140 |
|
141 |
<xsl:for-each
|
|
142 |
select="//*[local-name() = 'resource']//*[local-name()='relatedIdentifier' and ./@relatedIdentifierType='OPENAIRE' and ./@relationType='IsSupplementTo']">
|
|
141 |
<xsl:for-each
|
|
142 |
select="//*[local-name() = 'resource']//*[local-name()='relatedIdentifier' and ./@relatedIdentifierType='OPENAIRE' and ./@relationType='IsSupplementTo']">
|
|
143 | 143 |
|
144 |
<!-- relatedDataset ids must be in the openaire format -->
|
|
145 |
<xsl:variable name="targetId" select="dnet:oafSimpleId('result', normalize-space(.))"/>
|
|
144 |
<!-- relatedDataset ids must be in the openaire format -->
|
|
145 |
<xsl:variable name="targetId" select="dnet:oafSimpleId('result', normalize-space(.))"/>
|
|
146 | 146 |
|
147 |
<xsl:if test="string-length($targetId) > 0">
|
|
147 |
<xsl:if test="string-length($targetId) > 0">
|
|
148 | 148 |
|
149 |
<xsl:variable name="resultDataset"
|
|
150 |
select="dnet:rel($resultId, $targetId, 'resultResult', 'supplement', 'isSupplementTo',
|
|
149 |
<xsl:variable name="resultDataset"
|
|
150 |
select="dnet:rel($resultId, $targetId, 'resultResult', 'supplement', 'isSupplementTo',
|
|
151 | 151 |
$collectedfrom, $provenance, $trust, $about)"/> |
152 |
<xsl:variable name="datasetResult"
|
|
153 |
select="dnet:rel($targetId, $resultId, 'resultResult', 'supplement', 'isSupplementedBy',
|
|
152 |
<xsl:variable name="datasetResult"
|
|
153 |
select="dnet:rel($targetId, $resultId, 'resultResult', 'supplement', 'isSupplementedBy',
|
|
154 | 154 |
$collectedfrom, $provenance, $trust, $about)"/> |
155 | 155 |
|
156 |
<ROW key="{$resultId}" columnFamily="resultResult_supplement_isSupplementTo">
|
|
157 |
<QUALIFIER name="{$targetId}" type="base64">
|
|
158 |
<xsl:value-of select="$resultDataset"/>
|
|
159 |
</QUALIFIER>
|
|
160 |
</ROW>
|
|
161 |
<ROW key="{$targetId}" columnFamily="resultResult_supplement_isSupplementedBy">
|
|
162 |
<QUALIFIER name="{$resultId}" type="base64">
|
|
163 |
<xsl:value-of select="$datasetResult"/>
|
|
164 |
</QUALIFIER>
|
|
165 |
</ROW>
|
|
166 |
</xsl:if>
|
|
167 |
</xsl:for-each>
|
|
156 |
<ROW key="{$resultId}" columnFamily="resultResult_supplement_isSupplementTo">
|
|
157 |
<QUALIFIER name="{$targetId}" type="base64">
|
|
158 |
<xsl:value-of select="$resultDataset"/>
|
|
159 |
</QUALIFIER>
|
|
160 |
</ROW>
|
|
161 |
<ROW key="{$targetId}" columnFamily="resultResult_supplement_isSupplementedBy">
|
|
162 |
<QUALIFIER name="{$resultId}" type="base64">
|
|
163 |
<xsl:value-of select="$datasetResult"/>
|
|
164 |
</QUALIFIER>
|
|
165 |
</ROW>
|
|
166 |
</xsl:if>
|
|
167 |
</xsl:for-each>
|
|
168 | 168 |
|
169 |
<xsl:for-each
|
|
170 |
select="//*[local-name() = 'resource']//*[local-name()='relatedIdentifier' and ./@relatedIdentifierType='OPENAIRE' and ./@relationType='IsPartOf']">
|
|
169 |
<xsl:for-each
|
|
170 |
select="//*[local-name() = 'resource']//*[local-name()='relatedIdentifier' and ./@relatedIdentifierType='OPENAIRE' and ./@relationType='IsPartOf']">
|
|
171 | 171 |
|
172 |
<!-- relatedDataset ids must be in the openaire format -->
|
|
173 |
<xsl:variable name="datasetId" select="dnet:oafSimpleId('result', normalize-space(.))"/>
|
|
172 |
<!-- relatedDataset ids must be in the openaire format -->
|
|
173 |
<xsl:variable name="datasetId" select="dnet:oafSimpleId('result', normalize-space(.))"/>
|
|
174 | 174 |
|
175 |
<xsl:if test="string-length($datasetId) > 0">
|
|
175 |
<xsl:if test="string-length($datasetId) > 0">
|
|
176 | 176 |
|
177 |
<xsl:variable name="childParent"
|
|
178 |
select="dnet:rel($resultId, $datasetId, 'resultResult', 'part', 'isPartOf',
|
|
177 |
<xsl:variable name="childParent"
|
|
178 |
select="dnet:rel($resultId, $datasetId, 'resultResult', 'part', 'isPartOf',
|
|
179 | 179 |
$collectedfrom, $provenance, $trust, $about)"/> |
180 |
<xsl:variable name="parentChild"
|
|
181 |
select="dnet:rel($datasetId, $resultId, 'resultResult', 'part', 'hasPart',
|
|
180 |
<xsl:variable name="parentChild"
|
|
181 |
select="dnet:rel($datasetId, $resultId, 'resultResult', 'part', 'hasPart',
|
|
182 | 182 |
$collectedfrom, $provenance, $trust, $about)"/> |
183 | 183 |
|
184 |
<ROW key="{$resultId}" columnFamily="resultResult_part_isPartOf">
|
|
185 |
<QUALIFIER name="{$datasetId}" type="base64">
|
|
186 |
<xsl:value-of select="$childParent"/>
|
|
187 |
</QUALIFIER>
|
|
188 |
</ROW>
|
|
189 |
<ROW key="{$datasetId}" columnFamily="resultResult_part_hasPart">
|
|
190 |
<QUALIFIER name="{$resultId}" type="base64">
|
|
191 |
<xsl:value-of select="$parentChild"/>
|
|
192 |
</QUALIFIER>
|
|
193 |
</ROW>
|
|
194 |
</xsl:if>
|
|
195 |
</xsl:for-each>
|
|
184 |
<ROW key="{$resultId}" columnFamily="resultResult_part_isPartOf">
|
|
185 |
<QUALIFIER name="{$datasetId}" type="base64">
|
|
186 |
<xsl:value-of select="$childParent"/>
|
|
187 |
</QUALIFIER>
|
|
188 |
</ROW>
|
|
189 |
<ROW key="{$datasetId}" columnFamily="resultResult_part_hasPart">
|
|
190 |
<QUALIFIER name="{$resultId}" type="base64">
|
|
191 |
<xsl:value-of select="$parentChild"/>
|
|
192 |
</QUALIFIER>
|
|
193 |
</ROW>
|
|
194 |
</xsl:if>
|
|
195 |
</xsl:for-each>
|
|
196 | 196 |
|
197 |
</ROWS>
|
|
198 |
</xsl:if>
|
|
199 |
</xsl:otherwise>
|
|
200 |
</xsl:choose>
|
|
201 |
</xsl:template> |
|
202 |
</xsl:stylesheet> |
|
203 |
</CODE> |
|
204 |
</SCRIPT>
|
|
205 |
</CONFIGURATION>
|
|
206 |
<STATUS />
|
|
197 |
</ROWS>
|
|
198 |
</xsl:if>
|
|
199 |
</xsl:otherwise>
|
|
200 |
</xsl:choose>
|
|
201 |
</xsl:template>
|
|
202 |
</xsl:stylesheet>
|
|
203 |
</CODE>
|
|
204 |
</SCRIPT>
|
|
205 |
</CONFIGURATION>
|
|
206 |
<STATUS/> |
|
207 | 207 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
208 | 208 |
</BODY> |
209 | 209 |
</RESOURCE_PROFILE> |
Also available in: Unified diff
reformat code