(file) Return to provenance.xsl CVS log (file) (dir) Up to [Development] / mygrid / miasgrid / rdf-provenance / etc / ontology

 1 turid 1.1 <xsl:stylesheet
 2           	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 3           	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 4           	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
 5           	xmlns:owl="http://www.w3.org/2002/07/owl#"
 6           	version="1.0">
 7           	
 8 turid 1.3 	<!-- author dturi $Id: provenance.xsl,v 1.2 2005/10/18 15:20:32 turid Exp $ -->
 9 turid 1.1 	
10           	<xsl:output method="text"/>
11           	
12           	<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
13           	<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
14           	
15 turid 1.3 	<xsl:variable name="package">uk.ac.man.cs.img.mygrid.provenance.knowledge.ontology</xsl:variable>
16 turid 1.1 	
17           	<xsl:template match="rdf:RDF">
18           		<xsl:text>package </xsl:text><xsl:value-of select="$package"/><xsl:text>;&#10;</xsl:text>
19           		<xsl:text>/**&#10;</xsl:text>
20           		<xsl:text> * Java constants for classes and predicates in provenance.owl.&#10;</xsl:text>
21           		<xsl:text> * Automatically generated from provenance.owl using provenance.xsl.&#10;</xsl:text>
22           		<xsl:text> */&#10;</xsl:text>
23           		<xsl:text>public class ProvenanceOntologyConstants { &#10;</xsl:text>
24           		<xsl:text>&#10;</xsl:text>
25 turid 1.2 		<xsl:text>	public static final String NS = "http://www.mygrid.org.uk/provenance#"; &#10;</xsl:text>
26 turid 1.1 		<xsl:text>&#10;</xsl:text>
27           		<xsl:text>/**&#10;</xsl:text>
28           		<xsl:text> * Java constants for classes in provenance.owl.&#10;</xsl:text>
29           		<xsl:text> * Automatically generated from provenance.owl using provenance.xsl.&#10;</xsl:text>
30           		<xsl:text> */&#10;</xsl:text>
31           		<xsl:text>	public static class Classes { &#10;</xsl:text>
32           		<xsl:text>&#10;</xsl:text>
33               <xsl:apply-templates select="//owl:Class"/>
34           		<xsl:text>	}&#10;</xsl:text>
35           		<xsl:text>&#10;</xsl:text>
36           		<xsl:text>/**&#10;</xsl:text>
37           		<xsl:text> * Java constants for object properties in provenance.owl.&#10;</xsl:text>
38           		<xsl:text> * Automatically generated from provenance.owl using provenance.xsl.&#10;</xsl:text>
39           		<xsl:text> */&#10;</xsl:text>
40           		<xsl:text>	public static class ObjectProperties { &#10;</xsl:text>
41           		<xsl:text>&#10;</xsl:text>
42               <xsl:apply-templates select="//owl:ObjectProperty"/>
43           		<xsl:text>	}&#10;</xsl:text>
44           		<xsl:text>&#10;</xsl:text>
45           		<xsl:text>/**&#10;</xsl:text>
46           		<xsl:text> * Java constants for datatype properties in provenance.owl.&#10;</xsl:text>
47 turid 1.1 		<xsl:text> * Automatically generated from provenance.owl using provenance.xsl.&#10;</xsl:text>
48           		<xsl:text> */&#10;</xsl:text>
49           		<xsl:text>	public static class DatatypeProperties { &#10;</xsl:text>
50           		<xsl:text>&#10;</xsl:text>
51           		<xsl:apply-templates select="//owl:DatatypeProperty"/>
52           		<xsl:text>	}&#10;</xsl:text>
53           		<xsl:text>}</xsl:text>
54             </xsl:template>
55           	
56           	<xsl:template match="owl:Class">
57           		<xsl:call-template name = "provenance_constant"/>
58           	</xsl:template>
59           	
60           	<xsl:template match="owl:ObjectProperty">
61           		<xsl:call-template name = "provenance_constant"/>
62           	</xsl:template>
63           		
64           	<xsl:template match="owl:DatatypeProperty">
65           		<xsl:call-template name = "provenance_constant"/>
66           	</xsl:template>
67           	
68 turid 1.1 	<xsl:template name="provenance_constant">
69           		<xsl:if test="@rdf:ID!=''">
70                   <xsl:text>		public static final String </xsl:text>
71           					<xsl:value-of select="translate(@rdf:ID,$lcletters,$ucletters)"/>
72           				<xsl:text> = NS + "</xsl:text><xsl:value-of select="@rdf:ID"/>";
73           				<xsl:text>&#10;</xsl:text>
74           		</xsl:if>
75           	</xsl:template>
76           	
77           </xsl:stylesheet>

Rich Cawley
Powered by
ViewCVS 0.9.2