1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet version="1.0"
|
3
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/"
|
4
|
xmlns:dr="http://www.driver-repository.eu/namespace/dr" xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
5
|
xmlns:oaa="http://namespace.openaire.eu/oaa" xmlns:oaf="http://namespace.openaire.eu/oaf"
|
6
|
xmlns:dnet="eu.dnetlib.data.transform.xml.DmfToHbaseXsltFunctions"
|
7
|
xmlns:exslt="http://exslt.org/common" xmlns:action="http://namespace.openaire.eu/action"
|
8
|
extension-element-prefixes="exslt"
|
9
|
exclude-result-prefixes="xsl dc dr dri oaa oaf dnet exslt">
|
10
|
|
11
|
<xsl:output omit-xml-declaration="yes" indent="yes" />
|
12
|
|
13
|
<xsl:template match="/*">
|
14
|
|
15
|
<xsl:variable name="provenance"><xsl:value-of select="//FIELD[@name = 'provenance']"/></xsl:variable>
|
16
|
<xsl:variable name="trust">0.9</xsl:variable>
|
17
|
|
18
|
<xsl:choose>
|
19
|
<xsl:when test="count(//RELATION) = 0">
|
20
|
<ROWS />
|
21
|
</xsl:when>
|
22
|
<xsl:otherwise>
|
23
|
<ROWS>
|
24
|
<xsl:for-each select="//RELATION">
|
25
|
<xsl:choose>
|
26
|
<xsl:when test="./@type = 'resultProject'">
|
27
|
<xsl:variable name="resultId" select="./@source" />
|
28
|
<xsl:variable name="projectId">
|
29
|
<xsl:choose>
|
30
|
<xsl:when test="starts-with(@target, '40|')">
|
31
|
<xsl:value-of select="./@target" />
|
32
|
</xsl:when>
|
33
|
<xsl:otherwise>
|
34
|
<xsl:value-of select="dnet:oafSplitId('project', normalize-space(@target))"/>
|
35
|
</xsl:otherwise>
|
36
|
</xsl:choose>
|
37
|
</xsl:variable>
|
38
|
|
39
|
<ROW key="{$resultId}" columnFamily="resultProject_outcome_isProducedBy">
|
40
|
<QUALIFIER name="{$projectId}" type="base64"><xsl:value-of select="dnet:oafResultProject_Outcome_FromDMF($resultId, $projectId, 'isProducedBy', $provenance, $trust)"/></QUALIFIER>
|
41
|
</ROW>
|
42
|
<ROW key="{$projectId}" columnFamily="resultProject_outcome_produces">
|
43
|
<QUALIFIER name="{$resultId}" type="base64"><xsl:value-of select="dnet:oafResultProject_Outcome_FromDMF($projectId, $resultId, 'produces', $provenance, $trust)"/></QUALIFIER>
|
44
|
</ROW>
|
45
|
</xsl:when>
|
46
|
</xsl:choose>
|
47
|
</xsl:for-each>
|
48
|
</ROWS>
|
49
|
</xsl:otherwise>
|
50
|
</xsl:choose>
|
51
|
</xsl:template>
|
52
|
|
53
|
|
54
|
</xsl:stylesheet>
|