Revision 49882
Added by Sandro La Bruzzo over 6 years ago
dmfwds2hbase.xml | ||
---|---|---|
72 | 72 |
<xsl:variable name="language" select="//oaf:language"/> |
73 | 73 |
<xsl:variable name="cobjcategory" select="//dr:CobjCategory"/> |
74 | 74 |
<xsl:variable name="contributor" select="//*[local-name() = 'contributor']/*[local-name() = 'contributorName']"/> |
75 |
<xsl:variable name="relatedIdentifiers" select="//*[local-name() = 'relatedIdentifier']"/> |
|
75 | 76 |
|
76 | 77 |
<xsl:variable name="relatedIdentifiers" |
77 | 78 |
select="//*[local-name() = 'relatedIdentifier']"/> |
... | ... | |
111 | 112 |
select="dnet:wdsDataset($datasetId, $about, $titles, $subjects, $publisher, $descriptions, |
112 | 113 |
$dates, $dateaccepted, $resourceType, $formats, $sizes, $language, $cobjcategory, $contributor, $rights, |
113 | 114 |
$version, $pids, $geoLocations, $provenance, $trust, $hostedbyid, $hostedbyname, $collectedfromid, |
114 |
$collectedfromname, $originalids, $instanceURI, $dateOfCollection, $dateoftransformation)"/> |
|
115 |
$collectedfromname, $originalids, $instanceURI, $dateOfCollection, $dateoftransformation, $relatedIdentifiers)"/>
|
|
115 | 116 |
|
116 | 117 |
<ROWS> |
117 |
<ROW key="{$datasetId}" columnFamily="dataset"> |
|
118 |
<QUALIFIER name="body" type="base64"> |
|
119 |
<xsl:value-of select="$dataset"/> |
|
120 |
</QUALIFIER> |
|
121 |
</ROW> |
|
122 |
<xsl:for-each select="//*[local-name() = 'creator']"> |
|
118 |
<ROW> |
|
119 |
<xsl:attribute name="value"> |
|
120 |
<xsl:value-of select="$dataset"/> |
|
121 |
</xsl:attribute> |
|
122 |
</ROW> |
|
123 | 123 |
|
124 |
<xsl:variable name="personIdTemp"> |
|
125 |
<xsl:choose> |
|
126 |
<xsl:when test="string-length(./*[local-name() = 'nameIdentifier']) > 0"> |
|
127 |
<xsl:value-of |
|
128 |
select="translate(normalize-space(./*[local-name() = 'nameIdentifier']),' .,','___')"/> |
|
129 |
</xsl:when> |
|
130 |
<xsl:otherwise> |
|
131 |
<xsl:value-of select="translate(normalize-space(./*[local-name() = 'creatorName']),' .,','___')"/> |
|
132 |
</xsl:otherwise> |
|
133 |
</xsl:choose> |
|
134 |
</xsl:variable> |
|
124 |
<!--PUBLICATION RELATIONS--> |
|
125 |
<xsl:for-each |
|
126 |
select="//*[normalize-space(local-name())='relatedIdentifier' and normalize-space(./@entityType)='publication']"> |
|
135 | 127 |
|
136 |
<xsl:variable name="personId" select="dnet:oafId('person', $namespaceprefix, normalize-space($personIdTemp))"/> |
|
128 |
<xsl:variable name="relationSemantic" select="./@relationType"/> |
|
129 |
<xsl:variable name="inverseRelationSemantic" |
|
130 |
select="./@inverseRelationType"/> |
|
137 | 131 |
|
138 |
<xsl:variable name="originalPersonId" select="./*[local-name() = 'nameIdentifier']"/> |
|
132 |
<!-- relatedDataset ids must be in the openaire format --> |
|
133 |
<xsl:variable name="publicationId"> |
|
134 |
<xsl:choose> |
|
135 |
<xsl:when test="./@relatedIdentifierType = 'dnet'"> |
|
136 |
<xsl:value-of select="concat('50|' , . )"/> |
|
137 |
</xsl:when> |
|
138 |
<xsl:otherwise> |
|
139 |
<xsl:value-of |
|
140 |
select="dnet:oafSimpleId('publication', normalize-space(.))"/> |
|
141 |
</xsl:otherwise> |
|
142 |
</xsl:choose> |
|
143 |
</xsl:variable> |
|
144 |
<xsl:if test="string-length($datasetId) > 0"> |
|
145 |
<ROW> |
|
146 |
<xsl:attribute name="value"> |
|
147 |
<xsl:value-of |
|
148 |
select="dnet:createRel($publicationId, $datasetId, $inverseRelationSemantic, 'publication_dataset', $provenance, $trust, $about)"/> |
|
149 |
</xsl:attribute> |
|
150 |
</ROW> |
|
151 |
<ROW> |
|
152 |
<xsl:attribute name="value"> |
|
153 |
<xsl:value-of |
|
154 |
select="dnet:createRel($datasetId, $publicationId, $relationSemantic, 'publication_dataset', $provenance, $trust, $about)"/> |
|
155 |
</xsl:attribute> |
|
156 |
</ROW> |
|
157 |
</xsl:if> |
|
158 |
</xsl:for-each> |
|
139 | 159 |
|
140 |
<xsl:if test="string-length($personId) > 0"> |
|
141 |
<xsl:variable name="position" select="position()"/> |
|
142 |
<xsl:variable name="person" |
|
143 |
select="dnet:person($personId, $about, $provenance, $trust, $collectedfromid, $collectedfromname, |
|
144 |
$originalPersonId, $dateOfCollection, $dateoftransformation, normalize-space(./*[local-name() = 'creatorName']), |
|
145 |
./*[local-name() = 'nameIdentifier'], ./*[local-name() = 'nameIdentifier']/@nameIdentifierScheme)"/> |
|
146 |
<xsl:variable name="persondataset" |
|
147 |
select="dnet:personDataset_Authorship($personId, $datasetId, $position, 'isAuthorOf', $provenance, $trust, $about)"/> |
|
148 |
<xsl:variable name="datasetperson" |
|
149 |
select="dnet:personDataset_Authorship($datasetId, $personId, $position, 'hasAuthor', $provenance, $trust, $about)"/> |
|
160 |
<!--DATASET RELATIONS--> |
|
161 |
<xsl:for-each |
|
162 |
select="//*[normalize-space(local-name())='relatedIdentifier' and normalize-space(./@entityType)='dataset']"> |
|
163 |
<xsl:variable name="relationSemantic" select="./@relationType"/> |
|
164 |
<xsl:variable name="inverseRelationSemantic" |
|
165 |
select="./@inverseRelationType"/> |
|
150 | 166 |
|
151 |
<ROW key="{$personId}" columnFamily="person"> |
|
152 |
<QUALIFIER name="body" type="base64"> |
|
153 |
<xsl:value-of select="$person"/> |
|
154 |
</QUALIFIER> |
|
155 |
</ROW> |
|
156 |
<ROW key="{$personId}" columnFamily="personDataset_authorship_isAuthorOf"> |
|
157 |
<QUALIFIER name="{$datasetId}" type="base64"> |
|
158 |
<xsl:value-of select="$persondataset"/> |
|
159 |
</QUALIFIER> |
|
160 |
</ROW> |
|
161 |
<ROW key="{$datasetId}" columnFamily="personDataset_authorship_hasAuthor"> |
|
162 |
<QUALIFIER name="{$personId}" type="base64"> |
|
163 |
<xsl:value-of select="$datasetperson"/> |
|
164 |
</QUALIFIER> |
|
165 |
</ROW> |
|
166 |
</xsl:if> |
|
167 |
</xsl:for-each> |
|
167 |
<!-- relatedDataset ids must be in the openaire format --> |
|
168 |
<xsl:variable name="relDatasetId"> |
|
169 |
<xsl:choose> |
|
170 |
<xsl:when test="./@relatedIdentifierType = 'dnet'"> |
|
171 |
<xsl:value-of select="concat('60|' , . )"/> |
|
172 |
</xsl:when> |
|
173 |
<xsl:otherwise> |
|
174 |
<xsl:value-of |
|
175 |
select="dnet:oafSimpleId('dataset', normalize-space(.))"/> |
|
176 |
</xsl:otherwise> |
|
177 |
</xsl:choose> |
|
178 |
</xsl:variable> |
|
168 | 179 |
|
169 |
<xsl:for-each select="//*[local-name()='projectid']"> |
|
170 | 180 |
|
171 |
<xsl:variable name="projectId" |
|
172 |
select="dnet:oafSplitId('project', normalize-space(.))"/> |
|
181 |
<xsl:if test="string-length($datasetId) > 0"> |
|
182 |
<ROW> |
|
183 |
<xsl:attribute name="value"> |
|
184 |
<xsl:value-of |
|
185 |
select="dnet:createRel($relDatasetId, $datasetId, $inverseRelationSemantic, 'dataset_dataset', $provenance, $trust, $about)"/> |
|
186 |
</xsl:attribute> |
|
187 |
</ROW> |
|
188 |
<ROW> |
|
189 |
<xsl:attribute name="value"> |
|
190 |
<xsl:value-of |
|
191 |
select="dnet:createRel($datasetId, $relDatasetId, $relationSemantic, 'dataset_dataset', $provenance, $trust, $about)"/> |
|
192 |
</xsl:attribute> |
|
193 |
</ROW> |
|
173 | 194 |
|
174 |
<xsl:variable name="datasetproject" |
|
175 |
select="dnet:rel($datasetId, $projectId, 'datasetProject', 'outcome', 'isProducedBy', $provenance, $trust, $about)"/> |
|
176 |
<xsl:variable name="projectdataset" |
|
177 |
select="dnet:rel($projectId, $datasetId, 'datasetProject', 'outcome', 'produces', $provenance, $trust, $about)"/> |
|
195 |
</xsl:if> |
|
196 |
</xsl:for-each> |
|
178 | 197 |
|
179 |
<xsl:if test="string-length($projectId) > 0"> |
|
180 |
<ROW key="{$datasetId}" columnFamily="datasetProject_outcome_isProducedBy"> |
|
181 |
<QUALIFIER name="{$projectId}" type="base64"> |
|
182 |
<xsl:value-of select="$datasetproject"/> |
|
183 |
</QUALIFIER> |
|
184 |
</ROW> |
|
185 |
<ROW key="{$projectId}" columnFamily="datasetProject_outcome_produces"> |
|
186 |
<QUALIFIER name="{$datasetId}" type="base64"> |
|
187 |
<xsl:value-of select="$projectdataset"/> |
|
188 |
</QUALIFIER> |
|
189 |
</ROW> |
|
190 |
</xsl:if> |
|
191 |
</xsl:for-each> |
|
192 | 198 |
|
193 |
<xsl:for-each |
|
194 |
select="//*[local-name()='relatedIdentifier' and ./@relatedIdentifierType='OPENAIRE' and ./@relationType='IsPartOf']"> |
|
195 | 199 |
|
196 |
<!-- relatedDataset ids must be in the openaire format --> |
|
197 |
<xsl:variable name="targetId" select="dnet:oafSimpleId('dataset', normalize-space(.))"/> |
|
198 | 200 |
|
199 |
<xsl:if test="string-length($targetId) > 0"> |
|
200 | 201 |
|
201 |
<xsl:variable name="childParent" |
|
202 |
select="dnet:rel($datasetId, $targetId, 'datasetDataset', 'part', 'isPartOf', $provenance, $trust, $about)"/> |
|
203 |
<xsl:variable name="parentChild" |
|
204 |
select="dnet:rel($targetId, $datasetId, 'datasetDataset', 'part', 'hasPart', $provenance, $trust, $about)"/> |
|
205 | 202 |
|
206 |
<ROW key="{$datasetId}" columnFamily="datasetDataset_part_isPartOf"> |
|
207 |
<QUALIFIER name="{$targetId}" type="base64"> |
|
208 |
<xsl:value-of select="$childParent"/> |
|
209 |
</QUALIFIER> |
|
210 |
</ROW> |
|
211 |
<ROW key="{$targetId}" columnFamily="datasetDataset_part_hasPart"> |
|
212 |
<QUALIFIER name="{$datasetId}" type="base64"> |
|
213 |
<xsl:value-of select="$parentChild"/> |
|
214 |
</QUALIFIER> |
|
215 |
</ROW> |
|
216 |
</xsl:if> |
|
217 |
</xsl:for-each> |
|
218 | 203 |
|
219 | 204 |
</ROWS> |
220 | 205 |
</xsl:if> |
Also available in: Unified diff
Implemented mapping from DMF to proto for WDS