1<xsl:stylesheet version = '1.0'
2     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
3  xmlns:nid3="http://www.semanticdesktop.org/ontologies/2007/05/10/nid3#"
4  xmlns:nfo="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#"
5  xmlns:nmo="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#"
6  xmlns:nie="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#"
7  xmlns:exif="http://www.kanzaki.com/ns/exif#"
8  xmlns:nao="http://www.semanticdesktop.org/ontologies/2007/08/15/nao#"
9  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
10  xmlns:protege="http://protege.stanford.edu/system#"
11  xmlns:dcterms="http://purl.org/dc/terms/"
12  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
13  xmlns:ncal="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#"
14  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
15  xmlns:nrl="http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#"
16  xmlns:pimo="http://www.semanticdesktop.org/ontologies/2007/11/01/pimo#"
17  xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
18  xmlns:tmo="http://www.semanticdesktop.org/ontologies/2008/05/20/tmo#"
19  xmlns:dc="http://purl.org/dc/elements/1.1/"
20  xmlns:nco="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#"
21  xmlns:nexif="http://www.semanticdesktop.org/ontologies/2007/05/10/nexif#">
22
23<xsl:output method="text" />
24
25<xsl:template name="predicate-of">
26 <xsl:param name="about"/>
27 <xsl:choose>
28  <xsl:when test="substring-after($about, '/')">
29   <xsl:call-template name="predicate-of">
30     <xsl:with-param name="about" select="substring-after($about, '/')"/>
31   </xsl:call-template>
32  </xsl:when>
33  <xsl:otherwise>
34     <xsl:choose>
35       <xsl:when test="substring-after($about, '#')">
36         <xsl:if test="substring-before($about, '#') != 'XMLSchema'"><xsl:value-of select="substring-before($about, '#')"/>:</xsl:if><xsl:value-of select="substring-after($about, '#')"/>
37       </xsl:when>
38       <xsl:otherwise>dc:<xsl:value-of select="$about"/></xsl:otherwise>
39    </xsl:choose>
40  </xsl:otherwise>
41 </xsl:choose>
42</xsl:template>
43
44<xsl:template name="convert-datatype-of">
45 <xsl:param name="datatype"/>
46 <xsl:choose>
47  <xsl:when test="substring-after($datatype, ':')">resource</xsl:when>
48  <xsl:when test="$datatype = 'float'">double</xsl:when>
49  <xsl:when test="$datatype = 'dateTime'">date</xsl:when>
50  <xsl:otherwise><xsl:value-of select="$datatype"/></xsl:otherwise>
51 </xsl:choose>
52</xsl:template>
53
54<xsl:template match="rdf:RDF">
55<xsl:for-each select="rdf:Property">
56
57[<xsl:call-template name="predicate-of"><xsl:with-param name="about"><xsl:value-of select="@rdf:about"/></xsl:with-param></xsl:call-template>]<xsl:choose>
58<xsl:when test="rdfs:range">
59DataType=<xsl:call-template name="convert-datatype-of"><xsl:with-param name="datatype">
60<xsl:call-template name="predicate-of"><xsl:with-param name="about"><xsl:value-of select="rdfs:range/@rdf:resource"/></xsl:with-param></xsl:call-template></xsl:with-param></xsl:call-template>
61</xsl:when>
62<xsl:otherwise>Abstract=true
63DataType=string</xsl:otherwise>
64</xsl:choose>
65<xsl:if test="rdfs:label">
66DisplayName=<xsl:value-of select="rdfs:label"/>
67</xsl:if>
68
69<xsl:if test="rdfs:domain">
70Domain=<xsl:call-template name="predicate-of"><xsl:with-param name="about"><xsl:value-of select="rdfs:domain/@rdf:resource"/></xsl:with-param></xsl:call-template></xsl:if>
71
72<xsl:if test="rdfs:subPropertyOf">
73SuperProperties=<xsl:for-each select="rdfs:subPropertyOf">
74<xsl:if test="@rdf:resource"><xsl:call-template name="predicate-of"><xsl:with-param name="about"><xsl:value-of select="@rdf:resource"/></xsl:with-param></xsl:call-template>;</xsl:if><xsl:for-each select="rdf:Property"><xsl:call-template name="predicate-of"><xsl:with-param name="about"><xsl:value-of select="@rdf:about"/></xsl:with-param></xsl:call-template>;</xsl:for-each></xsl:for-each></xsl:if>
75<xsl:if test="rdfs:comment">
76Description=<xsl:value-of select="rdfs:comment"/></xsl:if>
77</xsl:for-each>
78</xsl:template>
79</xsl:stylesheet>
80