Project

General

Profile

1
<?xml version="1.0" encoding='iso-8859-1' ?>
2
<xsl:stylesheet xmlns:xalan="http://xml.apache.org/xalan" 
3
   				 xmlns:java="http://xml.apache.org/xalan/java"
4
				xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
5
				version='1.0' 
6
				xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
7
				xmlns="urn:lsid:@METADATA_LABELS@:predicates:"
8
				xmlns:pred="urn:lsid:i3c.org:predicates:"
9
				xmlns:dc="http://purl.org/dc/elements/1.1/"
10
				xmlns:eml="eml://ecoinformatics.org/eml-2.0.1"
11
				exclude-result-prefixes="java seek">
12
				
13
				<xsl:template match="/eml:eml">
14

    
15
						<xsl:variable name="metacatServer">@METACAT_SERVER@</xsl:variable>
16
						<rdf:RDF>
17
							<xsl:apply-templates select="dataset" />				
18
		 					
19
							<rdf:Description>
20
								<xsl:attribute name="rdf:about">
21
								  <xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
22
							  </xsl:attribute> 
23
							  <xsl:element name="dc:format">
24
		 					  	<xsl:attribute name="rdf:resource">
25
		 					  	  <xsl:text>urn:lsid:i3c.org:formats:text</xsl:text>
26
		 					  	</xsl:attribute>
27
		 					  </xsl:element>	
28
						</rdf:Description>
29
						
30
						<rdf:Description>
31
								<xsl:attribute name="rdf:about">
32
								  <xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
33
							  </xsl:attribute> 
34
							  <xsl:element name="pred:storedas">
35
		 					  	<xsl:attribute name="rdf:resource">
36
								  <xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
37
		 					  	</xsl:attribute>
38
		 					  </xsl:element>
39
						</rdf:Description>
40
						
41
						<rdf:Description>
42
								<xsl:attribute name="rdf:about">
43
								  <xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
44
							  </xsl:attribute> 
45
							  <xsl:element name="rdf:type">
46
		 					  	<xsl:attribute name="rdf:resource">
47
		 					  	  <xsl:text>urn:lsid:i3c.org:types:content</xsl:text>
48
		 					  	</xsl:attribute>
49
		 					  </xsl:element>	
50
						</rdf:Description>
51

    
52
						<rdf:Description>
53
								<xsl:attribute name="rdf:about">
54
								  <xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
55
							  </xsl:attribute> 
56
		 					<pred:htmlVersion xmlns:pred="urn:lsid:@METADATA_LABELS@:predicates:">
57
								<xsl:text>&lt;a href=&quot;</xsl:text>
58
								<xsl:value-of select="concat(concat($metacatServer,'?action=read&amp;qformat=knb&amp;docid='),@packageId)"/>
59
								<xsl:text>&quot;&gt;</xsl:text>
60
								<xsl:value-of select="concat(concat($metacatServer,'?action=read&amp;qformat=knb&amp;docid='),@packageId)"/>
61
								<xsl:text>&lt;/a&gt;</xsl:text>
62

    
63
		 					</pred:htmlVersion> 
64

    
65
						</rdf:Description>
66

    
67
						<rdf:Description>
68
								<xsl:attribute name="rdf:about">
69
								  <xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
70
							  </xsl:attribute> 
71
		 					<pred:xmlVersion xmlns:pred="urn:lsid:@METADATA_LABELS@:predicates:">
72
								<xsl:text>&lt;a href=&quot;</xsl:text>
73
								<xsl:value-of select="concat(concat($metacatServer,'?action=read&amp;qformat=xml&amp;docid='),@packageId)"/>
74
								<xsl:text>&quot;&gt;</xsl:text>
75
								<xsl:value-of select="concat(concat($metacatServer,'?action=read&amp;qformat=xml&amp;docid='),@packageId)"/>
76
								<xsl:text>&lt;/a&gt;</xsl:text>
77
		 					</pred:xmlVersion> 
78

    
79
						</rdf:Description>
80
						<rdf:Description>
81
								<xsl:attribute name="rdf:about">
82
								  <xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
83
							  </xsl:attribute> 
84
							  <xsl:element name="rdf:type">
85
		 					  	<xsl:attribute name="rdf:resource">
86
		 					  	  <xsl:text>urn:lsid:i3c.org:types:content</xsl:text>
87
		 					  	</xsl:attribute>
88
		 					  </xsl:element>	
89
						</rdf:Description>
90
						
91
					 </rdf:RDF>
92
				</xsl:template>
93
				
94
				<xsl:template match="dataset">
95
						<rdf:Description>
96
							<xsl:attribute name="rdf:about">
97
								<xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
98
							</xsl:attribute>
99
		 					<pred:title xmlns:pred="http://purl.org/dc/elements/1.1/">
100
		 						<xsl:value-of select="title" />
101
		 					</pred:title> 
102
						</rdf:Description>
103

    
104
						<rdf:Description>
105
							<xsl:attribute name="rdf:about">
106
								<xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
107
							</xsl:attribute>
108
		 					<pred:creator xmlns:pred="urn:lsid:@METADATA_LABELS@:predicates:">
109
		 						<xsl:value-of select="creator" />
110
		 					</pred:creator> 
111
						</rdf:Description>
112

    
113
						<rdf:Description>
114
							<xsl:attribute name="rdf:about">
115
								<xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
116
							</xsl:attribute>
117
		 					<pred:contact xmlns:pred="urn:lsid:@METADATA_LABELS@:predicates:">
118
		 						<xsl:value-of select="contact" />
119
		 					</pred:contact> 
120
						</rdf:Description>
121

    
122
						<xsl:apply-templates select="keywordSet/keyword" />
123
						<xsl:apply-templates select="distribution/online/url" />
124
						
125
					</xsl:template>
126

    
127
					<xsl:template match="keyword">
128
						<rdf:Description>
129
							<xsl:attribute name="rdf:about">
130
								<xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
131
							</xsl:attribute>
132
		 					<pred:keyword xmlns:pred="urn:lsid:@METADATA_LABELS@:predicates:">
133
								<xsl:value-of select="@keywordType"/>
134
								<xsl:text>=</xsl:text>
135
		 						<xsl:value-of select="." />
136
		 					</pred:keyword> 
137
						</rdf:Description>
138
					</xsl:template>
139

    
140
					<xsl:template match="url">
141
						<rdf:Description>
142
							<xsl:attribute name="rdf:about">
143
								<xsl:value-of select="java:edu.ucsb.nceas.metacat.lsid.LSIDAuthorityMetaData.getLSID()" />
144
							</xsl:attribute>
145
		 					<pred:associatedInfo xmlns:pred="urn:lsid:@METADATA_LABELS@:predicates:">
146
		 					
147
		 						<xsl:choose>
148
		 							<xsl:when test="starts-with(., 'ecogrid://')">
149
		 								<xsl:value-of select="concat('urn:lsid:@LSID_AUTHORITY_STRING@:',substring-after(.,'ecogrid://knr/'))"/>
150
									</xsl:when>
151
									<xsl:otherwise>
152
										<xsl:text>&lt;a href=&quot;</xsl:text>
153
										<xsl:value-of select="."/>
154
										<xsl:text>&quot;&gt;</xsl:text>
155
										<xsl:value-of select="."/>
156
										<xsl:text>&lt;/a&gt;</xsl:text>
157
									</xsl:otherwise>
158
								</xsl:choose>
159
		 					</pred:associatedInfo> 
160
						</rdf:Description>
161
				</xsl:template>
162
</xsl:stylesheet>
163

    
(2-2/8)