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.DNetDbToHbaseXsltFunctions">
|
7
|
|
8
|
<xsl:output omit-xml-declaration="yes" indent="yes"/>
|
9
|
|
10
|
<xsl:template match="/">
|
11
|
|
12
|
<xsl:variable name="datasourceId" select="dnet:oafSplitId('datasource', //FIELD[@name = 'datasource'])" />
|
13
|
<xsl:variable name="organizationId" select="dnet:oafSplitId('organization', //FIELD[@name = 'organization'])" />
|
14
|
|
15
|
<ROWS>
|
16
|
<xsl:if test="string-length($datasourceId) > 0 and string-length($organizationId) > 0">
|
17
|
|
18
|
<xsl:variable name="datasourceorganization" select="dnet:oafRel('datasourceOrganization', $datasourceId, $organizationId, //FIELD[not(@isNull)], 'provides', 'dnet:datasources_organizations_typologies')"/>
|
19
|
<xsl:variable name="organizationdatasource" select="dnet:oafRel('datasourceOrganization', $organizationId, $datasourceId, //FIELD[not(@isNull)], 'isProvidedBy', 'dnet:datasources_organizations_typologies')"/>
|
20
|
|
21
|
<ROW key="{$datasourceId}" columnFamily="datasourceOrganization_provision_provides">
|
22
|
<QUALIFIER name="{$organizationId}" type="base64"><xsl:value-of select="$datasourceorganization"/></QUALIFIER>
|
23
|
</ROW>
|
24
|
<ROW key="{$organizationId}" columnFamily="datasourceOrganization_provision_isProvidedBy">
|
25
|
<QUALIFIER name="{$datasourceId}" type="base64"><xsl:value-of select="$organizationdatasource"/></QUALIFIER>
|
26
|
</ROW>
|
27
|
</xsl:if>
|
28
|
</ROWS>
|
29
|
|
30
|
</xsl:template>
|
31
|
|
32
|
</xsl:stylesheet>
|