source: cats/ISOcat/trunk/mod-ISOcat-interface-rest/representations/rdf/dc.xsl @ 5364

Last change on this file since 5364 was 5364, checked in by Menzo Windhouwer, 10 years ago

M mod-ISOcat-access-data/dbx/DCIF.xml
M mod-ISOcat-interface-rest/representations/html/datacategory.xsl
M mod-ISOcat-interface-rest/representations/dcs2/html.xsl
M mod-ISOcat-interface-rest/representations/rdf/dc.xsl

  • added the CC-BY license
File size: 3.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:dcif="http://www.isocat.org/ns/dcif" xmlns:dcr="http://www.isocat.org/ns/dcr.rdf#" xmlns:isocat="http://www.isocat.org/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:cc="http://creativecommons.org/ns#" exclude-result-prefixes="dcif isocat">
3    <xsl:output method="xml" encoding="utf-8" indent="yes"/>
4    <xsl:variable name="NL" select="system-property('line.separator')"/>
5    <xsl:variable name="indent" select="'&#160;&#160;&#160;&#160;'"/>
6    <xsl:template match="text()"/>
7    <xsl:template match="dcif:dataCategorySelection">
8        <rdf:RDF>
9            <xsl:apply-templates/>
10        </rdf:RDF>
11    </xsl:template>
12    <xsl:template match="dcif:dataCategory">
13        <rdf:Description>
14            <xsl:attribute name="rdf:about" select="@pid"/>
15            <xsl:for-each select=".//dcif:languageSection">
16                <xsl:variable name="lang" select=".//dcif:language"/>
17                <xsl:choose>
18                    <xsl:when test=".//dcif:nameStatus[normalize-space(.) eq 'preferred name']">
19                        <rdfs:label xml:lang="{$lang}">
20                            <xsl:value-of select="(.//dcif:nameStatus[normalize-space(.) eq 'preferred name']/../dcif:name)[1]"/>
21                        </rdfs:label>
22                    </xsl:when>
23                    <xsl:when test=".//dcif:nameStatus[normalize-space(.) eq 'standardized name']">
24                        <rdfs:label xml:lang="{$lang}">
25                            <xsl:value-of select="(.//dcif:nameStatus[normalize-space(.) eq 'standardized name']/../dcif:name)[1]"/>
26                        </rdfs:label>
27                    </xsl:when>
28                    <xsl:when test=".//dcif:nameStatus[normalize-space(.) eq 'admitted name']">
29                        <rdfs:label xml:lang="{$lang}">
30                            <xsl:value-of select="(.//dcif:nameStatus[normalize-space(.) eq 'admitted name']/../dcif:name)[1]"/>
31                        </rdfs:label>
32                    </xsl:when>
33                    <xsl:when test="$lang eq 'en'">
34                        <rdfs:label xml:lang="{$lang}">
35                            <xsl:value-of select="ancestor::dcif:dataCategory/dcif:administrationInformationSection/dcif:administrationRecord/dcif:identifier"/>
36                        </rdfs:label>
37                    </xsl:when>
38                </xsl:choose>
39                <xsl:if test="exists(./dcif:definitionSection[1]/dcif:definition)">
40                    <rdfs:comment xml:lang="{$lang}">
41                        <xsl:value-of select="./dcif:definitionSection[1]/dcif:definition"/>
42                    </rdfs:comment>
43                </xsl:if>
44                <cc:license rdf:resource="http://creativecommons.org/licenses/by/4.0/"/>
45            </xsl:for-each>
46        </rdf:Description>
47    </xsl:template>
48</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.