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<xsl:output method="text" />
23
24<xsl:template name="predicate-of">
25 <xsl:param name="about"/>
26 <xsl:choose>
27  <xsl:when test="substring-after($about, '/')">
28   <xsl:call-template name="predicate-of">
29     <xsl:with-param name="about" select="substring-after($about, '/')"/>
30   </xsl:call-template>
31  </xsl:when>
32  <xsl:otherwise>
33     <xsl:choose>
34       <xsl:when test="substring-after($about, '#')">
35         <xsl:if test="substring-before($about, '#') != 'XMLSchema'"><xsl:value-of select="substring-before($about, '#')"/>:</xsl:if><xsl:value-of select="substring-after($about, '#')"/>
36       </xsl:when>
37       <xsl:otherwise>DC:<xsl:value-of select="$about"/></xsl:otherwise>
38    </xsl:choose>
39  </xsl:otherwise>
40 </xsl:choose>
41</xsl:template>
42<xsl:template match="rdf:RDF">
43@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
44@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .
45@prefix owl: &lt;http://www.w3.org/2002/07/owl#&gt; .
46@prefix xsl: &lt;http://www.w3.org/1999/XSL/Transform#&gt; .
47@prefix nid3: &lt;http://www.semanticdesktop.org/ontologies/2007/05/10/nid3#&gt; .
48@prefix nfo: &lt;http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#&gt; .
49@prefix nmo: &lt;http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#&gt; .
50@prefix nie: &lt;http://www.semanticdesktop.org/ontologies/2007/01/19/nie#&gt; .
51@prefix exif: &lt;http://www.kanzaki.com/ns/exif#&gt; .
52@prefix nao: &lt;http://www.semanticdesktop.org/ontologies/2007/08/15/nao#&gt; .
53@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
54@prefix protege: &lt;http://protege.stanford.edu/system#&gt; .
55@prefix dcterms: &lt;http://purl.org/dc/terms/&gt; .
56@prefix ncal: &lt;http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#&gt; .
57@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .
58@prefix nrl: &lt;http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#&gt; .
59@prefix pimo: &lt;http://www.semanticdesktop.org/ontologies/2007/11/01/pimo#&gt; .
60@prefix geo: &lt;http://www.w3.org/2003/01/geo/wgs84_pos#&gt; .
61@prefix tmo: &lt;http://www.semanticdesktop.org/ontologies/2008/05/20/tmo#&gt; .
62@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .
63@prefix nco: &lt;http://www.semanticdesktop.org/ontologies/2007/03/22/nco#&gt; .
64@prefix nexif: &lt;http://www.semanticdesktop.org/ontologies/2007/05/10/nexif#&gt; .
65
66<xsl:for-each select="rdfs:Class">
67<xsl:variable name="about" select="@rdf:about"/>
68<xsl:variable name="pos" select="position()"/>_:a<xsl:value-of select="$pos"/><xsl:text> </xsl:text>a<xsl:text> </xsl:text><xsl:call-template name="predicate-of"><xsl:with-param name="about"><xsl:value-of select="@rdf:about"/></xsl:with-param></xsl:call-template><xsl:text> </xsl:text>.
69
70<xsl:for-each select="/rdf:RDF/rdf:Property/rdfs:domain[@rdf:resource=$about]">
71<xsl:choose>
72<xsl:when test="substring-after(../rdfs:range/@rdf:resource, '#') = 'string'">_:a<xsl:value-of select="$pos"/><xsl:text> </xsl:text><xsl:call-template name="predicate-of"><xsl:with-param name="about"><xsl:value-of select="../@rdf:about"/></xsl:with-param></xsl:call-template><xsl:text> "stringly data for </xsl:text><xsl:call-template name="predicate-of"><xsl:with-param name="about"><xsl:value-of select="../@rdf:about"/></xsl:with-param></xsl:call-template><xsl:text>" .
73</xsl:text>
74</xsl:when>
75<xsl:otherwise>
76</xsl:otherwise>
77</xsl:choose>
78
79</xsl:for-each>
80
81</xsl:for-each>
82</xsl:template>
83</xsl:stylesheet>
84